As an ablation, you delete every self-attention sublayer from a trained BERT-style encoder but keep the token and position embeddings, the feed-forward (FFN) sublayers, the residual connections and the LayerNorms. Which statement about the resulting network is correct?
Show the answer and explanation
Correct answer: A, Each output now depends only on its own token and position, since the FFN and LayerNorm apply the same function to each position separately; only attention moves information across tokens.
Explanation Transformers
A Transformer block has two sublayers with distinct jobs:
| Component | Mixes across positions? | What it does |
|---|---|---|
| Self-attention | yes | each token takes a weighted average of the value vectors of all tokens in the sequence: the only cross-token step |
| Position-wise FFN | no | the same two-layer MLP applied to each token vector independently |
| LayerNorm | no | normalizes each token vector over its own d features |
| Residual connection | no | adds a sublayer's output to the same position's input |
The residual-stream view describes this neatly: every position carries a vector through the network. Attention layers read from other positions' streams and write into the current one, while FFN layers read and write only the current position's stream, transforming its features (often interpreted as key-value memories).
After deleting attention, the network is a per-token MLP: the output at position i is a function of token i's embedding plus position i's embedding, nothing else. (BERT's segment embedding, had it been kept, would just be one more per-position input.) The model can no longer represent that "not" flips the meaning of "good" in "not good", and the word "bank" gets the same vector in every sentence at a given position.
Why the distractors fail: the FFN's weight matrices act on the d-dimensional feature axis, not on the sequence axis, so it runs per position (hence "position-wise"). LayerNorm, unlike BatchNorm, normalizes over the features of one token. Residual connections add a position's own input to its own output, never to its neighbours'.
Interview tip: a crisp summary is "attention is communication between tokens, the FFN is computation within each token"; then explain how stacking blocks alternates the two.