The Residual Stream: From AlexNet to DeepSeek-V4
A complete research dossier — the one idea, $\text{output} = \text{input} + F(\text{input})$, traced from computer vision in 2015 to the multi-lane residual streams of today's frontier models.
📺 The 12-part video series is on YouTube: The Residual Stream — full playlist
Timeline — when each paper landed (76 papers, 1991–2026)
- Hochreiter — vanishing gradients (thesis)
- Scaling Monosemanticity — 34M features
- Refusal is one direction
- Hyper-Connections — n lanes
- Gemma Scope
- OpenAI TopK SAEs on GPT-4
- JumpReLU SAEs
- SAEs on attention outputs
- Massive Activations
- DenseFormer
- nGPT — the hypersphere
- Value Residual (ResFormer)
- Gemma 2 — double norm
- Chameleon
- Unreasonable ineffectiveness of deeper layers
- ShortGPT
- Crosscoders
- Primer on the inner workings of LMs
- Mix-LN
- The Curse of Depth
- DeepSeek mHC — doubly stochastic
- Are Sparse Autoencoders Useful?
- Peri-LN
- OLMo 2 — reordered norm
- Frac-Connections
- Circuit Tracing / Biology of an LLM
- Kimi Linear
- MUDDFormer
- Pangu — Depth-Scaled Sandwich-Norm
TL;DR
The "residual line" is one idea — $\text{output} = \text{input} + F(\text{input})$ — that migrated from computer vision (ResNet, 2015) into every large language model, where Anthropic reframed it as the "residual stream," a purely linear communication channel that every layer reads from and writes to.
The story has a clean three-act arc:
- Solving the degradation problem so networks could go deep.
- Taming the residual stream with normalization (Post-LN → Pre-LN → DeepNorm → sandwich/double-norm).
- Discovering that the residual stream is where meaning lives — making it the preferred site for interpretability (SAEs, steering, refusal directions) — and, most recently, widening it into multiple "lanes" (Hyper-Connections, DeepSeek's mHC, Kimi's Attention Residuals).
A proposed 12-video series is included at the end, each with a one-line key idea, the exact math to animate, and the specific figures to recreate.
Area 1 · Pre-history and the degradation problem
AlexNet (Krizhevsky, Sutskever, Hinton, 2012)
- Architecture: 8 learned layers — 5 convolutional + 3 fully connected — ~60 million parameters. Input 224×224×3 (often quoted as 227). First conv: 96 filters, 11×11, stride 4.
- Result: Won ILSVRC 2012 with 15.3% top-5 error, versus 26.2% for second place — a >10-point jump.
- Key innovations: ReLU ($f(x)=\max(0,x)$); dropout ($p=0.5$) in the first two FC layers; trained on two NVIDIA GTX 580 GPUs (3 GB each) — the two-GPU split was a memory hack, not a speedup. Exact ReLU claim (for a caption): in the original paper's Figure 1, "A four-layer convolutional neural network with ReLUs (solid line) reaches a 25% training error rate on CIFAR-10 six times faster than an equivalent network with tanh neurons (dashed line)."
- Story beat: the spark of the deep-learning revolution; depth (8 layers) was the headline.
VGG (Simonyan & Zisserman, 2014)
- Philosophy: replace large filters with stacks of small 3×3 convs (two 3×3s = one 5×5 receptive field, three = one 7×7, with fewer params and more nonlinearity).
- VGG-16: 13 conv + 3 FC = 16 weight layers, ~138 million parameters, ~92.7% top-5 accuracy on ImageNet. VGG-19: 16 conv + 3 FC, ~144M params.
- Story beat: VGG showed "deeper + simpler filters = better," but stalled ~19 layers; going deeper plainly hurt. Runner-up at ILSVRC 2014 (GoogLeNet won classification).
GoogLeNet / Inception (Szegedy et al., 2014)
Introduced auxiliary classifiers — extra softmax heads mid-network — explicitly as a hack to inject gradient into early layers and combat vanishing gradients.
The degradation problem — the crux
- Definition: as plain nets get deeper, accuracy saturates then degrades — and critically, training error goes UP, so it is not overfitting; it is an optimization failure.
- ResNet Figure 1 (recreate this): on CIFAR-10, a 56-layer plain net has higher training and test error than a 20-layer plain net. This is the money shot of the whole series.
- The thought experiment: a deeper net should match a shallower one by setting extra layers to identity mappings — yet SGD can't find that solution in plain nets. That gap motivates residual learning.
Vanishing / exploding gradients — the deeper cause
- Hochreiter 1991 (diploma thesis) and Bengio, Simard, Frasconi 1994 ("Learning long-term dependencies with gradient descent is difficult") formalized how gradients shrink/explode exponentially through many layers.
- Glorot & Bengio 2010 (Xavier init) and He et al. 2015 (Kaiming/He init, for ReLU) rescaled initialization so activations/gradients keep variance ~constant across layers.
- Batch Normalization (Ioffe & Szegedy, 2015): normalizes layer inputs; let nets of "tens of layers" start converging. What BN did NOT solve: the degradation problem persisted even with BN — deeper plain+BN nets still trained worse. That's the gap ResNet fills.
LSTM's constant error carousel (Hochreiter & Schmidhuber, 1997) — the true ancestor
The LSTM cell state $c_t = c_{t-1} + (\text{input})$ has an additive, gradient-preserving path — the "constant error carousel," the conceptual grandparent of the residual connection: an uninterrupted additive highway for gradients.
Highway Networks (Srivastava, Greff, Schmidhuber, 2015; arXiv:1505.00387)
- Gating equation: $y = H(x)\cdot T(x) + x \cdot C(x)$, with transform gate $T$ and carry gate $C$, usually $C = 1 - T$, $T(x)=\sigma(W_T x + b_T)$. Explicitly inspired by LSTM gates.
- Trained nets with hundreds of layers via plain SGD — before ResNet.
- ResNet as a special case: set $T=C=\text{identity}$ (gates fixed open) → $y = H(x) + x$. ResNet won because the ungated identity path is simpler, has no gate parameters to learn, and never attenuates the gradient.
- Story beat / open debate: Schmidhuber has publicly argued for Highway Networks' (and LSTM's) priority over ResNet — a genuine credit dispute worth a dramatic beat.
Area 2 · ResNet itself
Deep Residual Learning (He, Zhang, Ren, Sun, 2015; arXiv:1512.03385)
- Core formulation: $y = F(x, \{W_i\}) + x$. The block learns the residual $F(x) = H(x) - x$; if identity is optimal, drive $F \to 0$.
- Blocks: Basic block = two 3×3 convs (ResNet-18/34). Bottleneck block = 1×1 → 3×3 → 1×1 (ResNet-50/101/152), the 1×1s reduce then restore dimensions.
- Depths: ResNet-18, 34, 50, 101, 152. ResNet-50 ≈ 25.5M params.
- Results: 3.57% top-5 error on ImageNet (ensemble) — won ILSVRC 2015, and also swept detection/localization (ImageNet + COCO 2015).
- The 1202-layer experiment (CIFAR-10): they successfully optimized a 1202-layer ResNet (it trained fine, though it slightly overfit vs the 110-layer net). The shock: >1000 layers trains at all. Story beat.
Identity Mappings in Deep Residual Networks (He et al., 2016; arXiv:1603.05027) — the critical math
- Pre-activation ResNet: move BN and ReLU before the conv (BN→ReLU→conv), making the skip path a clean identity.
- Forward recursion: with identity skip $x_{l+1} = x_l + F(x_l, W_l)$, unrolling gives:
$$x_L = x_l + \sum_{i=l}^{L-1} F(x_i, W_i)$$
→ Any deep feature = a shallow feature plus a sum of residuals (contrast plain nets, which are products of matrices).
- Backward gradient (THE equation to animate):
$$\frac{\partial \varepsilon}{\partial x_l} = \frac{\partial \varepsilon}{\partial x_L} \cdot \left(1 + \frac{\partial}{\partial x_l}\sum_{i=l}^{L-1} F\right)$$
The "+1" term guarantees gradient flows directly to any earlier layer and cannot vanish (the sum term would have to be exactly $-1$ across an entire mini-batch to cancel it, which essentially never happens).
- Empirical payoff: pre-activation ResNet-1001 reached lower error than the original on CIFAR-10/100.
- Design lessons: BN-after-addition hurts; ReLU-before-addition forces the residual $\geq 0$ (should be free to live in $(-\infty,\infty)$) and worsens results (7.84% on CIFAR-10).
Interpretations of why residuals help
- Unraveled / ensemble view (Veit, Wilber, Belongie, 2016; arXiv:1605.06431): a ResNet = an implicit collection of $2^n$ paths of varying length. Lesion studies (delete/reorder layers at test time) show only a smooth, modest performance drop — ensemble-like; paths don't strongly depend on each other. Most gradient in a 110-layer ResNet comes from paths only 10–34 layers deep. So ResNets "avoid vanishing gradients by introducing short paths," rather than truly training the full depth. Figure to recreate: the binomial path-length distribution + the "effective path" gradient histogram.
- Shattered Gradients (Balduzzi et al., 2017): in plain deep nets gradients become like white noise ("shatter"); residuals keep gradients spatially correlated (brown-noise-like), which is why they stay trainable.
- Iterative refinement / unrolled estimation (Greff, Srivastava, Schmidhuber, ICLR 2017; Jastrzębski et al., 2018): residual layers don't compute fresh representations — they iteratively refine a running estimate held in the stream. This directly foreshadows the "residual stream" and logit-lens views.
- Neural ODEs (Chen, Rubanova, Bettencourt, Duvenaud, NeurIPS 2018): a residual block $x_{t+1} = x_t + h \cdot f(x_t)$ is exactly one Euler step of an ODE $dx/dt = f(x)$. Let the layer step $h \to 0$ and depth becomes continuous "time." Figure: discrete residual steps morphing into a smooth ODE trajectory.
Initialization / normalization theory: why residuals + BN really work at init
- Mean-Field Residual Networks (Yang & Schoenholz, 2017): residual nets have far better signal-propagation depth scales than plain nets.
- Fixup (Zhang, Dauphin, Ma, 2019; arXiv:1901.09321): you can train 10,000-layer residual nets with no normalization by rescaling the initialization of residual branches — proof that the key was the residual branch scale, not BN per se.
- SkipInit / "Batch Normalization Biases Residual Blocks Towards the Identity Function" (De & Smith, 2020; arXiv:2002.10444): shows BN's real trick — at init, BN downscales the residual branch relative to the skip by ~$1/\sqrt{\text{depth}}$, so blocks start near identity. Replacing BN with a single scalar $\alpha=0$ on the residual branch (SkipInit) reproduces the benefit and trains 1000-layer ResNets without norm. The load-bearing insight linking BN → residual scaling.
- NF-Nets (Brock et al., 2021; arXiv:2102.06171): normalizer-free nets + Adaptive Gradient Clipping match/beat EfficientNet; NFNet-F5 reaches ~86.0% ImageNet top-1. Normalization is not sacred.
- ReZero (Bachlechner et al., 2020; arXiv:2003.04887): gate every residual branch with a zero-initialized scalar: $x_{i+1} = x_i + \alpha_i \cdot F(x_i)$, $\alpha_i=0$ at init. Trains 120-layer Transformers and even 10,000-layer fully-connected nets; ~56% faster convergence on a 12-layer Transformer (enwiki8).
Variants worth a mention
- Stochastic Depth (Huang et al., 2016): randomly drop residual blocks during training (identity passes through) — a regularizer that also confirms the ensemble/short-path view.
- DenseNet (Huang et al., 2017): concatenation instead of addition — every layer sees all previous feature maps. Contrast with ResNet's additive stream; a great "add vs concatenate" beat.
- Wide ResNets (Zagoruyko & Komodakis, 2016): width beats depth for a given budget; a 16-layer wide net rivals a 1000-layer thin one.
Area 3 · Residuals in Transformers
The original Transformer (Vaswani et al., 2017) — Post-LN
Each sublayer: $\text{output} = \text{LayerNorm}(x + \text{Sublayer}(x))$ — the residual add happens inside the norm ("Post-LN"). Notoriously needs learning-rate warmup to train.
On Layer Normalization in the Transformer Architecture (Xiong et al., 2020; arXiv:2002.04745) — pivotal analysis
- Pre-LN: $x + \text{Sublayer}(\text{LayerNorm}(x))$ — norm goes inside the residual branch, leaving the skip path clean.
- Theorem (mean-field): at init, Post-LN has large gradients near the output layer (the final-layer gradient norm stays ~1.6 regardless of depth), so a big LR is unstable → warmup needed. Pre-LN gradients are well-behaved at init and decrease with depth, so warmup can be removed.
- Figures to recreate: gradient norm vs layer index for Post-LN (spikes at output) vs Pre-LN (flat); loss-vs-time showing Pre-LN converges faster.
- Consequence: essentially all modern LLMs (GPT-2 onward) use Pre-LN.
The Pre-LN side effect and the fixes
- NormFormer (Shleifer et al., 2021; arXiv:2110.09456): Pre-LN has the opposite gradient imbalance — early-layer gradients larger than late-layer. Adds 3 extra norms per layer to rebalance.
- ADMIN / "Understanding the Difficulty of Training Transformers" (Liu et al., 2020): Post-LN instability traced to heavy dependency on residual branches; ADMIN init controls it.
- DeepNet / DeepNorm (Wang et al., 2022; arXiv:2203.00555): $x_{l+1} = \text{LayerNorm}(\alpha \cdot x_l + G_l(x_l))$ with residual-branch weights scaled by $\beta$. For an $N$-layer encoder, $\alpha=(2N)^{1/4}$ (encoder-decoder uses the $0.81(N^4M)^{1/16}$ etc. constants). Combines Post-LN performance with Pre-LN stability. Scaled Transformers to 1000 layers (2500 sublayers). A 200-layer, 3.2B model beat a 48-layer, 12B SOTA by 5 BLEU on a 7,482-direction multilingual benchmark. Figure: update magnitude $\|\Delta F\|$ stable for DeepNet vs exploding for vanilla Post-LN.
The residual-stream GROWTH problem (Pre-LN)
In Pre-LN models the residual-stream variance grows with depth (roughly exponentially/sub-exponentially), because each layer keeps adding to the stream. As the stream norm balloons, each new layer's contribution becomes relatively smaller, and LayerNorm's $1/\|x\|$ scaling shrinks gradients through later layers.
- The Curse of Depth (Sun, Song, Li, Yin, Zheng, Liu, 2025; arXiv:2502.05795, NeurIPS 2025): confirmed across Llama, Mistral, DeepSeek, Qwen that nearly half the layers are less effective than expected. Cause: Pre-LN output variance explodes with depth, making deep blocks' Jacobians approach the identity matrix → they barely contribute. Fix — LayerNorm Scaling (LNS): scale each layer's LN output by $1/\sqrt{l}$ ($l$ = depth index). Hyperparameter-free; improves pretraining across 130M–7B. Figure to recreate: Jacobian heatmaps of LLaMA2-7B pre-LN blocks becoming diagonal (identity) with depth.
- Peri-LN (arXiv:2502.02732): normalize both input and output of each module; explains why Gemma/OLMo-style placements work and links QK-Norm to Pre-LN.
Sandwich / double normalization
- Sandwich-LN (CogView, Ding et al., 2021): add a LayerNorm at the end of each branch too, bracketing the sublayer — introduced to stop value explosion in large training.
- GLM-130B (Zeng et al., 2022): used DeepNorm (Post-LN variant) for stability at 130B scale.
- Gemma 2 (2024; arXiv:2408.00118): applies RMSNorm in both pre-norm and post-norm positions around each sublayer (attention and FFN) — i.e.
input_layernorm,post_attention_layernorm,pre_feedforward_layernorm,post_feedforward_layernorm. This is the "double norm." Also uses logit soft-capping (50.0 attention, 30.0 final) and interleaved local/global attention. - OLMo 2 (2025; arXiv:2501.00656): reordered norm — normalize the outputs of attention and FFN (a post-norm-like placement inside the residual path) rather than inputs, plus QK-Norm. In isolation neither helps, but together they tame the L2 gradient-norm growth and spikiness. Uses RMSNorm and z-loss ($10^{-5}$) to regularize final logits.
- Chameleon (2024): QK-Norm + norm reordering + z-loss specifically for stability of a mixed-modal model.
- Pangu (DSSN, 2025): "Depth-Scaled Sandwich-Norm" — extra RMSNorm after attention and FFN; reports "zero loss spikes" in pretraining.
QK-Norm and attention entropy collapse
"Stabilizing Transformer Training by Preventing Attention Entropy Collapse" (Zhai et al., Apple, 2023): attention logits can grow so large that softmax becomes one-hot ("entropy collapse"), destabilizing training. QK-Norm (RMSNorm on queries and keys before the dot product; Dehghani et al. 2023) caps logit magnitude — now standard (Gemma 3, OLMo 2, many others).
nGPT — Normalized Transformer on the hypersphere (NVIDIA, Loshchilov et al., 2024; arXiv:2410.01131)
- Puts all vectors (embeddings, attention/MLP matrices, hidden state) on a unit hypersphere; matrix-vector products become cosine similarities in $[-1,1]$.
- Replaces the residual addition with SLERP/LERP: instead of $h + f(h)$, it interpolates on the sphere, $h \leftarrow \text{Norm}(h + \alpha(f(h) - h))$, with learnable "eigen learning rates" $\alpha$ per block acting as diagonal entries of a variable-metric optimizer. Normalization = a Riemannian retraction back onto the sphere.
- Result: 4–20× fewer training steps to a given loss (larger gains at longer context — e.g. ~10× at 4k). Removes weight decay and explicit LayerNorm/RMSNorm.
Multi-lane residual streams — the "single lane vs multi lane" arc
- DenseFormer (Pagliardini et al., 2024; arXiv:2402.02622): Depth-Weighted-Average — each layer can read a learned weighted average of all previous layer outputs, not just the immediate stream.
- Hyper-Connections (Zhu et al., ByteDance Seed, 2024; arXiv:2409.19606; ICLR 2025): expand the residual stream from $\mathbb{R}^d$ to $n \times d$ — $n$ parallel residual "lanes." Learnable matrices define depth-connections (how a layer's output routes into lanes) and width-connections (how lanes exchange). Key motivation: standard residuals face a seesaw between gradient vanishing (Pre-Norm) and representation collapse (Post-Norm); HC lets the net learn connection strengths and even reorder layers sequentially/parallel. Dynamic Hyper-Connections (DHC) make weights input-dependent. Near-zero extra params/compute; significant LLM and vision gains. Figure: the $n=2$ lane diagram with the $\alpha/\beta$ connection matrix.
- Frac-Connections (Zhu et al., 2025; arXiv:2503.14125): fractional (memory-cheaper) variant of HC.
- DeepSeek mHC — Manifold-Constrained Hyper-Connections (Xie et al., DeepSeek-AI, Dec 2025; arXiv:2512.24880): the "DeepSeek residual line paper." Unconstrained HC mixing matrices can have spectral norm >1 → signal amplification measured at ~3000× in a 27B model → catastrophic divergence. mHC constrains each mixing matrix to be doubly stochastic (Birkhoff polytope) via the Sinkhorn–Knopp algorithm, restoring the identity-mapping/norm-preserving property while keeping HC's expressivity. Configs built on DeepSeek-V3 at 3B/9B/27B. Adopted in DeepSeek-V4 (arXiv:2606.19348) to "strengthen conventional residual connections." Analogy for animation: a multi-lane highway with on/off ramps where total traffic must be conserved.
- MUDDFormer (Xiao et al., 2025): multiway dynamic dense connections — another cross-layer densification of the stream.
Attention-specific residuals — Value Residual & Kimi's Attention Residuals
- Value Residual Learning / ResFormer & SVFormer (Zhou, Wu, Jiang, Lan, 2024; arXiv:2410.17897; ACL 2025): add a residual on the value stream: each layer mixes its values with the first layer's values $V_1$ (scalar coefficients $\lambda_1, \lambda_2$), approximating cross-layer attention cheaply. Fixes attention concentration/sinks, value-state drains, and residual-state peaks in deep layers. ResFormer matches baseline loss with 16.11% fewer params and 20.3% less data; SVFormer shares one value across all layers, cutting KV cache ~50%. (Residualizing queries/keys was found unstable.)
- Kimi Attention Residuals — "AttnRes" (Kimi Team / Moonshot AI, 2026; arXiv:2603.15031): a "drop-in replacement for residual connections with consistent scaling gains." Each layer gets one extra RMSNorm and a pseudo-query vector $w_l$; attention-style weights $\alpha_{i \to l}$ let each layer choose which earlier layers to draw from (instead of summing all equally). Pseudo-queries must be zero-initialized so early training is an equal-weight average (prevents volatility). Built on the Kimi Linear architecture (arXiv:2510.26692 — Kimi Delta Attention + Multi-Head Latent Attention in a 3:1 ratio, Moonlight/DeepSeek-V3 lineage). Deployed in Kimi K3 (2.8T params), which credits AttnRes + KDA + sparser MoE for ~2.5× training efficiency.
Area 4 · The residual stream as memory / communication channel
A Mathematical Framework for Transformer Circuits (Elhage et al., Anthropic, 2021)
The founding reframing. Verbatim:
"The residual stream is simply the sum of the output of all the previous layers and the original embedding. We generally think of the residual stream as a communication channel, since it doesn't do any processing itself and all layers communicate through it."
- Every component reads from the stream (linear projection in) and writes to it (linear projection out); because writes are additive, any component can influence any downstream component → a fully-connected computational graph.
- Deeply linear structure: unusually, the transformer residual stream is purely linear (unlike ResNets, which have nonlinearities on/around the stream) — this is what makes decomposition into subspaces, "virtual weights," and "virtual attention heads" tractable.
- Residual-stream "bandwidth": the stream is a bottleneck of fixed dimension $d_{\text{model}}$; far more features than dimensions compete for space (→ superposition). Memory-management components read subspaces to "clear"/overwrite information.
FFNs as key-value memories (Geva et al., 2021)
Feed-forward layers act as key-value memories: the first weight matrix's rows are "keys" that detect input patterns; the second matrix's columns are "values" written into the residual stream. Later layers refine these into the output distribution.
Iterative inference / the lens family
- Logit lens (nostalgebraist, 2020): apply the final unembedding to the residual stream at every layer → you can watch the model's predicted token sharpen layer by layer. Direct evidence for iterative refinement.
- Tuned lens (Belrose et al., 2023): learn a per-layer affine probe for a more faithful readout; shows predictions converge gradually up the stack.
Superposition and privileged bases
Toy Models of Superposition (Elhage et al., Anthropic, 2022): networks store more features than dimensions by placing them in near-orthogonal directions — superposition. The residual stream has no privileged basis (rotating it and undoing the rotation is a symmetry), so features are directions, not neurons — motivating dictionary learning (SAEs).
Massive activations & attention sinks — residual-stream phenomena
- Massive Activations (Sun, Chen, Kolter, Liu, 2024; arXiv:2402.17762): a tiny number of residual-stream activations are far larger than the rest. Verbatim: "very few activations exhibit significantly larger values than others (e.g., 100,000 times larger)." In LLaMA2-7B the largest (~2,000 in magnitude) is "approximately 10,000 times larger than the median magnitude (about 0.2)," concentrated in fixed dims 1415 & 2533. Their values stay ~constant regardless of input and act as implicit bias terms, causing attention to concentrate on their tokens.
- Attention sinks / StreamingLLM (Xiao et al., 2023; arXiv:2309.17453; ICLR 2024): models dump excess attention onto the first token(s) as a "sink." Verbatim: "StreamingLLM can enable Llama-2, MPT, Falcon, and Pythia to perform stable and efficient language modeling with up to 4 million tokens… outperforms the sliding window recomputation baseline by up to 22.2× speedup," with just 4 initial sink tokens sufficing. These interact with LayerNorm and residual-stream norm growth.
Area 5 · Interpretability and SAEs
The lineage
- Cunningham et al., 2023 — "Sparse Autoencoders Find Highly Interpretable Features in Language Models": SAEs on LM activations (incl. residual stream) yield interpretable, causally-relevant features.
- Bricken et al., 2023 — "Towards Monosemanticity" (Anthropic): SAEs on a one-layer transformer's MLP activations recover monosemantic features; introduced feature splitting.
- Templeton et al., 2024 — "Scaling Monosemanticity" (Anthropic): trained SAEs with up to 33,554,432 (~34M) features on Claude 3 Sonnet's middle-layer residual stream. Verbatim: "For all three SAEs, the average number of features active … on a given token was fewer than 300, and the SAE reconstruction explained at least 65% of the variance." Found multilingual/multimodal and safety-relevant features (deception, sycophancy, bias, dangerous code) that causally steer behavior.
- Gemma Scope (Lieberum et al., DeepMind, 2024; arXiv:2408.05147): an open suite of JumpReLU SAEs on residual stream, MLP output, and attention output at every layer/sublayer of Gemma 2 2B/9B (+ select 27B). >400 SAEs, >30 million features total, trained on 4–16B tokens each; used >20% of GPT-3's training compute; ~20 PiB of activations saved. (JumpReLU from Rajamanoharan et al. 2024, arXiv:2407.14435.)
- OpenAI — "Scaling and evaluating sparse autoencoders" (Gao et al., 2024; arXiv:2406.04093): TopK ($k$-sparse) autoencoders; trained a 16-million-latent SAE on GPT-4 activations for 40B tokens; clean reconstruction scaling laws. GPT-2 experiments on the post-MLP residual stream at layer 8.
Why the residual stream is the preferred SAE site
- It's the bottleneck / communication channel (Elhage 2021): all information passes through it, so it captures features used by many downstream components at once.
- It accumulates features: as Ferrando et al.'s "Primer on the Inner Workings of Transformer-based LMs" (arXiv:2405.00208) puts it, "residual stream states gather information about the sum of previous components' outputs," so SAE features there illuminate how information is added/transformed across the forward pass.
- It's smaller/cheaper than the components: the residual stream ($d_{\text{model}}$) is much smaller than the MLP hidden layer, so training an SAE on it is cheaper (explicitly noted for Scaling Monosemanticity's middle-layer choice). The middle layer also sits at a "reasonable level of abstraction."
- Comparison to attention outputs (Kissane, Krzyzanowski, Bloom, Conmy, Nanda, 2024; arXiv:2406.17759): most prior modern-model SAE work targeted the residual stream at a single layer; Kissane et al. showed SAEs also work on attention layer outputs ($z_{\text{cat}}$), finding long-range-context, short-range-context, and induction feature families, and estimating ≥90% of GPT-2-Small heads are polysemantic (why per-head interpretation is hard, and why the aggregated stream is easier). The induction feature family is unique to attention outputs and needs ~50k+ SAE width to capture.
- Arguments against residual-stream SAEs: feature absorption and feature splitting (Chanin et al. 2024; Bricken 2023), and cross-layer superposition where a feature is smeared across layers — motivating crosscoders/transcoders.
Beyond per-layer SAEs (2024–2025)
- Crosscoders (Lindsey, Templeton, Marcus, Conerly, Batson, Olah; Anthropic, Oct 2024): an SAE variant that reads and writes across multiple layers at once, resolving cross-layer superposition and tracking persistent residual-stream features. (Framed by Anthropic as a "research update," i.e. preliminary.)
- Circuit Tracing + "On the Biology of a Large Language Model" (Anthropic, 2025): use cross-layer transcoders (CLTs) to build a "replacement model" and attribution graphs (attention frozen), applied to Claude 3.5 Haiku to trace multi-step reasoning, planning, and arithmetic. Verbatim: "we simply use the attention patterns of the original model and treat them as fixed components."
Residual-stream interventions (steering)
- ActAdd / "Steering GPT-2-XL by adding an activation vector" (Turner et al., 2023; arXiv:2308.10248): compute a steering vector as the activation difference between a pair of prompts and add it to the residual stream at inference — no fine-tuning.
- Representation Engineering (Zou et al., 2023; arXiv:2310.01405): top-down reading/controlling of population-level representations for honesty, harmlessness, power-seeking.
- "Refusal in LLMs is mediated by a single direction" (Arditi et al., 2024; arXiv:2406.11717; NeurIPS 2024): refusal is a one-dimensional subspace in the residual stream. Verbatim: refusal is mediated by this subspace "across 13 popular open-source chat models up to 72B parameters… erasing this direction from the model's residual stream activations prevents it from refusing harmful instructions, while adding this direction elicits refusal on even harmless instructions." The cleanest "one direction = one behavior" demo.
- Linear Representation Hypothesis (Park, Choe, Veitch, 2023; arXiv:2311.03658): high-level concepts are directions in representation space; formalizes a "causal inner product." Grounds all of the above.
Has the field cooled on SAEs? (2025 critique — real debate)
"Are Sparse Autoencoders Useful? A Case Study in Sparse Probing" (Kantamneni, Engels, Rajamanoharan, Tegmark, Nanda, 2025; arXiv:2502.16681; ICML 2025): across data scarcity, class imbalance, label noise, and covariate shift, SAE probes fail to consistently beat simple baselines (logistic regression, prompting). Plus the "dark matter" problem (Engels et al.) — a linearly-predictable chunk of SAE error is unexplained. This has shifted 2025 attention toward transcoders, crosscoders, and attribution graphs.
Honest caveat to state on-camera: SAEs are a powerful lens, not a solved solution.
Area 6 · Vanishing gradients "still" — now due to norm
- The reframed problem: ResNets/Transformers solved vanishing gradients via the additive skip — but normalization re-introduces a depth-dependent gradient issue. LayerNorm scales gradients by ~$1/\|x\|$; as the Pre-LN residual stream's norm grows with depth, gradients through later layers shrink and those layers drift toward identity.
- Direct evidence: The Curse of Depth (arXiv:2502.05795) shows deep Pre-LN Jacobians → identity; Hyper-Connections frames the whole thing as a seesaw between vanishing gradients (Pre-Norm) and representation collapse (Post-Norm).
- Deep layers are prunable: "The Unreasonable Ineffectiveness of the Deeper Layers" (Gromov et al., 2024) and ShortGPT (Men et al., 2024) show you can delete a large fraction of the deepest layers of Llama-style models with little loss — empirical proof that the residual-stream growth problem wastes depth.
- Fixes recap: DeepNorm ($\alpha,\beta$ scaling), LayerNorm Scaling ($1/\sqrt{l}$), sandwich/double norm (Gemma 2), reordered norm + QK-Norm (OLMo 2), Peri-LN, Mix-LN (arXiv:2412.13795, combine Pre-LN + Post-LN so both shallow and deep layers stay effective).
- Why warmup, loss spikes: Post-LN's large output-layer gradients at init (Xiong 2020) demand warmup; QK-Norm / z-loss / logit-capping suppress the logit-explosion loss spikes seen in large runs (OLMo 2, Chameleon, PaLM).
Area 7 · Practical "how to better use the residual stream"
- Residual output scaling at init: GPT-2 scales residual-branch projection weights by $1/\sqrt{2N}$ ($N$ = number of layers) so the accumulated stream variance stays controlled — a standard, cheap trick.
- LayerScale (Touvron et al., CaiT, 2021): multiply each residual branch by a learned per-channel diagonal, initialized to a tiny value (e.g. 1e-4/1e-5), so deep vision transformers start near-identity and train stably. Cousin of ReZero/SkipInit.
- ReZero / SkipInit / Fixup: all say the same thing — start residual branches near zero so the network is initially an identity function, then let it grow.
- Read/write to the stream: the unembedding reads the final residual stream; weight tying between embedding and unembedding is common; the logit/tuned lens exploit that the stream is always in "output coordinates."
- Optimizer interactions (2025): work like "Does Your Optimizer Care How You Normalize?" shows normalization choice and optimizer (e.g. Muon vs AdamW) interact — one normalizer's gap to RMSNorm grew from +0.31 nats (AdamW) to +0.97 (Muon). Normalization/residual-scaling and optimizer must be co-designed.
- Newest architectural directions: widen the stream (Hyper-Connections, mHC), route it (AttnRes, DenseFormer/MUDDFormer), or reparametrize it entirely (nGPT on the hypersphere). The trend line: the residual stream is no longer a passive pipe — it's becoming a learned, structured, multi-lane memory system.
The 12-part video series
12 episodes, 5–7 minutes each. 📺 Watch the full playlist
- "The Wall at 20 Layers" — Key idea: depth should help but plain nets degrade (training error rises → not overfitting). Recreate ResNet Fig. 1 (20 vs 56-layer CIFAR-10). Math: why stacking matrix products vanishes gradients.
- "The Highway Before the Highway" — Key idea: LSTM's constant error carousel and Highway Networks' gated skip $y=H\cdot T+x\cdot C$ set up the additive path; ResNet drops the gates. Include the Schmidhuber priority debate.
- "y = F(x) + x" — Key idea: ResNet's one equation and the ILSVRC 2015 sweep (3.57% top-5); basic vs bottleneck blocks; the 1202-layer shock.
- "The +1 That Saved Deep Learning" — Key idea: Identity Mappings paper — derive $x_L = x_l + \sum F$ and the backward $(1 + \sum \partial F)$ term. Pre-activation. The math centerpiece.
- "What Is a ResNet Really Doing?" — Key idea: ensembles of shallow paths (Veit), iterative refinement (Greff), and residual block = Euler step of an ODE (Neural ODEs). Three views, one animation morphing between them.
- "Post, Pre, Deep: Normalizing the Stream" — Key idea: Transformer Post-LN needs warmup; Pre-LN fixes gradients (Xiong 2020); DeepNorm scales to 1000 layers. Animate gradient-norm-vs-layer curves.
- "The Residual Stream Is a Communication Channel" — Key idea: Anthropic's reframing — linear stream, read/write subspaces, virtual heads, bandwidth/superposition. The pivot from vision to interpretability.
- "Memory in the Stream" — Key idea: FFNs as key-value memories, logit/tuned lens iterative sharpening, massive activations & attention sinks as bias terms living in the stream.
- "Reading the Mind: SAEs on the Residual Stream" — Key idea: why the stream (not attention heads) is the SAE site; Scaling Monosemanticity (34M features, Claude 3 Sonnet mid-layer, <300 active/token); Gemma Scope; OpenAI TopK on GPT-4.
- "Steering by Vector" — Key idea: one direction = one behavior — refusal direction (Arditi), ActAdd, RepE, linear representation hypothesis. Plus the 2025 SAE-usefulness critique (honest debate).
- "Vanishing Gradients, Round Two" — Key idea: the Curse of Depth — Pre-LN variance growth makes deep layers identity/prunable (Gromov, ShortGPT); fixes: LayerNorm Scaling, sandwich/double norm (Gemma 2), reordered norm + QK-Norm (OLMo 2).
- "One Lane to Many: The Future of the Residual Line" — Key idea: Value Residual, Kimi's AttnRes, Hyper-Connections' $n$-lane stream and the seesaw, DeepSeek's mHC (3000× blow-up → Sinkhorn doubly-stochastic fix → V4), and nGPT's hypersphere. The residual stream becomes a structured, multi-lane memory.
(If you prefer 14 videos, split #4 into "Forward view" + "Backward view," and split #12 into "Widening the stream" (HC/mHC) + "Rethinking the stream" (nGPT/AttnRes).)
Recommendations — production plan & staged next steps
- Lead with the drama, teach the math second. Open Episode 1 on the ResNet Fig. 1 paradox (deeper = worse training error). The single most re-watchable asset in the series is an animation of the $(1 + \sum \partial F)$ "+1" term in Episode 4 — budget your best animator there.
- Use one persistent visual metaphor across all 12 videos: a vertical "stream/river" of vectors that layers write into (arrows adding) and read from (arrows tapping). Every later concept (norm placement, SAEs, steering, multi-lane) is a modification of this same visual. This is what turns 12 videos into a series rather than 12 explainers.
- Verify-before-animate for the 2026-dated papers. The Kimi AttnRes (arXiv:2603.15031), DeepSeek-V4 (arXiv:2606.19348), and mHC (arXiv:2512.24880) numbers are technical-report-grade. Before scripting Episode 12's headline stats (2.8T params, ~2.5× efficiency, ~3000× signal blow-up), pull the primary PDFs and quote figures/tables directly on screen; present them as "reported by the labs," not peer-reviewed.
- Pin exact equations from primary PDFs for the math-heavy episodes (4, 6, 12). For Episode 6, fetch the DeepNorm pseudocode (Fig. 2 of arXiv:2203.00555) for the exact $\alpha/\beta$ per architecture. For Episode 12, fetch the Hyper-Connections matrix figure (Fig. 2 of 2409.19606) and the mHC Sinkhorn description.
- Recreate these specific figures (highest pedagogical value): ResNet Fig. 1 (degradation); Identity-Mappings gradient equation; Veit path-length binomial + effective-path histogram; Xiong gradient-norm-vs-layer (Post vs Pre); Curse-of-Depth Jacobian heatmaps; Hyper-Connections $n=2$ lane diagram; the refusal-direction ablation demo.
- Benchmarks/thresholds that would change the plan: if the Kimi/DeepSeek 2026 reports turn out to be paywalled or retracted, fall back to Hyper-Connections (ICLR 2025, fully public) as Episode 12's anchor and treat mHC/AttnRes as "emerging." If the series runs long, the two most compressible episodes are 5 (interpretation theories) and 8 (memory) — they can merge.
- Fact-check the one soft spot: the "LayerNorm scales gradients by $1/\|x\|$ → later-layer gradients shrink" chain (Area 6) is well-supported qualitatively (Curse of Depth, HC seesaw) but state it as mechanism as described by these papers, not as an independently derived theorem, unless you pull the explicit derivation from arXiv:2502.05795 §2.
Caveats & open debates to flag on-camera
- Credit for the idea: Schmidhuber (Highway/LSTM) vs He et al. (ResNet) — a genuine, ongoing priority dispute.
- Why residuals work: better optimization landscape vs ensemble-of-short-paths vs iterative refinement vs BN-downscaling-at-init — these are complementary, not mutually exclusive, but the field hasn't fully unified them.
- Do deep layers matter? The Curse of Depth / layer-pruning results vs the fact that scaling depth still helps with the right normalization — the resolution is "depth helps if you control variance."
- Are SAEs useful? 2024 enthusiasm vs the 2025 sparse-probing critique; field pivoting to transcoders/crosscoders/attribution graphs. Don't oversell SAEs.
- Norm placement has no single winner: Pre-LN (most LLMs), sandwich/double (Gemma 2), reordered (OLMo 2), Peri-LN, DeepNorm all coexist; the choice is empirical and scale-dependent.
- Dating note: several 2026-dated arXiv IDs (Kimi AttnRes 2603.15031, DeepSeek-V4 2606.19348, mHC 2512.24880) appear in current search results; treat their exact numbers as preliminary/technical-report-grade rather than peer-reviewed, and re-verify before publication.
- Secondary sources: a few figure/number details (VGG-19 param count, some Gemma 2 config specifics) came from high-quality secondary explainers corroborated across multiple sources; the primary PDFs should be cited on screen where you display exact figures.
Cite this post
Auto-generated. Verify for your institution's requirements.