After W_O projects the multi-head output back to d_model, what happens before the next sub-layer runs?
The attention block adds its W_O output back into the residual stream: x_out = x_in + W_O(concat(heads)). The skip connection keeps deep training stable.
Imagine a long whiteboard where every meeting in a building adds a few notes without erasing what was already there. Each meeting reads the current state, decides what to contribute, and writes those new notes alongside the old ones. The whiteboard never gets wiped. By the end of the day, the bottom of the board shows the original meeting and the top shows the latest, with everything in between visible. A transformer block is a meeting. The residual stream is the whiteboard. Attention writes its conclusions onto the stream by addition, never by overwrite, so signal from the first layer is still readable at the last layer.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6-8 min: residual addition formula + skip connection role + why replacement and concatenation fail + pre-norm vs post-norm + residual stream as feature bus + connection to interpretability.
Real products, models, and research that use this idea.
- Every modern frontier transformer (Llama 4 Maverick, GPT-5.5, Claude Opus 4.7, Gemini 3.1 Pro, Mistral, DeepSeek V4) uses pre-norm with residual additions inherited from the original 2017 transformer block.
- ResNet (2015) introduced the residual connection in vision and is the direct architectural ancestor.
- Anthropic's interpretability research on 'residual stream as a bus of features' depends on the additive property: features live as additive directions, not multiplicative gates.
- Mamba and other state-space models use a different mixing scheme, but even there the macro block structure preserves residual skip connections.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhat changes if you switch from post-norm to pre-norm?
QWhy is identity initialization useful for residual blocks?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Thinking attention replaces the residual stream. It does not. The output is added to the residual, that addition is what makes deep transformers trainable.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.