주의력의 슬래시 패턴 해부: 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)은 종종 특정 오프셋 Δ에 대해 Δ-번째 부대각선을 따라 어텐션 점수가 집중되는 '사선 어텐션(Slash Attention)' 패턴을 보입니다. 이러한 패턴은 토큰 간 정보 전달에 핵심적인 역할을 합니다. 그렇다면 이러한 패턴은 왜 등장할까요? 본 논문에서는 실증적 및 이론적 관점에서 이러한 사선 주도 헤드(Slash-Dominant Head, SDH)의 발생을 규명합니다. 먼저, 오픈소스 LLM을 분석하여 SDH가 모델 내재적 특성이며 분포 외 프롬프트에도 일반화됨을 확인합니다. 이러한 내재적 발생 원인을 설명하기 위해 어텐션 점수를 공동으로 결정하는 쿼리, 키, 그리고 회전 위치 임베딩(RoPE)을 분석합니다. 실증 분석 결과, SDH의 두 가지 특징적인 조건이 드러납니다: (1) 쿼리와 키가 거의 1순위(rank-one)에 가깝고, (2) RoPE가 중간 및 고주파수 성분에 의해 지배됩니다. 이러한 조건 하에서 쿼리와 키는 토큰 간 거의 동일하며, RoPE의 중간 및 고주파수 성분 간 상호작용이 SDH를 발생시킵니다. 실증적 증거를 넘어, 우리는 이러한 조건을 모델링 가정으로 형식화함으로써 이 조건들이 SDH 발생을 보장하기에 충분함을 이론적으로 보입니다. 특히, 이러한 조건 하에서 RoPE를 장착한 얕은 Transformer의 학습 동역학을 분석하고, 경사 하강법으로 학습된 모델이 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.