What to observe in the figure above: the left grid is Q with one row per token (n rows) and its columns sliced into coloured blocks of dk each — one block per head; the right grid is a single head's score matrix, square and [n,n] (one cell per pair of tokens, not per feature). Carry that "rows = tokens, score matrix = token × token" picture into every item below.
What to observe in the figure above: the pink measured curve (spread of q⋅k for random vectors) lands exactly on the yellow dashed dk line as dk grows from 1 to 128 — confirming that the typical logit magnitude is dk, so dividing by that constant (blue arrow) restores a spread of about 1.
Each line: statement, then the verdict with a real reason.
Multi-head attention costs roughly h times more compute than one full-width head.
False — one head does an n×n score step costing O(n2dk) and an n×dk value-weighting step also O(n2dk); multiplying by h heads gives h⋅O(n2dk)=O(n2⋅hdk)=O(n2dmodel), the same total FLOPs as one full-width head.
If every head used the same projection matrices WQ,WK,WV, MHA would still help because you average more attention maps.
False — identical projections produce identical heads, so concatenating h copies and blending with WO is no richer than one head. The diversity comes entirely from the projections being different.
The dk scaling factor changes between single-head and multi-head attention.
True in value — inside a head you scale by dk=dmodel/h, not dmodel, because each head's dot products live in the smaller dk-dimensional subspace.
Concatenating the heads already lets them share information with each other.
False — concatenation just stacks them side by side into separate channels; no head has yet "seen" another. The mixing happens only when WO multiplies the concatenation.
The output projection WO is optional — you could feed the raw concatenation to the next layer.
False in practice — without WO the heads stay in fixed, non-interacting slots, so the model cannot learn to combine syntactic + semantic + positional signals. It also fixes which output dimensions each head "owns".
Multi-head attention and single-head attention with the same dmodel have the same number of parameters in their projection matrices.
True — the h per-head matrices WiQ each of shape dmodel×dk stack to one dmodel×dmodel matrix, identical in parameter count to one full-width projection.
Each head must always attend most strongly to a token's own position.
False — self-attention weight is just softmax over learned scores; a head can legitimately put near-zero weight on the diagonal if the useful information lives elsewhere (e.g. a co-reference head looking backward).
In Cross-Attention, multi-head attention still splits into h heads the same way it does in Self-Attention.
True — the head-splitting is independent of whereQ, K, V come from; cross-attention only differs in that K,V come from the encoder while Q comes from the decoder.
Any h works as long as it is at most dmodel.
False — h must dividedmodel so that dk=dmodel/h is a whole number; e.g. h=6 fails for dmodel=512 even though 6<512.
Each line states a flawed claim; the reveal names the specific mistake. (Recall from the definition box: Qi,Ki∈R[n,dk], with n = number of tokens.)
"With dmodel=512 and h=6 heads, each head gets dk=512/6."
The error is choosing an h that does not divide dmodel — 512/6 is not an integer, so concatenation would not return exactly dmodel. h must divide dmodel.
"The scores matrix QiKiT has shape [dk,dk]."
Wrong shape — Qi,Ki are [n,dk] (one row per token), so QiKiT is [n,n]: one score per pair of token positions, not per pair of feature dimensions.
"Softmax is applied over the whole [n,n] scores matrix at once so all entries sum to 1."
The error is the axis — softmax is applied per row, so each query token's weights over the n keys sum to 1, giving n separate probability distributions.
"We sum the head outputs to keep dimension at dmodel."
The error is summing instead of concatenating — summing h vectors of size dv gives one dv-vector and destroys the distinct patterns. Concatenation gives h⋅dv=dmodel while preserving each head.
"WO has shape dv×dmodel."
Wrong input width — WO multiplies the concatenation of width h⋅dv=dmodel, so WO∈Rdmodel×dmodel.
"Adding more heads always improves the model."
The error ignores the trade-off — pushing h up shrinks dk=dmodel/h, so each head has too few dimensions to represent anything useful, and quality falls.
"Positional patterns can't be captured because attention is permutation-agnostic, so MHA is useless for order."
Half-true premise, wrong conclusion — attention is order-blind by itself, which is exactly why Positional Encoding is added to inputs first; a head can then learn positional patterns from those encodings.
Why do we use different projection matrices per head instead of one big shared projection?
Because different WiQ,WiK,WiV send the same input into different subspaces, so each head can specialise on a different relation type (grammar, meaning, position). Shared matrices would collapse all heads into one.
Why divide by dk rather than dk or nothing at all?
As the intuition box shows, a dot product of two random dk-dimensional vectors (mean 0, variance 1 per entry, independent) has variance dk, hence typical magnitude dk; dividing by dk rescales this back to variance 1. Dividing by dk would instead give variance dk/dk2=1/dk — the logits shrink toward 0, softmax becomes nearly uniform, and the head loses its ability to focus. Dividing by nothing leaves variance dk, so softmax saturates and gradients vanish.
Why concatenate the heads before the final projection rather than projecting each head and adding?
Concatenating first lets WO learn arbitrary cross-head mixtures — every output dimension can draw on all heads. Projecting-then-adding would fix each head's contribution independently and forbid cross-head interaction.
Why does MHA use the same scaled dot-product attention formula in every head instead of different mechanisms?
The richness is meant to come from the learned projections, not the mechanism. Reusing one formula keeps every head interpretable in the same way and keeps the implementation a single batched operation. (See Linear Projections in Neural Networks.)
Why is WO needed even though each head already produced a good context vector?
Because the heads sit in disjoint channels of the concatenation; only WO can blend their specialised outputs into a single unified representation for the next layer.
Why can two heads still learn different things even though they start from the identical Q,K,V input?
Their projection matrices are initialised differently and trained by gradient descent, so they descend into different local specialisations — the shared input is filtered through distinct learned lenses. (See Attention Visualization to observe this.)
MHA reduces exactly to single-head attention: dk=dmodel, the "concatenation" is just the one head, and WO becomes an ordinary output projection.
What happens as h→dmodel (each head one-dimensional)?
Each head has dk=1, so its QiKiT scores come from a single scalar feature — heads become extremely weak and can barely encode a relationship, degrading quality despite maximal "diversity".
If a query token's scores are all equal across positions, what does that head output?
Softmax gives a uniform distribution, so the head returns the plain average of all value vectors — a "no-preference" state that ignores content and just pools everything.
If one score is vastly larger than the rest, what does softmax do?
It saturates toward a one-hot weight, so the head effectively copies a single token's value — hard attention as a limiting case of soft attention.
In cross-attention where the encoder has m tokens (a second sequence length, defined in the symbol box) and the decoder has n, what shape are the per-head scores?
Qi is [n,dk] (decoder) and Ki is [m,dk] (encoder), so QiKiT is [n,m] — non-square, one row per decoder token attending over m encoder tokens. (See Cross-Attention.)
What if dv=dk (heads project values to a different width)?
Attention still works — dk only controls the score computation and scaling, while dv controls the output width. Then the concatenation is h⋅dv, so WO must have that as its input dimension.
At the very first layer, before any attention has run, where do Q,K,V come from?
From the token embeddings plus Positional Encoding, each linearly projected — there is no "previous layer" yet, so the raw embedded sequence is the shared input to all heads.
Recall Fast self-test
One-sentence answers — cover and recall.
Does adding heads increase total attention FLOPs? ::: No — shrinking dk keeps it O(n2dmodel).
What single matrix lets heads talk to each other? ::: WO, applied after concatenation.
Why not shared projections across heads? ::: They would produce identical, redundant heads.
Softmax normalises along which axis? ::: Each query row, over the keys.
Which numbers must h divide? ::: dmodel, so that dk is a whole number.