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é
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 77 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Hyena Hierarchy: Towards Larger Convolutional Language Models 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Hyena Hierarchy: Towards Larger Convolutional Language Models 引用了 Reformer: The Efficient Transformer
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Reformer: The Efficient Transformer
- Titans: Learning to Memorize at Test Time 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Titans: Learning to Memorize at Test Time 引用了 Parallelizing Linear Transformers with the Delta Rule over Sequence Length
- Titans: Learning to Memorize at Test Time 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Titans: Learning to Memorize at Test Time 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
- Titans: Learning to Memorize at Test Time 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 Hyena Hierarchy: Towards Larger Convolutional Language Models
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 Reformer: The Efficient Transformer
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Hyena Hierarchy: Towards Larger Convolutional Language Models
- The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Parallelizing Linear Transformers with the Delta Rule over Sequence Length
- The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
- The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 Reformer: The Efficient Transformer
- Nyströmformer: A Nyström-based Algorithm for Approximating Self-Attention 引用了 Reformer: The Efficient Transformer
- Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 Hyena Hierarchy: Towards Larger Convolutional Language Models
- Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 Reformer: The Efficient Transformer
- Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 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 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Hyena Hierarchy: Towards Larger Convolutional Language Models
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Nyströmformer: A Nyström-based Algorithm for Approximating Self-Attention
引用它的顶会 Paper77
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 次引用
- Parallelizing Linear Transformers with the Delta Rule over Sequence LengthSonglin Yang, Bailin Wang, Yu Zhang, Yikang Shen 等NeurIPS 2024 · 412 次引用
- Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda 等ICML 2024 · 390 次引用
- Titans: Learning to Memorize at Test TimeAli Behrouz, Peilin Zhong, Vahab MirrokniNeurIPS 2025 · 368 次引用
- The Mamba in the Llama: Distilling and Accelerating Hybrid ModelsJunxiong Wang, Daniele Paliotta, Avner May, Alexander M. Rush 等NeurIPS 2024 · 146 次引用
它引用的 Paper13
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 次引用
- Nyströmformer: A Nyström-based Algorithm for Approximating Self-AttentionYunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan 等AAAI 2021 · 675 次引用
- Hyena Hierarchy: Towards Larger Convolutional Language ModelsMichael Poli, Stefano Massaroli, Eric Nguyen, Daniel Y. Fu 等ICML 2023 · 481 次引用
相关 Paper
- Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language ModelingLiliang Ren, Yang Liu, Yadong Lu, Yelong Shen 等ICLR 2025
- Mamba-3: Improved Sequence Modeling using State Space PrinciplesAakash Sunil Lahoti, Kevin Y. Li, Berlin Chen, Caitlin Wang 等ICLR 2026 · 96 次引用
- DiffuMamba: High-Throughput Diffusion LMs with Mamba BackboneVaibhav Singh, Oleksiy Ostapenko, Pierre-André Noël, Eugene Belilovsky 等ICML 2026
- Rodimus*: Breaking the Accuracy-Efficiency Trade-Off with Efficient AttentionsZhihao He, Hang Yu, Zi Gong, Shizhan Liu 等ICLR 2025
- RAT: Bridging RNN Efficiency and Attention Accuracy via Chunk-based Sequence ModelingXiuying Wei, Anunay Yadav, Razvan Pascanu, Caglar GulcehreNeurIPS 2025 · 3 次引用
