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

From Attention to Activation: Unravelling the Enigmas of Large Language Models

Prannay Kaul, Chengcheng Ma, Ismail Elezi, Jiankang Deng

TL;DR

This paper uncovers the root causes behind two pervasive anomalies in auto-regressive Transformers: the tendency for attention heads to obsess over the first token, and the emergence of massive outlier activations in hidden states. By introducing two elegant fixes—a modified softmax function (softmax-1) and a basis-rotating optimizer (OrthoAdam)—the authors eliminate these anomalies entirely. Crucially, these fixes allow large language models (LLMs) to undergo basic 4-bit quantization without the catastrophic performance degradation typically observed.

What Problem Does This Paper Address?

Modern auto-regressive Transformers exhibit two bizarre behaviors that have long puzzled researchers:

  1. First Token Dominance: Attention heads consistently allocate a massive amount of attention to the very first token in a sequence (often a meaningless placeholder like <bos>), even when it holds no semantic value.
  2. Outlier Activations: A small number of feature channels in the hidden states explode in magnitude, becoming orders of magnitude larger than all other activations.

While these anomalies don't seem to hurt standard floating-point performance, they create severe practical headaches. First-token dominance complicates attention-masking schemes needed for long-context window extensions. Meanwhile, outlier activations ruin basic model quantization (compressing models to 8-bit or 4-bit integers); because a few values are massive, the quantization scale is stretched thin, destroying the precision of all the normal-sized activations.

Prior work suggested these two problems were linked. This paper proves they are actually disjoint phenomena with completely different root causes.

Methods

The authors isolate and solve each problem with a distinct, mathematically grounded modification:

1. Softmax-1 for Attention Dominance

The authors demonstrate that first-token dominance is caused by the mathematical definition of standard softmax combined with causal masking. Because causal masking dictates that the first token is the only one visible to every subsequent query, any attention head that has "nothing to say" (i.e., no relevant tokens to attend to) is forced by softmax to dump its attention weight somewhere to ensure the probabilities sum to 1. The first token becomes the default dumping ground.

To fix this, they propose softmax-1: $$\text{softmax-1}(x_i) = \frac{\exp(x_i)}{1 + \sum_{j=1}^L \exp(x_j)}$$

By adding a constant 1 to the denominator, the attention scores are no longer strictly forced to sum to 1. This gives the attention head a "no-op" option, allowing it to effectively attend to nothing if no relevant information is present.

2. OrthoAdam for Outlier Activations

The authors discover that outlier activations are not caused by architecture choices (like LayerNorm or biases) but by adaptive optimizers like Adam. Adam tracks gradient moments coordinate-wise (in the standard parameter basis). If certain parameters receive consistently small but directional updates, Adam's coordinate-wise scaling drastically inflates them, creating massive parameter and activation outliers aligned with the coordinate axes.

To fix this, they introduce OrthoAdam. Before computing Adam's running moments, the incoming gradients are rotated into an alternative basis using a fixed, randomly sampled orthogonal matrix $Q$: $$\bar{g}_t = \text{MatMul}(Q, g_t)$$ The optimizer updates are calculated in this rotated space and then transformed back ($Q^T$) to update the model parameters. This prevents the coordinate-wise scaling from concentrating explosions in specific feature channels.

Visualizing how rotating vectors with dominant components reduces their maximum absolute value

Datasets

The authors trained and evaluated their models using the standard C4 (Colossal Clean Crawled Corpus) dataset, specifically utilizing the en training and validation splits.

Key Insights and Ideas

  • The "Forced Choice" of Softmax: Standard softmax forces a probability distribution even when a query finds absolutely nothing useful in the context. Causal masking guarantees the first token is always a valid fallback, creating artificial "attention sinks."
  • Adam's Coordinate Bias: Adam's biggest strength—its independent learning rate per parameter—is also what causes outlier activations. Because it operates strictly on the coordinate axes of the parameter space, it inadvertently drives specific channels into extreme values.
  • Separation of Concerns: Eliminating first-token dominance does not reduce activation outliers, and vice versa. They are independent artifacts of our training stack (softmax + Adam) rather than inherent properties of language modeling.

Key Results

The combination of softmax-1 and OrthoAdam successfully tames both anomalies across various GPT2 and Llama-style architectures without any penalty to baseline perplexity (PPL).

  • Anomaly Reduction: For a 1.4B parameter GPT2 model, the modifications reduced the attention proportion on the first token from 64.8% to just 3.3%. Simultaneously, the activation kurtosis (a measure of outlier heaviness) dropped from a massive 1656.5 down to 3.1 (nearly a perfect Gaussian distribution).
  • Quantization Breakthrough: Standard LLMs suffer catastrophic failure under basic 4-bit integer quantization due to these outliers. As shown in the data, a vanilla Llama3.1-8B model's perplexity degrades to over 2 million under 4-bit quantization. Models trained with softmax-1 and OrthoAdam remain completely stable, maintaining near-lossless performance.

Limitations and Future Work

While OrthoAdam eliminates activation outliers, it introduces a slight computational overhead due to the matrix multiplications with the orthogonal matrix $Q$ during the optimization step. Although this matrix is fixed and does not need to be learned, scaling this efficiently to tens of billions of parameters requires optimized hardware kernels.

Additionally, the authors noted a small, unexplained rise in kurtosis in the very final layers of smaller models (60M and 130M parameters), suggesting there are still minor dynamics during the "detokenization" phase left to be fully unraveled.

Summary updated

BibTeX
@inproceedings{kaul2025from,
  author = {Prannay Kaul and Chengcheng Ma and Ismail Elezi and Jiankang Deng},
  title = {{From Attention to Activation: Unravelling the Enigmas of Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=IjduZQK8gM},
}
Figure