TL;DR
This paper introduces "secondary attention sinks," a new type of token that, unlike the well-known primary BOS sink, emerges in middle layers and has a variable lifespan. These secondary sinks are formed by specific MLP modules and appear to compensate for the weakening of the primary sink, offering a more nuanced understanding of attention mechanisms in large language models.
What Problem Does This Paper Address?
Attention sinks, particularly the beginning-of-sequence (BOS) token, have been observed to attract a disproportionately high amount of attention in transformer models. This phenomenon has practical implications for tasks like LLM quantization and KV-cache optimization. While prior work identified that tokens other than BOS could act as sinks, these were largely similar to the BOS sink, appearing early and persisting throughout the network. This paper addresses the gap in understanding a different class of attention sinks – "secondary sinks" – which exhibit distinct behaviors, emerging later in the network and having a more transient presence, suggesting a more complex role in attention dynamics.
Methods
The researchers employed a multi-faceted approach to identify and characterize secondary attention sinks:
- Empirical Analysis: They analyzed attention weights across various layers and models to locate tokens with unusually high attention.
- Cosine Similarity & PCA: To understand the formation of secondary sinks, they computed the cosine similarity between the hidden states of potential secondary sinks and the BOS sink. They also used Principal Component Analysis (PCA) on MLP inputs to identify key directions influencing sink formation.
- Clustering: They used t-SNE to visualize and cluster hidden states, attention outputs, and MLP outputs, distinguishing between normal tokens and future secondary sinks.
- Token Swapping Experiments: To establish causality, they swapped activations (hidden states, attention outputs, MLP outputs) of future secondary sinks with those of average tokens at different layers to observe the impact on sink emergence.
- Sink Score Definition: They adopted a previously defined "attention sink-score" to quantify the sink strength of tokens.
Datasets
The paper does not explicitly mention specific datasets used for training the models. However, for evaluation and analysis of attention sinks, they utilized reasoning traces generated from LLMs on datasets such as:
- AIME24 (American Invitational Mathematics Examination)
- Math (Hendrycks et al., 2021)
They also mention using these datasets to trigger the phenomenon in naturally distributed inputs.
Key Insights and Ideas
- Beyond the BOS Sink: The most significant finding is the identification of "secondary sinks" that are fundamentally different from the primary BOS sink. They emerge in middle layers and have a variable, often shorter, lifespan.
- MLP-Driven Formation: Secondary sinks are not random; they are specifically formed by middle-layer MLP modules. These MLPs transform token representations to align with the direction of the primary sink in that layer.
- Norm as a Determinant: The $\ell_2$-norm of the vectors produced by these MLPs directly influences the "sink score" of the secondary sink and how long it persists.
- Complementary Role: Secondary sinks emerge as the primary BOS sink weakens in the middle layers, suggesting a compensatory mechanism to maintain attention focus.
- Scale and Determinism: In larger models, the emergence and lifespan of these sinks ("sink levels") become more predictable and frequent, with specific patterns observed in models like QwQ-32B and Qwen3-14B.
- Reasoning Capability Link: The emergence of secondary sinks appears to be more prominent after mid-training on mathematical reasoning data, suggesting a link to enhanced reasoning capabilities.
Key Results
- Existence of Secondary Sinks: The paper provides empirical evidence for secondary sinks across 11 model families, distinguishing them from primary sinks by their layer of emergence and lifetime.
- Formation Mechanism: Experiments showed that MLP modules in middle layers are crucial for transforming tokens into secondary sinks, aligning their representations with the primary sink's direction.
- Correlation with $\ell_2$-norm: The $\ell_2$-norm of MLP outputs strongly correlates with both the strength (sink-score) and duration (lifetime) of secondary sinks.
- Compensatory Behavior: Figure 4 (Left) illustrates that as the BOS sink-score decreases in middle layers, secondary sinks begin to emerge, supporting the idea of a complementary role.
- Sink Levels: Larger models exhibit more deterministic sink levels, with specific numbers of levels identified in QwQ-32B (3 levels) and Qwen3-14B (6 levels).
- Token Swapping Efficacy: Token swapping experiments demonstrated that the later the swap occurs, the more effective it is at suppressing the emergence of a future secondary sink, confirming the causal role of earlier layers.
Limitations and Future Work
- Underlying Cause of Discrepancy: The paper notes that while some models with large rotary bases exhibit secondary sinks, others do not, and the underlying cause for this discrepancy remains an open question.
- Post-Training Amplification: The paper acknowledges that post-training processes can amplify the effects of secondary sinks, but the exact mechanisms are not fully explored.
- Downstream Impact: The precise effect of secondary sinks on text generation and overall downstream performance is stated as an open question for future research.
- Future Research Directions: The authors suggest investigating the root cause of secondary sink emergence during pre-training and understanding why post-training processes amplify their effects.
Summary updated