Waarom Aandachtspatronen Bestaan: Een Unificerende Analyse vanuit Temporeel Perspectief
Why Attention Patterns Exist: A Unifying Temporal Perspective Analysis
January 29, 2026
Auteurs: Qingyue Yang, Jie Wang, Xing Li, Yinqi Bai, Xialiang Tong, Huiling Zhen, Jianye Hao, Mingxuan Yuan, Bin Li
cs.AI
Samenvatting
Aandachtspatronen spelen een cruciale rol bij zowel de training als de inferentie van grote taalmodellen (LLM's). Eerdere studies hebben individuele patronen geïdentificeerd, zoals retrieval heads, sink heads en diagonale sporen, maar deze observaties blijven gefragmenteerd en missen een verenigende verklaring. Om deze kloof te overbruggen, introduceren wij Temporal Attention Pattern Predictability Analysis (TAPPA), een verenigend kader dat diverse aandachtspatronen verklaart door hun onderliggende wiskundige formuleringen te analyseren vanuit een tijdelijk continu perspectief. TAPPA verdiept niet alleen het begrip van aandachtgedrag, maar leidt ook inferentieversnellingsbenaderingen. Specifiek karakteriseert TAPPA aandachtspatronen als voorspelbare patronen met duidelijke regelmatigheden en onvoorspelbare patronen die effectief willekeurig lijken. Onze analyse onthult verder dat dit onderscheid verklaard kan worden door de graad van query-zelfsimilariteit langs de temporele dimensie. Met de focus op de voorspelbare patronen, geven we een gedetailleerde wiskundige analyse van drie representatieve gevallen via het gezamenlijke effect van queries, keys en Rotary Positional Embeddings (RoPE). We valideren TAPPA door de inzichten toe te passen op KV-cachecompressie en LLM-pruningtaken. Over deze taken heen verbetert een eenvoudige metriek geïnspireerd door TAPPA consistent de prestaties ten opzichte van baseline-methoden. De code is beschikbaar op https://github.com/MIRALab-USTC/LLM-TAPPA.
English
Attention patterns play a crucial role in both training and inference of large language models (LLMs). Prior works have identified individual patterns such as retrieval heads, sink heads, and diagonal traces, yet these observations remain fragmented and lack a unifying explanation. To bridge this gap, we introduce Temporal Attention Pattern Predictability Analysis (TAPPA), a unifying framework that explains diverse attention patterns by analyzing their underlying mathematical formulations from a temporally continuous perspective. TAPPA both deepens the understanding of attention behavior and guides inference acceleration approaches. Specifically, TAPPA characterizes attention patterns as predictable patterns with clear regularities and unpredictable patterns that appear effectively random. Our analysis further reveals that this distinction can be explained by the degree of query self-similarity along the temporal dimension. Focusing on the predictable patterns, we further provide a detailed mathematical analysis of three representative cases through the joint effect of queries, keys, and Rotary Positional Embeddings (RoPE). We validate TAPPA by applying its insights to KV cache compression and LLM pruning tasks. Across these tasks, a simple metric motivated by TAPPA consistently improves performance over baseline methods. The code is available at https://github.com/MIRALab-USTC/LLM-TAPPA.