Skip to main content

Multi-head attention

Lesson notes

One attention head learns one kind of relationship; running many in parallel — each with its own smaller Q/K/V projections, concatenated back together — lets the layer track syntax, coreference, position, and more simultaneously. Plus the modern efficiency variants (MQA/GQA) that shrink the KV cache by sharing keys and values across heads.

Key ideas

  • Heads as parallel relationship detectors
  • Split → attend → concat → project
  • MQA/GQA: fewer KV heads, smaller cache
  • What interpretability finds inside heads (induction heads)

Further reading