Lune

ICML2024Top-tier venue

Simple linear attention language models balance the recall-throughput tradeoff

Simran Arora, Sabri Eyuboglu, Michael Zhang, Aman Timalsina, Silas Alberti, James Zou, Atri Rudra, Christopher Ré

Abstract

Recent work has shown that attention-based language models excel at recall, the ability to ground generations in tokens previously seen in context. However, the efficiency of attention-based models is bottle-necked during inference by the KV-cache's aggressive memory consumption. In this work, we explore whether we can improve language model efficiency (e.g. by reducing memory consumption) without compromising on recall. By applying experiments and theory to a broad set of architectures, we identify a key tradeoff between a model's state size and recall ability. We show that efficient alternatives to attention (e.g. H3, Mamba, RWKV) maintain a fixed-size recurrent state, but struggle at recall. We propose BASED a simple architecture combining linear and sliding window attention. By varying BASED window size and linear attention feature dimension, we can dial the state size and traverse the pareto frontier of the recall-memory tradeoff curve, recovering the full quality of attention on one end and the small state size of attention-alternatives on the other. We train language models up to 1.3b parameters and show that BASED matches the strongest sub-quadratic models (e.g. Mamba) in perplexity and outperforms them on real-world recall-intensive tasks by 6.22 accuracy points. Implementations of linear attention are often less efficient than optimized standard attention implementations. To make BASED competitive, we develop IO-aware algorithms that enable 24x higher throughput on language generation than FlashAttention-2, when generating 1024 tokens using 1.3b parameter models. Code for this work is provided at: https://github.com/HazyResearch/based.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

77 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Hyena Hierarchy: Towards Larger Convolutional Language Models cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Hyena Hierarchy: Towards Larger Convolutional Language Models cites Reformer: The Efficient Transformer
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Reformer: The Efficient Transformer
  • Titans: Learning to Memorize at Test Time cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Titans: Learning to Memorize at Test Time cites Parallelizing Linear Transformers with the Delta Rule over Sequence Length
  • Titans: Learning to Memorize at Test Time cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Titans: Learning to Memorize at Test Time cites Gated Linear Attention Transformers with Hardware-Efficient Training
  • Titans: Learning to Memorize at Test Time cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Hyena Hierarchy: Towards Larger Convolutional Language Models
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Reformer: The Efficient Transformer
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Gated Linear Attention Transformers with Hardware-Efficient Training
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Hyena Hierarchy: Towards Larger Convolutional Language Models
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Parallelizing Linear Transformers with the Delta Rule over Sequence Length
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Gated Linear Attention Transformers with Hardware-Efficient Training
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning cites Reformer: The Efficient Transformer
  • Nyströmformer: A Nyström-based Algorithm for Approximating Self-Attention cites Reformer: The Efficient Transformer
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites Hyena Hierarchy: Towards Larger Convolutional Language Models
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites Reformer: The Efficient Transformer
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Gated Linear Attention Transformers with Hardware-Efficient Training
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Hyena Hierarchy: Towards Larger Convolutional Language Models
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Nyströmformer: A Nyström-based Algorithm for Approximating Self-Attention
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers77

  1. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations
  2. Parallelizing Linear Transformers with the Delta Rule over Sequence LengthSonglin Yang, Bailin Wang, Yu Zhang, Yikang Shen et al.NeurIPS 2024 · 412 citations
  3. Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda et al.ICML 2024 · 390 citations
  4. Titans: Learning to Memorize at Test TimeAli Behrouz, Peilin Zhong, Vahab MirrokniNeurIPS 2025 · 368 citations
  5. The Mamba in the Llama: Distilling and Accelerating Hybrid ModelsJunxiong Wang, Daniele Paliotta, Avner May, Alexander M. Rush et al.NeurIPS 2024 · 146 citations

Builds on13

  1. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  2. Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
  3. FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
  4. Nyströmformer: A Nyström-based Algorithm for Approximating Self-AttentionYunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan et al.AAAI 2021 · 675 citations
  5. Hyena Hierarchy: Towards Larger Convolutional Language ModelsMichael Poli, Stefano Massaroli, Eric Nguyen, Daniel Y. Fu et al.ICML 2023 · 481 citations

Related papers

  1. Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language ModelingLiliang Ren, Yang Liu, Yadong Lu, Yelong Shen et al.ICLR 2025
  2. Mamba-3: Improved Sequence Modeling using State Space PrinciplesAakash Sunil Lahoti, Kevin Y. Li, Berlin Chen, Caitlin Wang et al.ICLR 2026 · 96 citations
  3. DiffuMamba: High-Throughput Diffusion LMs with Mamba BackboneVaibhav Singh, Oleksiy Ostapenko, Pierre-André Noël, Eugene Belilovsky et al.ICML 2026
  4. Rodimus*: Breaking the Accuracy-Efficiency Trade-Off with Efficient AttentionsZhihao He, Hang Yu, Zi Gong, Shizhan Liu et al.ICLR 2025
  5. RAT: Bridging RNN Efficiency and Attention Accuracy via Chunk-based Sequence ModelingXiuying Wei, Anunay Yadav, Razvan Pascanu, Caglar GulcehreNeurIPS 2025 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines