Describe the residual stream as a read/write surface that sublayers act on
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
The residual stream is a shared activation bus, shape (batch, seq_len, d_model), that flows through every block. Each sublayer reads a normalized snapshot of it and adds a delta back.
Picture a long roll of carbon paper that gets passed down an assembly line. Every station gets a copy of what is currently on the paper (the 'read'), works on its copy, and then stamps a small correction back onto the original paper (the 'write'). The paper itself is never erased; it just accumulates more and more refinements as it moves through the line. In a transformer, that carbon paper is the residual stream. The stations are the attention and feed-forward sublayers, and 'read a copy' is what the LayerNorm does at the start of each sublayer. Eighty stations later, the paper carries every refinement the model wanted to make.
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.
3 min: define the residual stream as a fixed-shape running tensor, decompose each sublayer into read (LN) + write (add), note that nothing is ever overwritten, and connect to why mech-interp treats it as a shared bus.
| Aspect | Convolutional net | Transformer (residual stream) |
|---|---|---|
| What flows between layers | A transformed activation (replaced each layer) | A running residual tensor (added to each block) |
| Shape between layers | Can change (channels, spatial dims) | Constant at `(batch, seq_len, d_model)` |
| What 'depth' means | Sequential transformation | Additive refinement on a shared bus |
| Information from layer 0 | Often lost or compressed | Persists structurally to the top |
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.
Saying the sublayers 'replace' the activation. They never do. Every sublayer adds a delta onto the residual stream; the original information persists by construction.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.