3.5.9 · D5Sequence Models
Question bank — The attention mechanism intuition



True or false — justify
Attention removes the need for an RNN encoder entirely in a Bahdanau-style seq2seq.
False — without the RNN the states collapse to bare word embeddings with no surrounding context, so attention would be looking up context-free vectors. See RNN and LSTM fundamentals.
The attention weights always sum to exactly 1 for a fixed decoder step .
True — softmax normalizes over all encoder positions, so by construction; that is what lets us read them as "percent of focus".
A high proves that source word causes the output word at step .
False — attention is correlation, not causation; a high weight only means was useful for the prediction, which could be agreement, co-occurrence, or a spurious shortcut.
Softmax guarantees the model focuses sharply on one input position.
False — if all scores are roughly equal, softmax returns a near-uniform , which is deliberately diffuse and can be the correct behaviour.
In Bahdanau attention the alignment score uses the current decoder state .
False — it uses , because is needed to compute ; you cannot align with a state that does not exist yet.
Attention makes the fixed-length context bottleneck of vanilla seq2seq disappear.
True — instead of one frozen vector , each decoder step builds a fresh weighted summary of all encoder states, so long-sequence detail no longer has to squeeze through one vector. See Information bottleneck.
Multiplicative (Luong) and additive (Bahdanau) attention always give identical weights.
False — they use different score functions ( vs ) and even different timing of , so their learned alignments differ.
Because attention adds scores, it is asymptotically cheaper than the RNN itself.
False — the quadratic attention cost is often the dominant term for long sequences; that quadratic growth is exactly why sparse/efficient attention was later invented.
Permuting the encoder outputs leaves the final translation unchanged.
False — the weights permute along with the states so the weighted sum is preserved, but the encoder RNN itself is order-sensitive, so in practice reordering the inputs changes the and thus the output.
Spot the error
"We compute directly and feed it to the decoder."
Missing the normalization denominator — you must divide by so the weights are non-negative and sum to 1; without it they are unbounded and do not form a distribution, letting scale arbitrarily.
"The context vector is ."
Wrong operand — the weighted sum is over the encoder states , not the decoder state; .
"Since the decoder-state length and encoder-state length differ, we just add inside the score."
You cannot add vectors of different lengths (); that is precisely why the learned matrices and project both into a shared space of size before the .
"Attention weights are learned parameters we store after training."
They are computed at inference time for every step from the current states; the learned parameters are the projection matrices and the score vector , not the 's themselves.
"A diagonal attention heatmap means the model is broken."
A clean diagonal means monotonic alignment (natural for OCR or speech), which is healthy; scattered patterns appear for reordering languages. See Neural machine translation.
"We drop and use as the score."
That leaves a vector of length , but a score must be a single scalar; the dot product with the learned vector is what collapses it to one number.
Why questions
Why is fed into the decoder both to update and to generate the prediction ?
Once to decide what information to store in the state and once to decide what to emit now; empirically using it in both places improves output quality.
Why do we pass alignment through a before scoring?
The builds a learned nonlinear "compatibility space" so the model can encode relationships more expressive than a raw linear match.
Why is softmax preferred over simply picking the single highest-scoring ?
Hard selection is non-differentiable and brittle; softmax gives a smooth, differentiable soft lookup that can blend several positions and be trained by gradient descent. See Gradient flow in deep networks.
Why does attention help most on long sequences specifically?
Short inputs fit comfortably in one context vector, but long inputs overflow the fixed bottleneck; attention grants each decoder step a targeted view, so information loss no longer scales with length.
Why can two different tasks both be "correct" with opposite attention entropies ?
Focused (low-) attention fits word-alignment tasks like translation, while diffuse (high-) attention fits tasks like summarization that must blend many positions — the right shape depends on the task, not on a universal rule.
Why does attention count as interpretability but not proof?
The weights show where the model looked, giving a readable window, but "looked at" does not equal "was caused by", so patterns must be checked against domain knowledge.
Edge cases
If every encoder score is identical, what is ?
The weights become uniform , so is the plain average of all — a completely unfocused summary, equivalent to no selective attention.
For an input of length , what does attention reduce to?
With one position, softmax forces , so every step — attention degenerates to just reusing that single state.
What is the attention entropy at its maximum, and when?
It is maximal, (in nats), exactly when attention is uniform; it drops toward as the mass concentrates on one position.
Can an attention weight ever be exactly or exactly ?
Not with a plain softmax on finite scores — outputs are strictly in ; you only approach or as a score's gap grows without bound.
What happens to alignment for the very first decoder step when there is no emitted word yet?
You still have the initial decoder state — typically built from the encoder (e.g. the last state through a small learned layer) — so scoring proceeds against ; there is no missing-state problem because is always defined, and exists by that initialization.
For English→Japanese where word order reverses, what does the heatmap look like and is it wrong?
An anti-diagonal or scattered pattern appears because the languages reorder; this is correct behaviour, not a bug, and is exactly the reordering case attention was meant to handle. See Seq2seq models and Transformers and self-attention.