arXiv:2504.02732cs.CL2025-04被引 125

解释大模型为何过度关注首词,揭示其防信息过混的深层作用

Why do LLMs attend to the first token?

  • 从信息传播角度理论解释首词注意力过强是防止信息混合的机制
  • 实验证明上下文长度、模型深度和数据打包方式影响该现象
  • 对量化、安全与流式推理有实用价值,适合关注注意力机制的研究者

大型语言模型(LLMs)往往过度关注序列首词,形成所谓的注意力“黑洞”。尽管已有大量研究探讨其成因及影响,但其背后的学习动机和实际用途仍不清晰。本文从理论上和实证上论证,该机制有助于模型避免信息过混,并与现有研究中关于Transformer中信息传播的数学分析相呼应。通过实验验证了上下文长度、模型深度及数据打包策略对注意力黑洞行为的影响。本研究为理解训练过程中形成的注意力模式提供了新视角,有助于深入认识注意力黑洞在模型设计中的实用性。

原文摘要 · Abstract (English)

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.

注意力机制LLM原理信息传播

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。