Multi-Head Attention
The same scene watched by several viewpoints at once
- Multi-head attention has several separate strands look at the same input differently, then combine into one.
- One strand is called a head. What each head weighs heavily differs from head to head.
- Use a single strand and several relationships blur into an average. Splitting them keeps each relationship sharp.
- Splitting doesn't add more work. The width one strand used to have gets divided up among the heads.
- Whatever each head found is concatenated back into one block at the end before moving on.
Contents
1The analogy
A choir sings the same lyrics, but the parts are split. Sopranos carry the high melody, altos sit below them, tenors and basses go lower still. Same score, same lyrics, yet each part hears and carries a different piece. The four parts merge into one chord at the end and come out as a single sound. This is the structure of multi-head attention.
If the parts weren't split and everyone sang the same line, there'd still be sound, but no thickness to it. The richness of a chord only comes from several different things being sung at the same time.
Splitting the parts doesn't add singers either. It's the same number of people, simply arranged into four groups instead of one.
2In detail
Each head ends up carrying a different relationship
Look closely at what a sentence's heads weighed heavily and fairly distinct personalities show up. One head might consistently lean on the word right before it, catching the flow of speech. Another might link a subject to a verb far apart from it. Another might pile weight onto the start of the sentence or onto punctuation.
No one assigned these roles by hand. As training went on, the heads simply ended up doing different jobs on their own — having several heads do the same thing would be wasteful, so they naturally split apart.
Not every head ends up with a role a person can point to, though. Plenty are hard to explain, and some can be removed with almost no drop in performance.
One strand alone blurs everything
With a single head, only one set of weights gets computed. But a sentence usually has several relationships holding true at the same time. In "the sibling ate the cake Jiyoon bought yesterday," who bought it, what got eaten, and when all need to be tracked separately.
With only one set of weights, all these relationships get crammed into one table and bleed into each other. The result leans strongly toward nothing and sits near the average — like an entire choir singing one melody.
Split the heads and each can watch its own relationship clearly, free to lean weight wherever it wants without stepping on the others.
Splitting doesn't add more work
This is where a common mix-up happens. Grow the heads to eight and it seems like the compute should grow eightfold too — it doesn't. The width one head used to use gets divided into eight instead. Each head works in that narrower slice, and putting them back together restores the original width.
It's the same as a choir splitting into four parts without gaining more singers — just a different arrangement of the same people. That's how the compute cost stays about the same while expressive power goes up.
Everything gets merged into one block at the end
What each head produces doesn't stay separate. The results are concatenated in order into one block at the original width, and that block goes through one more cleanup pass, where the heads' results mix and their weight gets adjusted.
Stop at just concatenating and the heads would remain strangers to each other. That final cleanup is what turns four parts into one chord.
More heads isn't always better
Keep adding heads and the width each one gets keeps shrinking. Too narrow, and there isn't enough room to hold information, so performance can actually drop. Model size sets a reasonable count, usually somewhere between eight and a few dozen.
Looking at a trained model, a fair number of heads turn out to carry little role at all — and methods for trimming those out to make a model lighter have been studied too.
3More precisely
Multi-head attention splits the input into as many subspaces as there are heads, runs attention separately in each, then concatenates the results and applies one more linear transform back to the original size. Each head's dimension is usually the total dimension divided by the head count, so overall compute stays close to what a single head would use.
Each head learns its own query, key, and value transforms. Because those transforms differ, the same input still produces a different weight table per head. Head count and per-head dimension are usually kept the same across every layer.
The analogy breaks down in a couple of places. A choir's parts have their vocal range written into the score ahead of time; heads have no such assignment — what a head ends up doing simply falls out of training, and people can only guess afterward by inspecting it, and the guess is often wrong. And a choir's voices actually overlap and ring together in the air, while a head's results aren't overlapped so much as placed side by side and then remixed by that final cleanup step.
4Try it yourself
5Common misconceptions
It's easy to think adding heads scales up compute by the same amount, but actually the total width gets divided among them, so cost stays close to flat.
It's easy to think more heads always means better performance, but actually each head's width shrinks, and going too far can make results worse.
It's easy to think a person assigned each head its role, but actually the split happens on its own during training, and plenty of heads defy easy explanation.
7One-line summary
In shortMulti-head attention is like a choir's parts: several strands look at the same sentence differently, then merge into one chord.
Spotted an error or have a better analogy? Suggest an edit · Last updated2026-09-02