LoGo: Token-Level Dynamic Local-Global Attention

📅 2026-08-30
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
为解决长上下文下注意力机制的计算瓶颈问题,本文提出了LoGo方法,通过动态调整局部和全局注意力范围来优化资源分配。
📝 Abstract
As context lengths scale, attention increasingly becomes a primary computational bottleneck in large language models. Standard Transformers remain powerful but computationally inefficient, as they allocate the same attention budget to every token regardless of its contextual demand. Existing local-global hybrids provide a more efficient alternative by mixing restricted- and full-context attention, but they typically allocate span statically across layers or heads. To address these limitations, we propose LoGo, a token-level dynamic local-global attention mechanism that uses attention span as a direct proxy for attention budget allocation. Each LoGo layer contains coupled local and global branches: all tokens receive efficient local attention over a restricted context window, while a learned gate activates global attention with full-context access only for tokens requiring long-range information. A threshold-based budget controller maintains a target global ratio without auxiliary losses, and a progressive masking schedule stabilizes training before sparse routing takes effect. We further implement query-sparse Triton kernels that convert reduced global-attention computation into practical speedups. Extensive experiments validate LoGo's effectiveness, showing that it preserves the scaling behavior of full-attention Transformers across model sizes. In controlled comparisons, LoGo improves over the full-attention Transformer and matched-budget static local-global hybrids, with clear gains on long-range retrieval. Analysis further shows that LoGo learns interpretable span allocation patterns. These results suggest that learned token-level span allocation is an effective and scalable way to improve the long-context performance-compute trade-off.
Problem

Research questions and friction points this paper is trying to address.

attention mechanism
context length
computational bottleneck
large language models
attention budget
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dynamic Local-Global Attention
Token-Level Budget Allocation
Threshold-Based Budget Controller
Progressive Masking Schedule
Query-Sparse Triton Kernels
🔎 Similar Papers
No similar papers found.