Gated Linear Attention Transformers with Hardware-Efficient Training
Songlin Yang, Bailin Wang, Yikang Shen, Rameswar Panda, Yoon Kim
Abstract
Transformers with linear attention allow for efficient parallel training but can simultaneously be formulated as an RNN with 2D (matrix-valued) hidden states, thus enjoying linear-time inference complexity. However, linear attention generally underperforms ordinary softmax attention. Moreover, current implementations of linear attention lack I/O-awareness and are thus slower than highly optimized implementations of softmax attention. This work describes a hardware-efficient algorithm for linear attention that trades off memory movement against parallelizability. The resulting implementation, dubbed FLASHLINEARATTENTION, is faster than FLASHATTENTION-2 (Dao, 2023) as a standalone layer even on short sequence lengths (e.g., 1K). We then generalize this algorithm to a more expressive variant of linear attention with data-dependent gates. When used as a replacement for the standard attention layer in Transformers, the resulting gated linear attention (GLA) Transformer is found to perform competitively against the LLaMA-architecture Transformer (Touvron et al., 2023) as well recent linear-time-inference baselines such as RetNet (Sun et al., 2023a) and Mamba (Gu&Dao, 2023) on moderate-scale language modeling experiments. GLA Transformer is especially effective at length generalization, enabling a model trained on 2K to generalize to sequences longer than 20K without significant perplexity degradations. For training speed, the GLA Transformer has higher throughput than a similarly-sized Mamba model.
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.
197 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
- Big Bird: Transformers for Longer Sequences cites Reformer: The Efficient Transformer
- VMamba: Visual State Space Model cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- VMamba: Visual State Space Model cites Efficiently Modeling Long Sequences with Structured State Spaces
- xLSTM: Extended Long Short-Term Memory cites PIQA: Reasoning about Physical Commonsense in Natural Language
- xLSTM: Extended Long Short-Term Memory cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- xLSTM: Extended Long Short-Term Memory cites Efficiently Modeling Long Sequences with Structured State Spaces
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Big Bird: Transformers for Longer Sequences
- 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
- Titans: Learning to Memorize at Test Time cites PIQA: Reasoning about Physical Commonsense in Natural Language
- Titans: Learning to Memorize at Test Time cites xLSTM: Extended Long Short-Term Memory
- 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 Efficiently Modeling Long Sequences with Structured State Spaces
- 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 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites PIQA: Reasoning about Physical Commonsense in Natural Language
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Big Bird: Transformers for Longer Sequences
- 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 Efficiently Modeling Long Sequences with Structured State Spaces
- 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 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 PIQA: Reasoning about Physical Commonsense in Natural Language
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites xLSTM: Extended Long Short-Term Memory
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Efficiently Modeling Long Sequences with Structured State Spaces
Cited by top-tier papers197
- VMamba: Visual State Space ModelYue Liu, Yunjie Tian, Yuzhong Zhao, Hongtian Yu et al.NeurIPS 2024 · 3,199 citations
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations
- xLSTM: Extended Long Short-Term MemoryMaximilian Beck, Korbinian Pöppel, Markus Spanring, Andreas Auer et al.NeurIPS 2024 · 703 citations
- Parallelizing Linear Transformers with the Delta Rule over Sequence LengthSonglin Yang, Bailin Wang, Yu Zhang, Yikang Shen et al.NeurIPS 2024 · 412 citations
- Titans: Learning to Memorize at Test TimeAli Behrouz, Peilin Zhong, Vahab MirrokniNeurIPS 2025 · 368 citations
Builds on49
- 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
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
- PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao et al.AAAI 2020 · 2,916 citations
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
Related papers
- Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM KernelsMaximilian Beck, Korbinian Pöppel, Phillip Lippe, Sepp HochreiterNeurIPS 2025 · 17 citations
- DiG: Scalable and Efficient Diffusion Models with Gated Linear AttentionLianghui Zhu, Zilong Huang, Bencheng Liao, Jun Hao Liew et al.CVPR 2025
- Local Linear Attention: An Optimal Interpolation of Linear and Softmax Attention For Test-Time RegressionYifei Zuo, Yutong Yin, Zhichen Zeng, Ang Li et al.ICLR 2026 · 5 citations
- Log-Linear AttentionHan Guo, Songlin Yang, Tarushii Goel, Eric P. Xing et al.ICLR 2026 · 41 citations
- Transformer Quality in Linear TimeWeizhe Hua, Zihang Dai, Hanxiao Liu, Quoc V. LeICML 2022 · 335 citations
