RATTENTION: Towards the Minimal Sliding Window Size in Local-Global Attention Models
Not on the map. Why?
Abstract (arXiv)
Local-global attention models have recently emerged as compelling alternatives to standard Transformers, promising improvements in both training and inference efficiency. However, the crucial choice of window size presents a Pareto tradeoff: larger windows maintain performance akin to full attention but offer minimal efficiency gains in short-context scenarios, while smaller windows can lead to performance degradation. Current models, such as Gemma2 and Mistral, adopt conservative window sizes (e.g., 4096 out of an 8192 pretraining length) to preserve performance. This work investigates strategies to shift this Pareto frontier, enabling local-global models to achieve efficiency gains even in short-context regimes. Our core motivation is to address the intrinsic limitation of local attention -- its complete disregard for tokens outside the defined window. We explore RATTENTION, a variant of local attention integrated with a specialized linear attention mechanism designed to capture information from these out-of-window tokens. Pretraining experiments at the 3B and 12B scales demonstrate that RATTENTION achieves a superior Pareto tradeoff between performance and efficiency. As a sweet spot, RATTENTION with a window size of just 512 consistently matches the performance of full-attention models across diverse settings. Furthermore, the recurrent nature inherent in the linear attention component of RATTENTION contributes to enhanced long-context performance, as validated on the RULER benchmark. Crucially, these improvements do not compromise training efficiency; thanks to a specialized kernel implementation and the reduced window size, RATTENTION maintains training speeds comparable to existing state-of-the-art approaches. We open-sourced our Pallas kernels along with model codes to facilitate further research effort.
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Builds on 20 of its 31 references that are in the map. First posted on arXiv 18 Jun 2025.
Builds on
20 of 31 references.
References · 20
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,955
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2020Reformer: The Efficient Transformercited by 1,668
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 992
8 more
- 2017Crowdsourcing Multiple Choice Science Questionscited by 765
- 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 613
- 2024Gated Delta Networks: Improving Mamba2 with Delta Rulecited by 532
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
- 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 242
- 2024Simple linear attention language models balance the recall-throughput tradeoffcited by 208
- 2023Unlimiformer: Long-Range Transformers with Unlimited Length Inputcited by 128
- 2025Rope to Nope and Back Again: A New Hybrid Attention Strategycited by 47
Built on by
Citing papers per year: 2025: 2; 2026: 8.
10 papers.
- 2026Hierarchical Sparse Attention Done Right: Toward Infinite Context Modelingcited by 12
- 2026A Hippocampus for Linear Attention: An Exact Memory for What the Recurrent State Forgetscited by 6
- 2025SWAA: Sliding Window Attention Adaptation for Efficient and Quality Preserving Long Context Processingcited by 4
- 2026Stochastic KV Routing: Enabling Adaptive Depth-Wise Cache Sharingcited by 4
- 2026Memory for Large Language Modelscited by 4
- 2026SPLA: Block Sparse Plus Linear Attention for Long Context Modelingcited by 3
- 2026Learning What to Remember: Test-Time Training via Context Distillationcited by 2
- 2026MARCH: Scaling Recurrent Memory with Content-Routed State Anchorscited by 2
- 2025Sliding Window Recurrences for Sequence Modelscited by 1
- 2026Safin-1: Safety from Within through Memory-Native State Evolutioncited by 1
- 2026Safin-1: Safety from Within through Memory-Native State Evolution31 Aug 2026
- 2026MARCH: Scaling Recurrent Memory with Content-Routed State Anchors12 Aug 2026
- 2026Learning What to Remember: Test-Time Training via Context Distillation3 Aug 2026
- 2026Memory for Large Language Models28 Jul 2026
- 2026Hierarchical Sparse Attention Done Right: Toward Infinite Context Modeling3 Jul 2026
- 2026A Hippocampus for Linear Attention: An Exact Memory for What the Recurrent State Forgets2 Jul 2026
- 2026Stochastic KV Routing: Enabling Adaptive Depth-Wise Cache Sharing3 Apr 2026
- 2026SPLA: Block Sparse Plus Linear Attention for Long Context Modeling29 Jan 2026
- 2025Sliding Window Recurrences for Sequence Models15 Dec 2025
- 2025SWAA: Sliding Window Attention Adaptation for Efficient and Quality Preserving Long Context Processing11 Dec 2025