TL;DR
As Transformers scale in depth, they suffer from attention concentration—an empirical failure mode where deep layers focus overwhelmingly on a handful of uninformative tokens (like the start token), degrading representation quality. The authors introduce ResFormer, which cheaply approximates cross-layer attention by adding a residual shortcut from the first layer’s values into deeper layers, and SVFormer, an extreme variant where all layers reuse the first layer’s values to cut KV cache memory by nearly 50%.
What Problem Does This Paper Address?
Stacking self-attention layers often causes models to overly attend to specific low-information tokens (e.g., "attention sinks" or delimiters), a phenomenon termed attention concentration. Unlike architectural over-smoothing (which exists even at random initialization), attention concentration emerges dynamically during training.
This issue is tightly coupled with two pathologies:
- Value-state drains: Drastic shrinkage in the magnitude ($\ell_2$-norm) of value vectors for heavily attended tokens.
- Hidden-state peaks: Massive activation spikes in hidden states.
These dynamics feed into a vicious cycle: as value states drain, attending to that token incurs minimal disruption to downstream token predictions, allowing attention to collapse even further onto it. While full cross-layer attention (letting deep layers attend to keys/values from early layers) can break this loop, it roughly doubles computational complexity.
Methods
1. ResFormer (Residual Value Transformer)
The authors show that cross-layer attention using keys and values from prior layers can be mathematically approximated without recomputing or concatenating attention matrices. Instead of attending across layers, the current layer’s attention matrix $A_n$ simply weights a sum of the current value $V_n$ and the initial layer's value $V_1$:
$$U_n = \frac{1}{2} A_n (V_n + V_1)$$
Because the first layer ($V_1$) does not exhibit value-state drains or attention concentration, injecting it acts as an anchor, breaking the mutual reinforcement loop without adding cross-layer key-value computation.
2. SVFormer (Single-Layer Value Transformer)
Pushing value-decoupling further, SVFormer eliminates value projections for all layers $n \ge 2$, forcing every layer to directly reuse the first layer’s values:
$$U_n = A_n V_1$$
Because each token's value vector is computed and cached only once (at layer 1), SVFormer slashes KV cache memory during inference by nearly 50%.
Datasets
- Pre-training: A 20B token representative subset of SlimPajama (spanning CommonCrawl, C4, GitHub, Books, ArXiv, Wikipedia, and StackExchange).
- Downstream Zero-Shot Evaluation: Six commonsense reasoning benchmarks: HellaSwag, OpenBookQA, WinoGrande, ARC-Easy, ARC-Challenge, and PIQA.
- Empirical Analysis: Pre-trained checkpoints of Llama 3.1 8B and Mistral 7B v0.2 were analyzed to verify attention concentration and token similarity across depth.
Key Insights and Ideas
- Emergent Training Phenomenon: Unlike over-smoothing (a low-pass filtering property visible even before training), attention concentration develops strictly as training proceeds. Deeper LLMs exhibit an oscillating "concentration–dispersion–concentration" profile across their depth.
- Asymmetry Between Keys and Values: Adding residual connections or sharing keys across layers catastrophically degrades training because the softmax attention distribution is highly sensitive to key perturbations. In contrast, value states behave linearly and tolerate aggressive sharing and residual mixing.
- Anchoring With the First Layer: Shortcuts to the immediately preceding layer ($n-1$) or averaging all past layers ($1 \dots n-1$) perform worse than simply referencing the first layer ($V_1$). Early layers hold the purest, undrained token representations.
Key Results
- Parameter & Data Efficiency: ResFormer matches vanilla Transformer validation loss with 10.4% fewer parameters and 13.6% less training data on 468M models.
- Baseline Comparisons: ResFormer consistently achieves lower training and validation loss than competing architectural modifications, including DenseFormer and NeuTRENO.
- Downstream Reasoning: ResFormer delivers an average ~3% zero-shot accuracy improvement over vanilla Transformers across reasoning benchmarks (e.g., 35.5% vs. 33.3% at sequence length 2,048).
- Long-Context KV Cache Compression: For 64k context windows, SVFormer outperforms existing KV-compression schemes like Cross-Layer Attention (CLA) and Grouped-Query Attention (GQA-2), while being fully composable with GQA (e.g., SVFormer + GQA-4 reduces KV cache to ~1/8 original size).
Limitations and Future Work
- Capacity Trade-Off at Shorter Contexts: At standard context lengths (e.g., 2,048), SVFormer underperforms the vanilla Transformer and requires ~12.2% more parameters to equalize validation loss.
- Sequence-Length Dependent Optimization: The authors observe that vanilla Transformers eventually surpass SVFormer late in training, though the "critical crossover point" grows exponentially with sequence length. Better optimization strategies for $V_1$ could help close this gap.
- Scale Constraints: Experiments were limited to models up to 468M parameters and 20B tokens. Validating whether these value residuals maintain advantages at 7B+ scale on multi-trillion token budgets remains for future work.
Summary updated