Log-Linear Attention
Han Guo, Songlin Yang, Tarushii Goel, Eric P. Xing, Tri Dao, Yoon Kim
Abstract
The attention mechanism in Transformers is an important primitive for accurate and scalable sequence modeling. Its quadratic-compute and linear-memory complexity however remain significant bottlenecks. Linear attention and state-space models enable linear-time, constant-memory sequence modeling and can moreover be trained efficiently through matmul-rich parallelization across sequence length. However, at their core these models are still RNNs, and thus their use of a fixed-size hidden state to model the context is a fundamental limitation. This paper develops log-linear attention, an attention mechanism that balances linear attention's efficiency and the expressiveness of softmax attention. Log-linear attention replaces the fixed-size hidden state with a logarithmically growing set of hidden states. We show that with a particular growth function, log-linear attention admits a similarly matmul-rich parallel form whose compute cost is log-linear in sequence length. Log-linear attention is a general framework and can be applied on top of existing linear attention variants. As case studies, we instantiate log-linear variants of two recent architectures-Mamba-2 and Gated DeltaNet-and find they perform well compared to their linear-time variants. 1 1 Code available at https://github.com/HanGuo97/log-linear-attention . 2 Thus there are three senses in which linear attention is linear: the use of a linear kernel, its reformulation as a linear RNN where the hidden state is a linear function of the previous state, and its linear-time complexity. 3 Unlike parallel scan (Blelloch, 1990) which can also parallelize linear attention across sequence length but consists mostly of elementwise operations instead of matmuls.
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.
18 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention cites Reformer: The Efficient Transformer
- Memory Caching: RNNs with Growing Memory cites Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
- Memory Caching: RNNs with Growing Memory cites Reformer: The Efficient Transformer
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Efficiently Modeling Long Sequences with Structured State Spaces
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Reformer: The Efficient Transformer
- OmniSVG: A Unified Scalable Vector Graphics Generation Model cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites Efficiently Modeling Long Sequences with Structured State Spaces
- Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites Reformer: The Efficient Transformer
- Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting cites Reformer: The Efficient Transformer
- L^2M: Mutual Information Scaling Law for Long-Context Language Modeling cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- L^2M: Mutual Information Scaling Law for Long-Context Language Modeling cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- L^2M: Mutual Information Scaling Law for Long-Context Language Modeling cites Efficiently Modeling Long Sequences with Structured State Spaces
- Efficiently Modeling Long Sequences with Structured State Spaces cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Efficiently Modeling Long Sequences with Structured State Spaces cites Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
- Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites Efficiently Modeling Long Sequences with Structured State Spaces
Cited by top-tier papers18
- OmniSVG: A Unified Scalable Vector Graphics Generation ModelYiying Yang, Wei Cheng, Sijin Chen, Xianfang Zeng et al.NeurIPS 2025 · 90 citations
- Dynamic Chunking for End-to-End Hierarchical Sequence ModelingSukjun Hwang, Brandon Wang, Albert GuICLR 2026 · 76 citations
- Jet-Nemotron: Efficient Language Model with Post Neural Architecture SearchYuxian Gu, Qinghao Hu, Haocheng Xi, Junyu Chen et al.NeurIPS 2025 · 39 citations
- LM: Mutual Information Scaling Law for Long-Context Language ModelingZhuo Chen, Oriol Mayné i Comas, Zhuotao Jin, Di Luo et al.NeurIPS 2025 · 11 citations
- Memory Caching: RNNs with Growing MemoryAli Behrouz, Zeman Li, Yuan Deng, Peilin Zhong et al.ICML 2026 · 10 citations
Builds on43
- Informer: Beyond Efficient Transformer for Long Sequence Time-Series ForecastingHaoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang et al.AAAI 2021 · 7,289 citations
- 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
- Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 citations
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
Related papers
- Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda et al.ICML 2024 · 390 citations
- A Provable Expressiveness Hierarchy in Hybrid Linear-Full AttentionXiaowei Ye, Xiaoyu He, Chao Liao, Chen Wu et al.ICML 2026
- Parallelizing Linear Transformers with the Delta Rule over Sequence LengthSonglin Yang, Bailin Wang, Yu Zhang, Yikang Shen et al.NeurIPS 2024 · 412 citations
- Sequential Parallel Duality in Prefix Scannable ModelsMorris Yau, Sharut Gupta, Valerie Engelmayer, Kazuki Irie et al.ICLR 2026 · 9 citations
- Luna: Linear Unified Nested AttentionXuezhe Ma, Xiang Kong, Sinong Wang, Chunting Zhou et al.NeurIPS 2021 · 145 citations
