[2506.04761] Log-Linear Attention
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.
View PDF HTML (experimental) 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…
saved by
related reading
- [2512.19428] Attention Is Not What You Needarxiv.org
- Linear Attention Fundamentals | Hailey Schoelkopfhaileyschoelkopf.github.io
- On the Tradeoffs of SSMs and Transformers | Goomba Labgoombalab.github.io
- Linear Transformers Are Faster After All – Manifest AImanifestai.com
- A Mathematical Framework for Transformer Circuitstransformer-circuits.pub
- Linear Attention Is All You Need | Towards Data Sciencetowardsdatascience.com
- transformer_attention.pdfarxiv.org
- DeltaNet Explained (Part I) | Songlin Yangsustcsonglin.github.io
- Parallelizing Linear Transformers with the Delta Rule over Sequence Lengtharxiv.org
- [2607.07953] Linear Attention Architectures: Mechanisms, Trade-offs, and Cross-Layer Routingarxiv.org
- [2507.04239] Scaling Context Requires Rethinking Attentionarxiv.org
- Kimi Linear: An Expressive, Efficient Attention Architecturearxiv.org