This bank hunts the mental slips around query, key, value matrices — the ideas that feel right but hide a wrong assumption. No heavy arithmetic here (see the worked-examples pages for that). Each line is a question ::: answer reveal: cover the right side, commit to an answer out loud with a reason, then check.
Before any trap, pin down every symbol these questions use. Nothing below is used before it appears here.
The picture below shows one token embedding being fanned out by three different learned matrices into three different roles. Notice the red value vector — it can be a different length (dv) than the black query and key (dk).
True or false: Q, K, and V are three different slices of the input matrix X.
False. They are three separate linear projections XWQ, XWK, XWV of the same full X — every projection sees all dmodel dimensions, nothing is sliced off.
True or false: since Q=XWQ, K=XWK, V=XWV all come from the same X, the three matrices carry identical information.
False. The learned weights WQ,WK,WV are different, so each projection reshapes X into a different subspace — matching-intent, matching-offer, and content — that emphasise different features.
True or false: the weight matrices WQ,WK,WV are fixed by the architecture designer.
False. Only their shapes are fixed. The entries start random and are learned by backpropagation; a translation model tunes them differently than a summariser.
True or false: swapping WQ and WK leaves the attention output unchanged.
False. The score is qi⋅kj=(WQxi)T(WKxj), which is asymmetric — swapping the roles makes token i query with j's intent, changing every relevance score.
True or false: for self-attention, Q, K, and V all come from the same sequence.
True. Self-attention feeds one sequence into all three projections; cross-attention is where Q comes from one sequence and K,V from another.
True or false: dk and dv must be equal.
False. dk sizes the matching space (queries and keys must share it to take a dot product); dv sizes the content space and is free to differ. They are often set equal only for convenience.
True or false: the dot product qi⋅kj requires qi and kj to live in the same-dimension space.
True. A dot product pairs coordinates one-to-one, so queries and keys must both be dk-dimensional — this is exactly why WQ and WK share output size dk.
True or false: making dk larger always improves attention quality.
False. Larger dk inflates dot-product magnitudes, pushing softmax toward saturation and killing gradients — the reason scaled dot-product attention divides by dk.
True or false: the value vector vj decides whether token j is attended to.
False. Whether-to-attend is decided by the query–key score; vj only decides what information token j contributes once it has been selected.
"Attention is symmetric: if i attends strongly to j, then j attends strongly to i." — find the flaw.
The score uses i's query with j's key, while j→i uses j's query with i's key — different vectors from different matrices, so scores are generally unequal.
"We can drop WV and just use the raw embedding xj as the value." — what's wrong?
Then the content space is forced to equal the raw semantic space, removing the model's freedom to separate "what made j relevant" from "what information j should pass on." WV exists precisely to decouple these.
"WQ∈Rdmodel×dk, so Q=WQX." — spot the error.
The multiplication order is wrong. With rows of X being tokens, Q=XWQ; writing WQX has mismatched inner dimensions and would mix tokens instead of projecting each independently.
"Since softmax normalises the scores, scaling by 1/dk is redundant." — why is this wrong?
Softmax normalises the sum, not the spread. Large raw scores make softmax nearly one-hot with vanishing gradients; the scaling controls the spread before softmax, which normalisation cannot fix afterward.
"Because the same X feeds all three, we only need to learn one matrix and reuse it for Q, K, V." — the flaw?
Reusing one matrix collapses query, key, and value into the same space, destroying the asymmetry and the query-vs-content decoupling that make attention expressive.
"The attention output for token i is a weighted sum of the keys kj." — correct it.
It is a weighted sum of the valuesvj: outputi=∑jαi,jvj. Keys only produce the weights α; values carry the information.
Why do we need a separate key projection at all instead of matching queries directly against raw embeddings?
Raw embeddings mix meaning, position and syntax on the same axes; the key projection carves out a subspace where "should I be attended to" is cleanly measurable, independent of raw semantics.
Why is the dot product a sensible measure of relevance rather than, say, elementwise difference?
The dot product measures alignment of direction in the dk matching space via qi⋅kj=∣qi∣∣kj∣cosθ — large-positive means the arrows point the same way, which is exactly "this key answers my query."
Why can dk be smaller than dmodel without losing the ability to attend?
Attention only needs a subspace rich enough to compare relevance, not to store all meaning. A smaller dk also cuts compute and reduces overfitting, since matching needs fewer degrees of freedom than full semantics.
Why is it useful that "cat" can query for verbs (Q–K space) yet supply noun features (V space)?
Because the feature that makes a token relevant differs from the feature it should deliver. Separate WK and WV let one token match on grammatical role and contribute semantic content — impossible with a single projection.
Why are the same linear layers applied to every token position identically?
The projection is content-based, not position-based; applying the same W to each row keeps the operation permutation-consistent, and any position information must already be injected via positional encoding into X.
What is a token's self-relevance score scorei,i, and is it always the largest?
It is qi⋅ki using i's own query and key. Because WQ=WK, this is not guaranteed to be the maximum — a token can attend more strongly to a different token than to itself.
If WQ=0 (all-zero query weights), what happens to attention?
Every qi is the zero vector, so all scores are zero, softmax outputs a uniform distribution, and each output becomes the plain average of all values — attention degenerates into mean-pooling.
For a sequence of length n=1 (a single token), what does attention compute?
The lone token attends only to itself; softmax over one score is 1, so the output is exactly its own value vector v1, regardless of the score value.
If two tokens have identical embeddings, must their query vectors be identical?
Yes. The projection q=xWQ is a deterministic function of x, so equal embeddings give equal queries — any later difference in attention must come from differing positions encoded into X beforehand.
What happens to the softmax weights if all relevance scores for token i are equal?
Softmax returns a uniform distribution αi,j=1/n, and the output is the unweighted average of all value vectors — attention provides no selectivity in this degenerate case.
In multi-head attention, why can one head learn a WQ focused on syntax while another focuses on coreference?
Each head owns independent WQ,WK,WV with their own dk-slice, so they are optimised separately and can specialise on different relational patterns simultaneously.
Symmetry / sameness illusion ::: Treating Q,K,V as the same object ignores that they are three independent learned projections — see "True or false" items 1–2.
Recall The directionality trap
Why attention is not symmetric ::: i→j uses qi⋅kj; j→i uses qj⋅ki — different vectors — see "Spot the error" item 1 and "Edge cases" self-relevance.
Recall The dimension trap
Why dk=dv never breaks ::: dk vanishes inside the dot product, dv only sets output width — see the tiny worked-shapes example.
Recall The softmax trap
What scaling by dk actually fixes ::: The spread of scores before softmax, not the sum — see "Spot the error" item 4.