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

大语言模型中注意力汇流的出现:可解释性视角

What Makes Position Zero Special? A Mechanistic Study of Position Zero Attention Sinks in LLMs

New York University(纽约大学);Fudan University(复旦大学);Shanghai AI Laboratory(上海人工智能实验室);NYU Shanghai(上海纽约大学)

Runyu Peng, Ruixiao Li, Mingshu Chen, Yunhua Zhou, Qipeng Guo, Xipeng Qiu, Yucheng Lu, Chen Zhao

AI总结:

本研究从可解释性角度探讨了大语言模型中注意力汇流的形成机制,发现P0汇流回路能无需语义信息在两个transformer块内诱导注意力汇流,并揭示其在训练早期的出现及集中趋势。

摘要:

大语言模型(LLMs)往往对特定token分配不成比例的注意力,这种现象通常被称为注意力汇流。尽管此类汇流通常被视为有害,但先前研究发现了一个值得注意的例外:模型对输入序列的第一个token的持续强调。这种结构性偏差可以影响广泛的应用场景,值得仔细考虑。尽管其普遍存在,但注意力汇流的出现和持续的精确机制仍理解不足。在本工作中,我们追踪了围绕输入第一个token的注意力汇流的形成。我们识别出一种简单的机制,称为P0汇流回路,使模型能够识别位置零的token,并在两个transformer块内诱导一个注意力汇流,而无需依赖任何语义信息。这种机制是位置零注意力汇流的基础。此外,通过分析从头训练的30B A3B MoE模型的训练轨迹,我们发现这种机制在训练早期出现,并在前两层中逐渐集中,这可能是一种跟踪预训练收敛状态的信号。

英文摘要:

Transformers frequently allocate disproportionate attention to specific tokens, a phenomenon known as attention sinks. Causal large language models reliably form one at position zero, though its role remains debated. We approach this question from a mechanistic perspective, tracing how the position-zero sink arises from the model's internal computation. We identify a two-block subnetwork responsible for this behavior, which we term the P0-Sink Circuit, and show it arises purely from the structural properties of causal attention, requiring no semantic content. We further validate through from-scratch pre-training experiments that two proposed parameter-free methods effectively accelerate P0 sink formation, and find that earlier sink formation benefits pre-training and improves downstream performance. Both methods outperform the Transformer baseline and achieve performance comparable to Gated Attention across comprehensive settings. Code is available now at https://github.com/Pryest/flash-linear-attention.

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

↑