Gated Linear Attention Transformers with Hardware-Efficient Training
Songlin Yang, Bailin Wang, Yikang Shen, Rameswar Panda, Yoon Kim
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 197 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Big Bird: Transformers for Longer Sequences 引用了 Reformer: The Efficient Transformer
- VMamba: Visual State Space Model 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- VMamba: Visual State Space Model 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- xLSTM: Extended Long Short-Term Memory 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- xLSTM: Extended Long Short-Term Memory 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- xLSTM: Extended Long Short-Term Memory 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Big Bird: Transformers for Longer Sequences
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Reformer: The Efficient Transformer
- Titans: Learning to Memorize at Test Time 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- Titans: Learning to Memorize at Test Time 引用了 xLSTM: Extended Long Short-Term Memory
- Titans: Learning to Memorize at Test Time 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Titans: Learning to Memorize at Test Time 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- Titans: Learning to Memorize at Test Time 引用了 Parallelizing Linear Transformers with the Delta Rule over Sequence Length
- 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 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 Big Bird: Transformers for Longer Sequences
- 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 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 Reformer: The Efficient Transformer
- Parallelizing Linear Transformers with the Delta Rule over Sequence Length 引用了 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 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 xLSTM: Extended Long Short-Term Memory
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
引用它的顶会 Paper197
- VMamba: Visual State Space ModelYue Liu, Yunjie Tian, Yuzhong Zhao, Hongtian Yu 等NeurIPS 2024 · 3,199 次引用
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 次引用
- xLSTM: Extended Long Short-Term MemoryMaximilian Beck, Korbinian Pöppel, Markus Spanring, Andreas Auer 等NeurIPS 2024 · 703 次引用
- Parallelizing Linear Transformers with the Delta Rule over Sequence LengthSonglin Yang, Bailin Wang, Yu Zhang, Yikang Shen 等NeurIPS 2024 · 412 次引用
- Titans: Learning to Memorize at Test TimeAli Behrouz, Peilin Zhong, Vahab MirrokniNeurIPS 2025 · 368 次引用
它引用的 Paper49
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 次引用
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
- PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao 等AAAI 2020 · 2,916 次引用
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
相关 Paper
- Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM KernelsMaximilian Beck, Korbinian Pöppel, Phillip Lippe, Sepp HochreiterNeurIPS 2025 · 17 次引用
- DiG: Scalable and Efficient Diffusion Models with Gated Linear AttentionLianghui Zhu, Zilong Huang, Bencheng Liao, Jun Hao Liew 等CVPR 2025
- Local Linear Attention: An Optimal Interpolation of Linear and Softmax Attention For Test-Time RegressionYifei Zuo, Yutong Yin, Zhichen Zeng, Ang Li 等ICLR 2026 · 5 次引用
- Log-Linear AttentionHan Guo, Songlin Yang, Tarushii Goel, Eric P. Xing 等ICLR 2026 · 41 次引用
- Transformer Quality in Linear TimeWeizhe Hua, Zihang Dai, Hanxiao Liu, Quoc V. LeICML 2022 · 335 次引用
