After W_O projects the multi-head output back to d_model, what happens before the next sub-layer runs?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.