언어 모델은 자신의 어텐션을 제어할 수 있다
Language Models Can Control Their Own Attention
September 2, 2026
저자: Namgyu Ho, Huzama Ahmad, Woosung Koh, Se-Young Yun, Tal Schuster, Cicero Nogueira dos Santos
cs.AI
초록
언어 모델은 어텐션의 대부분을 컨텍스트의 극히 일부에 집중하지만, 실제로 중요한 소수의 토큰을 찾기 위해 전체 KV 캐시를 읽는다. 사용자가 100만 토큰 대화에서 이전 세부 사항을 질문할 경우, 전역 어텐션 레이어는 답변의 각 토큰을 생성할 때마다 전체 컨텍스트를 스캔해야 한다. 주요 해결책 중 하나는 경량 프록시 점수를 통해 관련 토큰을 사전 선택하여 비용을 줄이는 방식이지만, 이러한 외재적 점수화는 여전히 단계마다 O(N) 비용이 발생한다. 우리는 "모델이 이미 어느 컨텍스트가 관련 있는지 스스로 알지 않을까?"라는 단순한 질문에서 출발한 내재적 접근법을 취한다. 이를 위해 우리는 선언적 어텐션(DA, Declarative Attention)을 도입한다. 이는 모델이 사고 사슬 내에서 어디에 어텐션을 기울여야 하는지를 선언하도록 유도하는 프로토콜로, 생성을 세 가지 모드, 즉 <global>(전체 컨텍스트), <focus>(특정 영역), <local>(최근 출력만)로 분할한다. 추론 엔진은 이러한 선언을 도구 호출처럼 파싱하여 대부분의 KV 캐시 읽기를 건너뛴다. 15개 장문 컨텍스트 과제에 대한 제로샷 평가에서, 기성 모델(Gemma-4-31B, Qwen-3.6-27B)에 적용된 DA는 디코딩 중 총 어텐션 대상 토큰을 상당히 줄였으며(52.0%, 31.1%), 정확도 하락은 경미했다(1.27pp, 2.75pp). 이러한 하락은 모델 규모가 커질수록 축소된다. DA는 희소 어텐션의 새로운 축을 열어주며, 향후 연구에서 탐구할 수 있는 학습 기반 방법에서 추가적인 잠재력을 지닌다.
English
Language models spend most of their attention on a small fraction of context, yet they read the entire KV cache to find the few tokens that matter. If the user asks about a previous detail in a 1M-token conversation, global attention layers must scan the full context to generate each token of the reply. A prominent approach mitigates this cost by pre-selecting relevant tokens via lightweight proxy scores, but this extrinsic scoring still incurs O(N) per step. We take an intrinsic approach motivated by the simple question: wouldn't the model already know which parts of the context are relevant? To this end, we introduce Declarative Attention (DA), a protocol that elicits the model to declare where it needs to attend within its chain-of-thought, partitioning generation into three modes: <global> (full context), <focus> (a specific region), and <local> (recent output only). The inference engine parses these declarations like tool calls and skips most of the KV cache read. Under zero-shot evaluation across 15 long-context tasks, DA on off-the-shelf models (Gemma-4-31B, Qwen-3.6-27B) significantly reduces total attended tokens during decoding (52.0%, 31.1%) with modest accuracy drops (1.27pp, 2.75pp) that shrink with model scale. DA unlocks a new axis of sparse attention, with further potential under training-based methods that future work can explore.