Why do LLMs attend to the first token?

要約

大規模言語モデル(LLM)は、シーケンスの最初のトークンに集中する傾向があり、いわゆるアテンション・シンク(attention sink)が発生する。多くの研究がこの現象を詳細に研究しており、この現象を利用したり緩和したりする様々な方法を提案している。アテンション・シンクは、数量化の困難さ、セキュリティの問題、ストリーミング・アテンションなどと関連している。しかし、多くの研究がアテンション・シンクが発生する条件や発生しない条件を提示している一方で、重要な疑問にはまだ浅い答えしか得られていない:なぜLLMはそのようなパターンを学習し、どのように利用されているのだろうか?本研究では、このメカニズムがLLMにオーバーミキシングを回避する方法を提供することを理論的・実証的に論証し、トランスフォーマーにおける情報伝播の仕組みを数学的に研究する既存の研究につなげる。我々は理論的直観を検証するために実験を行い、コンテキストの長さ、深さ、データのパッキングなどの選択がどのようにシンクの振る舞いに影響するかを示す。この研究が、なぜLLMにおいてアテンションシンクが有用なのかについて新たな実用的視点を提供し、訓練中に形成されるアテンションパターンについてのより良い理解につながることを期待している。

要約(オリジナル)

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.

arxiv情報

著者 Federico Barbero,Álvaro Arroyo,Xiangming Gu,Christos Perivolaropoulos,Michael Bronstein,Petar Veličković,Razvan Pascanu
発行日 2025-04-04 07:41:19+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.CL パーマリンク