Preprint
Large Language Models

Why do LLMs Attend to First Token?

Federico Barbero, 'Alvaro Arroyo, Xiangming Gu, Christos Perivolaropoulos, Michael M. Bronstein, P. V. 'c, Razvan Pascanu
April 3, 2025arXiv.org113 citations

113

Citations

14

Influential Citations

arXiv.org

Venue

2025

Year

Abstract

Large Language Models (LLMs) tend to attend heavily to the first token in the sequence -- creating a so-called attention sink. Many works have studied this phenomenon in detail, proposing various ways to either leverage or alleviate it. Attention sinks have been connected to quantisation difficulties, security issues, and streaming attention. Yet, while many works have provided conditions in which they occur or not, a critical question remains shallowly answered: Why do LLMs learn such patterns and how are they being used? In this work, we argue theoretically and empirically that this mechanism provides a method for LLMs to avoid over-mixing, connecting this to existing lines of work that study mathematically how information propagates in Transformers. We conduct experiments to validate our theoretical intuitions and show how choices such as context length, depth, and data packing influence the sink behaviour. We hope that this study provides a new practical perspective on why attention sinks are useful in LLMs, leading to a better understanding of the attention patterns that form during training.

Analysis

Why This Paper Matters

Attention sinks—the tendency of LLMs to assign disproportionate attention to the first token—have been widely observed but poorly understood. Previous research has linked them to quantization difficulties, security vulnerabilities, and streaming attention, but the fundamental question of why they emerge during training remained open. This paper addresses that gap by proposing that attention sinks are a learned mechanism to prevent over-mixing of token information, thereby preserving the identity of individual tokens as they propagate through the network.

The significance of this work lies in its dual theoretical and empirical approach. By connecting attention sinks to mathematical frameworks of information propagation in Transformers, the authors provide a principled explanation that goes beyond mere observation. This is crucial for practitioners who need to design models that are both efficient and interpretable, as understanding the role of attention sinks can lead to better architectural choices and training procedures.

Technical Contributions

  • Theoretical framework: The paper formalizes the idea that attention sinks act as a 'safe' target for attention, allowing the model to avoid mixing token-specific information with global context. This is tied to existing work on how information propagates in Transformers, providing a rigorous basis for the phenomenon.
  • Empirical validation: The authors conduct experiments that systematically vary context length, depth, and data packing, demonstrating that sink behavior changes in ways consistent with their theory. For example, longer contexts or deeper networks may increase the need for sinks to prevent over-mixing.
  • Practical insights: The findings offer actionable guidance for training LLMs, such as adjusting data packing strategies or architectural depth to control sink behavior, which could improve model performance and stability.

Results

The paper reports that attention sink behavior is not arbitrary but follows predictable patterns based on training choices. Specifically, they find that increasing context length or depth amplifies the reliance on the first token, supporting the over-mixing hypothesis. Data packing also influences sink formation, with certain packing strategies reducing or enhancing the effect. While the abstract does not provide specific numerical metrics, the qualitative results strongly align with the theoretical predictions, suggesting a robust connection between sink behavior and information propagation dynamics.

Significance

This research bridges a gap between theoretical and empirical studies of Transformers, offering a unified explanation for a widely observed but poorly understood phenomenon. The implications are broad: from improving quantization methods that are sensitive to attention patterns, to designing more secure models that are less vulnerable to attacks exploiting attention sinks, and enabling more efficient streaming attention mechanisms. By demystifying attention sinks, this work empowers AI practitioners to make more informed decisions in model design and training, ultimately leading to more reliable and interpretable LLMs.