Hardware-aligned Hierarchical Sparse Attention for Efficient Long-term Memory Access
Not on the map. Why?
Abstract (arXiv)
A key advantage of Recurrent Neural Networks (RNNs) over Transformers is their linear computational and space complexity enables faster training and inference for long sequences. However, RNNs are fundamentally unable to randomly access historical context, and simply integrating attention mechanisms may undermine their efficiency advantages. To overcome this limitation, we propose Hierarchical Sparse Attention (HSA), a novel attention mechanism that enhances RNNs with long-range random access flexibility while preserving their merits in efficiency and length generalization. HSA divides inputs into chunks, selects the top-k chunks and hierarchically aggregates information. The core innovation lies in learning token-to-chunk relevance based on fine-grained token-level information inside each chunk. This approach enhances the precision of chunk selection across both in-domain and out-of-domain context lengths. To make HSA efficient, we further introduce a hardware-aligned kernel design. By combining HSA with Mamba, we introduce RAMba, which achieves perfect accuracy in passkey retrieval across 64 million contexts despite pre-training on only 4K-length contexts, and significant improvements on various downstream tasks, with nearly constant memory footprint. These results show RAMba's huge potential in long-context modeling.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 56 of its 69 references that are in the map. First posted on arXiv 23 Apr 2025.
Builds on
56 of 69 references.
References · 56
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023GPT-4 Technical Reportcited by 18,396
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,148
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
38 more
- 2020Shortcut Learning in Deep Neural Networkscited by 1,969
- 2020Reformer: The Efficient Transformercited by 1,668
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2019Root Mean Square Layer Normalizationcited by 1,480
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
- 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,317
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2016Training Deep Nets with Sublinear Memory Costcited by 848
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
- 2016Abstractive Text Summarization Using Sequence-to-Sequence RNNs and Beyondcited by 812
- 2018Image Transformercited by 772
- 2019Compressive Transformers for Long-Range Sequence Modellingcited by 726
- 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
- 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 514
- 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMscited by 474
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
- 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 407
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 396
- 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 379
- 2024The Faiss librarycited by 376
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
- 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 242
- 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 213
- 2021QuALITY: Question Answering with Long Input Texts, Yes!cited by 208
- 2024Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attentioncited by 200
- 2025MoBA: Mixture of Block Attention for Long-Context LLMscited by 198
- 2024An Empirical Study of Mamba-based Language Modelscited by 186
- 2024Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modelingcited by 174
- 2024Eagle and Finch: RWKV with Matrix-Valued States and Dynamic Recurrencecited by 159
- 2017Parallelizing Linear Recurrent Neural Nets Over Sequence Lengthcited by 127
- 2024HGRN2: Gated Linear RNNs with State Expansioncited by 127
- 2020Fast Transformers with Clustered Attentioncited by 123
- 2023Hierarchically Gated Recurrent Neural Network for Sequence Modelingcited by 102
- 2024Long-Context Language Modeling with Parallel Context Encodingcited by 84
- 2024Gated Slot Attention for Efficient Linear-Time Sequence Modelingcited by 76
- 2021Combiner: Full Attention Transformer with Sparse Computation Costcited by 64
50 most cited of 56 All 56 (JSON)
Built on by
Citing papers per year: 2025: 2; 2026: 7.
9 papers.
- 2026Hierarchical Sparse Attention Done Right: Toward Infinite Context Modelingcited by 12
- 2025Understanding and Improving Length Generalization in Hierarchical Sparse Attention Modelscited by 6
- 2026MiniCPM-SALA: Hybridizing Sparse and Linear Attention for Efficient Long-Context Modelingcited by 5
- 2026DashAttention: Differentiable and Adaptive Sparse Hierarchical Attentioncited by 4
- 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Modelscited by 3
- 2026Parallel Causal Associative Fields: Gated Sparse Memory for Long-Context Language Modelingcited by 0
- 2026Opinion Leader Dynamics: How Sparse Attention Shapes Token Clusteringcited by 0
- 2026SuPER-Mamba: Surprisal Prioritization for Extended-Context Routing in Mambacited by 0
- 2026FreeSolo: Linear-time Sparse Attention with Zero-Shot Length Extrapolationcited by 0
- 2026FreeSolo: Linear-time Sparse Attention with Zero-Shot Length Extrapolation12 Oct 2026
- 2026SuPER-Mamba: Surprisal Prioritization for Extended-Context Routing in Mamba12 Oct 2026
- 2026Opinion Leader Dynamics: How Sparse Attention Shapes Token Clustering21 Sep 2026
- 2026Hierarchical Sparse Attention Done Right: Toward Infinite Context Modeling3 Jul 2026
- 2026Parallel Causal Associative Fields: Gated Sparse Memory for Long-Context Language Modeling9 Jun 2026
- 2026DashAttention: Differentiable and Adaptive Sparse Hierarchical Attention18 May 2026
- 2026MiniCPM-SALA: Hybridizing Sparse and Linear Attention for Efficient Long-Context Modeling12 Feb 2026
- 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Models28 Nov 2025
- 2025Understanding and Improving Length Generalization in Hierarchical Sparse Attention Models20 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2025Long-Context Modeling with Dynamic Hierarchical Sparse Attention for Memory-Constrained LLM Inference
- 2026Simplified Sparse Attention via Gist Tokens
- 2025Rectified Sparse Attention
- 2026RAM-Net: Linear-Time Sequence Modeling with Sparsely Addressable State
- 2026Scaling Attention via Feature Sparsity
- 2025Progressive Sparse Attention: Algorithm and System Co-design for Efficient Attention in LLM Serving
- 2026Full Attention Strikes Back: Transferring Full Attention into Sparse within Hundred Training Steps
- 2026Double-P: Hierarchical Top-P Sparse Attention for Long-Context LLMs