arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.22213cs.LGcs.AIcs.CL
收藏

关于二次注意力汇的存在与行为

On the Existence and Behavior of Secondary Attention Sinks

Jeffrey T. H. Wong, Cheng Zhang, Louis Mahon, Wayne Luk, Anton Isopoussu, Yiren Zhao

AI总结:

本文研究了二次注意力汇的形成机制及其对注意力机制的影响,揭示了其在中间层的出现特性及对注意力分配的影响。

摘要:

注意力汇是接收不成比例高注意力的标记,通常为开始标记(BOS)。本文识别了一类名为二次汇的注意力汇,其与先前研究中的主汇不同。虽然先前研究发现非BOS标记有时也会成为汇,但它们表现出与BOS标记相似的性质。而我们发现存在二次汇,主要出现在中间层,能持续若干层,并接收较小但显著的注意力质量。通过在11种模型家族上的实验,我们分析了二次汇的出现位置、性质、形成方式及其对注意力机制的影响。具体而言,我们表明:(1)这些汇由特定的中间层MLP模块形成;这些MLP将标记表示映射为与该层主汇方向对齐的向量。(2)这些向量的ℓ2范数决定了二次汇的得分及持续时间,从而导致对注意力机制的不同影响。(3)主汇在中间层减弱,与二次汇的出现时间重合。我们观察到在更大规模模型中,汇的位置和持续时间(统称为汇级别)更加确定且频繁。具体而言,在QwQ-32B中识别出三个汇级别,在Qwen3-14B中识别出六个级别。我们开源了发现于github.com/JeffreyWong20/Secondary-Attention-Sinks。

英文摘要:

Attention sinks are tokens, often the beginning-of-sequence (BOS) token, that receive disproportionately high attention despite limited semantic relevance. In this work, we identify a class of attention sinks, which we term secondary sinks, that differ fundamentally from the sinks studied in prior works, which we term primary sinks. While prior works have identified that tokens other than BOS can sometimes become sinks, they were found to exhibit properties analogous to the BOS token. Specifically, they emerge at the same layer, persist throughout the network and draw a large amount of attention mass. Whereas, we find the existence of secondary sinks that arise primarily in middle layers and can persist for a variable number of layers, and draw a smaller, but still significant, amount of attention mass. Through extensive experiments across 11 model families, we analyze where these secondary sinks appear, their properties, how they are formed, and their impact on the attention mechanism. Specifically, we show that: (1) these sinks are formed by specific middle-layer MLP modules; these MLPs map token representations to vectors that align with the direction of the primary sink of that layer. (2) The $\ell_2$-norm of these vectors determines the sink score of the secondary sink, and also the number of layers it lasts for, thereby leading to different impacts on the attention mechanisms accordingly. (3) The primary sink weakens in middle layers, coinciding with the emergence of secondary sinks. We observe that in larger-scale models, the location and lifetime of the sinks, together referred to as sink levels, appear in a more deterministic and frequent manner. Specifically, we identify three sink levels in QwQ-32B and six levels in Qwen3-14B. We open-sourced our findings at github.com/JeffreyWong20/Secondary-Attention-Sinks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑