Multi-Head Attention
An attention mechanism where multiple ‘heads’ work in parallel instead of just one. Each head looks at the text from its own angle.
Why Multiple Heads
One head catches the connection ‘pronoun → noun’. Another — ‘verb → object’. A third — positional patterns. Together they provide a rich representation.
How It Works
- Input vectors are divided into several projections (heads).
- Each head calculates its own self-attention.
- The results are concatenated back together.
Role in Transformer
Multi-head attention is the heart of the Transformer. This block gives the model the ability to see connections between all words in the text simultaneously.