NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Attention Sinks Induce Gradient Sinks: Massive Activations as Gradient Regulators in Transformers

Yihong Chen, Zhouchen Lin, Quanming YaoNeurIPS 2026

TL;DR

Why do large language models spontaneously generate absurdly huge numbers—sometimes thousands of times larger than normal—on the very first word of a prompt? This paper flips the usual forward-pass story on its head: those "massive activations" aren't numerical glitches, they are shock absorbers. During training, they protect the network from a tidal wave of backward-flowing gradients caused by attention sinks.

What Problem Does This Paper Address?

If you peek inside modern Transformers like Llama or Qwen, you’ll regularly spot two weird roommates living at the very first token (Token 0):

  1. Attention Sinks (AS): Later tokens dump disproportionate amounts of attention onto Token 0—often just as a "no-op" trash can because the softmax function forces attention weights to sum to 1.
  2. Massive Activations (MA): Hidden states on Token 0 explode to extreme magnitudes, creating headaches for model quantization and long-context inference.

Historically, researchers tried to explain this link by looking solely at the forward pass. Here’s the puzzle: modern "pre-norm" Transformers normalize their hidden states (via RMSNorm) before feeding them into attention or MLP blocks. Normalization strips away raw magnitude, meaning a massive norm plays almost no direct local role moving forward! So why do Transformers stubbornly learn to create them during training?

Methods

Instead of watching data flow forward, the authors follow the calculus backward during backpropagation.

First, they combine mathematical proofs with empirical diagnostics across open-source LLMs (like Llama-3.1-8B and Qwen3-8B) and custom Llama-style models trained from scratch (0.1B to 1B parameters). They track how gradients concentrate on Token 0 and reshape as they pass backward through RMSNorm.

Figure 1: Pre-norm Transformer architecture, gradient measurements, and V-scale placement. (a) Forward computation through the attention and MLP sublayers. (b) Backward flow and gradient measurements for the attention sublayer. Detailed definitions are given in Section 3.2. (c) Expanded attention computation. Value paths 1 and 2 are alternatives for the baseline model and the V-scale variant proposed in Section 5, respectively.

Second, to prove causality rather than mere correlation, they design V-scale—a lightweight "gradient valve" inserted into the attention value ($V$) pathway. Because sink tokens naturally have tiny value vectors, V-scale applies a simple radial scaling function, $\phi(\|v\|_2^2) = \frac{\|v\|_2^2}{\|v\|_2^2 + C}$, with one learnable scalar per head. This selectively dampens gradients flowing backward through small-norm sink tokens while leaving normal tokens untouched. Cleverly, they also build a backward-only control using a stop-gradient (detach) trick: the forward pass stays 100% identical to a standard Transformer, isolating the pure effect of modifying backward gradients.

Datasets

  • Pretraining: Scratch-trained baseline and V-scale models (0.1B, 0.3B, and 1B) are trained on the C4 dataset.
  • Evaluation: Standard capabilities are tested via the LM Evaluation Harness (WikiText, Lambada, ARC-C, BoolQ, COPA, HellaSwag, OBQA, PIQA, WinoGrande). Long-context memory is probed using multi-key and single-needle Needle-in-a-Haystack (NIAH) tasks. No new benchmarks are introduced.

Key Insights and Ideas

  • Attention Sinks are Two-Way Routers: Under causal masking, if hundreds of future tokens attend forward to Token 0, backpropagation routes all of their error signals backward onto Token 0. Forward attention sinks inevitably create backward Gradient Sinks, concentrating gradients 10 to 100 times higher on Token 0 than on neighboring tokens.
Gradient sinks at Token 0 across scratch-trained and open-source models
  • The Value Path Carries the Spike: Decomposing attention gradients shows a stark asymmetry. Token 0’s query gradient is literally zero (it can't attend to anything before it), while key and especially value gradients exhibit massive spikes.
Figure 3: Token-wise gradient norms of query, key, and value across training checkpoints for the 1B model trained from scratch. Statistics are averaged over layers. Key and especially value gradients exhibit a pronounced spike at token 0, while query gradients remain comparatively flat.
  • Massive Activations as Adaptive Shock Absorbers: Why doesn't this 100x gradient spike blow up the residual stream during training? Because the backward Jacobian of RMSNorm scales inversely with input norm ($\propto 1/\text{rms}(x)$). By inflating Token 0's activation norm (primarily via MLP outputs), the network shrinks RMSNorm's backward gain, compressing the bloated gradient before it hits the residual stream!
  • Decoupling Sinks from Outliers: When V-scale relieves backward gradient pressure—even in the backward-only control where forward math is unchanged—massive activations vanish while attention sinks remain intact. The model only grew massive activations because it needed a gradient regulator.

Key Results

  • Taming Gradients & Activations: In 0.3B models, V-scale drops the median Token 0 gradient-sink ratio from 40.3 down to 5.6. Across 0.3B and 1B scales, residual-stream and MLP massive activations on Token 0 plummet (e.g., 1B residual norms drop from >4000 to ~1000) while attention sinks persist.
  • Downstream Parity & Retrieval Gains: On 1B bfloat16 benchmarks, V-scale matches baseline perplexity (WikiText 22.83 vs. 22.84) and boosts reasoning on BoolQ (+4.89%) and ARC-C (+2.14%). On multi-key NIAH retrieval, V-scale beats the baseline across every context length and quantization scheme (SmoothQuant, BNB, GPTQ, AWQ), scoring 8.68 to 15.04 percentage points higher at 8192 tokens (via YaRN).
  • Quantization Resilience: Under harsh static per-tensor W8A8 activation quantization at 2048 tokens, the baseline collapses to near-zero retrieval accuracy due to extreme outliers, whereas V-scale retains strong retrieval performance.

Limitations and Future Work

The authors note their study focuses strictly on dense, Llama-like architectures; whether this exact mechanism governs Mixture-of-Experts (MoE) or multimodal Transformers remains an open question. Additionally, V-scale showed mixed results on harder single-needle NIAH tasks under certain YaRN + quantization combinations, and factors like optimizer dynamics or low-precision training formats weren't isolated. Future work aims to explore how gradient regulation interacts with low-precision training, in-context learning, and agentic memory reuse.

Summary updated

BibTeX
@inproceedings{chen2026attention,
  author = {Yihong Chen and Zhouchen Lin and Quanming Yao},
  title = {{Attention Sinks Induce Gradient Sinks: Massive Activations as Gradient Regulators in Transformers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=c49EUKrp1G},
}
Figure