解释大模型注意力集中在开头的原因,揭示其结构根源。
The Structural Origin of Attention Sink: Variance Discrepancy, Super Neurons, and Dimension Disparity

- 注意力集中在开头源于自注意力中的值聚合引发方差差异。
- 前几个词的表征维度被压缩,导致注意力必须锚定在开头。
- 通过调整归一化可加速训练收敛,适合研究模型机制者。
尽管注意力集中在大型语言模型中普遍存在,即初始标记过度占据注意力分数,但其结构成因仍不明确。本文提供了一个机制性解释:首先,我们追溯其根源至自注意力中固有的值聚合过程,该过程引发系统性方差差异。进一步发现,这一差异被前馈网络(FFN)层中超级神经元的激活显著放大。具体而言,通道稀疏的下投影导致首词表示的维度失衡,迫使注意力以首词为结构锚点形成注意力集中。我们通过两项受控干预验证了这一因果链:(i) 通过注意力掩码修改隔离聚合效应;(ii) 放大目标词表示的方差。两者均可在任意位置复现注意力集中现象。我们的机制理解为系统控制注意力集中提供了基础。最后,作为概念验证,我们提出头级RMSNorm,一种预训练期间稳定值聚合输出的架构改进。实验表明,恢复各位置间的统计平衡能显著加速收敛。
原文摘要 · Abstract (English)
Despite the prevalence of the attention sink phenomenon in Large Language Models (LLMs), where initial tokens disproportionately monopolize attention scores, its structural origins remain elusive. This work provides a \textit{mechanistic explanation} for this phenomenon. First, we trace its root to the value aggregation process inherent in self-attention, which induces a systematic variance discrepancy. We further demonstrate that this discrepancy is drastically amplified by the activation of super neurons within Feed-Forward Network (FFN) layers. Specifically, the channel-sparse down-projections trigger a dimension disparity of the first-token representation, necessitating the formation of attention sinks as a structural anchor. Then, we validate this causal chain through two controlled interventions: (i) isolating the aggregation effect via attention mask modifications and (ii) amplifying the variance of targeted token representations. Both interventions can replicate attention sinks at arbitrary positions. Our mechanistic understanding offers a foundation for the systematic control of sink formation. Finally, as a proof of concept, we propose \textit{head-wise RMSNorm}, an architectural modification that stabilizes value aggregation outputs during pre-training. Our experiments demonstrate that restoring statistical parity across positions significantly accelerates convergence.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。