mlsanityData to 14 Oct 2026

Hardware-aligned Hierarchical Sparse Attention for Efficient Long-term Memory Access

arXiv 2504.16795 ↗First posted 23 Apr 2025cs.CL cs.AIcited by 9

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2023GPT-4 Technical Reportcited by 18,396
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  5. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  7. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,148
  8. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
  9. 2020Longformer: The Long-Document Transformercited by 3,413
  10. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  11. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
  12. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
38 more
  1. 2020Shortcut Learning in Deep Neural Networkscited by 1,969
  2. 2020Reformer: The Efficient Transformercited by 1,668
  3. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  4. 2019Root Mean Square Layer Normalizationcited by 1,480
  5. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
  6. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  7. 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
  8. 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,317
  9. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
  10. 2016Training Deep Nets with Sublinear Memory Costcited by 848
  11. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
  12. 2016Abstractive Text Summarization Using Sequence-to-Sequence RNNs and Beyondcited by 812
  13. 2018Image Transformercited by 772
  14. 2019Compressive Transformers for Long-Range Sequence Modellingcited by 726
  15. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
  16. 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 514
  17. 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMscited by 474
  18. 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
  19. 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 407
  20. 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 396
  21. 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 379
  22. 2024The Faiss librarycited by 376
  23. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
  24. 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 242
  25. 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 213
  26. 2021QuALITY: Question Answering with Long Input Texts, Yes!cited by 208
  27. 2024Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attentioncited by 200
  28. 2025MoBA: Mixture of Block Attention for Long-Context LLMscited by 198
  29. 2024An Empirical Study of Mamba-based Language Modelscited by 186
  30. 2024Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modelingcited by 174
  31. 2024Eagle and Finch: RWKV with Matrix-Valued States and Dynamic Recurrencecited by 159
  32. 2017Parallelizing Linear Recurrent Neural Nets Over Sequence Lengthcited by 127
  33. 2024HGRN2: Gated Linear RNNs with State Expansioncited by 127
  34. 2020Fast Transformers with Clustered Attentioncited by 123
  35. 2023Hierarchically Gated Recurrent Neural Network for Sequence Modelingcited by 102
  36. 2024Long-Context Language Modeling with Parallel Context Encodingcited by 84
  37. 2024Gated Slot Attention for Efficient Linear-Time Sequence Modelingcited by 76
  38. 2021Combiner: Full Attention Transformer with Sparse Computation Costcited by 64

50 most cited of 56 All 56 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 7.

9 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Long-Context Modeling with Dynamic Hierarchical Sparse Attention for Memory-Constrained LLM Inference
  2. 2026Simplified Sparse Attention via Gist Tokens
  3. 2025Rectified Sparse Attention
  4. 2026RAM-Net: Linear-Time Sequence Modeling with Sparsely Addressable State
  5. 2026Scaling Attention via Feature Sparsity
  6. 2025Progressive Sparse Attention: Algorithm and System Co-design for Efficient Attention in LLM Serving
  7. 2026Full Attention Strikes Back: Transferring Full Attention into Sparse within Hundred Training Steps
  8. 2026Double-P: Hierarchical Top-P Sparse Attention for Long-Context LLMs