注意機構におけるスラッシュパターンの解明:RoPEの役割
Demystifying the Slash Pattern in Attention: The Role of RoPE
January 13, 2026
著者: Yuan Cheng, Fengzhuo Zhang, Yunlong Hou, Cunxiao Du, Chao Du, Tianyu Pang, Aixin Sun, Zhuoran Yang
cs.AI
要旨
大規模言語モデル(LLM)では、特定のオフセットΔに対するΔ番目の副対角線に注目スコアが集中する「スラッシュ型注意パターン」が頻繁に観察される。このパターンはトークン間の情報伝達において重要な役割を果たすが、その発生メカニズムは明らかになっていない。本論文では、実証的・理論的双方の観点から、こうしたスラッシュ優位性ヘッド(SDH)の発生メカニズムを解明する。まず、オープンソースLLMを分析した結果、SDHがモデルに内在する性質であり、分布外プロンプトに対しても一般化することが確認された。この内在的発生を説明するため、注目スコアを共同で決定するクエリ・キー・回転位置埋め込み(RoPE)を分析する。実証分析により、SDHには二つの特徴的条件があることが明らかになった:(1)クエリとキーがほぼランク1であること、(2)RoPEが中高周波数成分に支配されていること。これらの条件下では、トークン間でクエリとキーがほぼ同一となり、RoPEの中高周波数成分間の相互作用がSDHを生み出す。実証的知見に加え、これらの条件をモデリング仮説として形式化することで、SDH発生を保証する十分条件であることを理論的に示す。具体的には、RoPEを装備した浅層Transformerの訓練 dynamics を分析し、勾配降下法で訓練されたモデルがSDHを示すことを証明する。このSDHは分布外プロンプトに対しても一般化する。
English
Large Language Models (LLMs) often exhibit slash attention patterns, where attention scores concentrate along the Δ-th sub-diagonal for some offset Δ. These patterns play a key role in passing information across tokens. But why do they emerge? In this paper, we demystify the emergence of these Slash-Dominant Heads (SDHs) from both empirical and theoretical perspectives. First, by analyzing open-source LLMs, we find that SDHs are intrinsic to models and generalize to out-of-distribution prompts. To explain the intrinsic emergence, we analyze the queries, keys, and Rotary Position Embedding (RoPE), which jointly determine attention scores. Our empirical analysis reveals two characteristic conditions of SDHs: (1) Queries and keys are almost rank-one, and (2) RoPE is dominated by medium- and high-frequency components. Under these conditions, queries and keys are nearly identical across tokens, and interactions between medium- and high-frequency components of RoPE give rise to SDHs. Beyond empirical evidence, we theoretically show that these conditions are sufficient to ensure the emergence of SDHs by formalizing them as our modeling assumptions. Particularly, we analyze the training dynamics of a shallow Transformer equipped with RoPE under these conditions, and prove that models trained via gradient descent exhibit SDHs. The SDHs generalize to out-of-distribution prompts.