Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Glossary › Attention head

What is attention head?

One of several attention operations that run side by side in a layer, each with its own weights, so that different relationships between tokens can be followed at once.

Where it is taught

Heads, layers and what they learn. One attention pattern is not enough. A transformer runs several side by side and stacks them many layers deep, and each ends up with a job of its own.

What the lesson leaves you with

  • Multi-head attention runs several smaller attention operations in parallel.
  • Stacking layers lets later attention build on relationships found earlier.
  • The roles of heads are discovered by training, not assigned by people.
Open the lesson

Questions

What is attention head?
One of several attention operations that run side by side in a layer, each with its own weights, so that different relationships between tokens can be followed at once.
Where is attention head used in AI?
One attention pattern is not enough. A transformer runs several side by side and stacks them many layers deep, and each ends up with a job of its own.
What is the key idea to remember about attention head?
Multi-head attention runs several smaller attention operations in parallel.
Where can I learn attention head step by step?
In the lesson “Heads, layers and what they learn” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.

Related terms

  • Attention
  • Autoregressive
  • Byte-pair encoding
  • Causal mask
  • Context length
  • Layer normalisation