Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM Kernels
Maximilian Beck, Korbinian Pöppel, Phillip Lippe, Sepp Hochreiter
Abstract
Linear RNNs with gating recently demonstrated competitive performance compared to Transformers in language modeling. Although their linear compute scaling in sequence length offers theoretical runtime advantages over Transformers, realizing these benefits in practice requires optimized custom kernels, as Transformers rely on the highly efficient Flash Attention kernels (Dao, 2024). Leveraging the chunkwise-parallel formulation of linear RNNs, Flash Linear Attention (FLA) (Yang & Zhang, 2024) shows that linear RNN kernels are faster than Flash Attention, by parallelizing over chunks of the input sequence. However, since the chunk size of FLA is limited, many intermediate states must be materialized in GPU memory. This leads to low arithmetic intensity and causes high memory consumption and IO cost, especially for long-context pre-training. In this work, we present Tiled Flash Linear Attention (TFLA), a novel kernel algorithm for linear RNNs, that enables arbitrary large chunk sizes and high arithmetic intensity by introducing an additional level of sequence parallelization within each chunk. First, we apply TFLA to the xLSTM with matrix memory, the mLSTM (Beck et al., 2024). Second, we propose an mLSTM variant with sigmoid input gate and reduced computation for even faster kernel runtimes at equal language modeling performance. In our speed benchmarks, we show that our new mLSTM kernels based on TFLA outperform highly optimized Flash Attention, Linear Attention and Mamba kernels, setting a new state of the art for efficient long-context sequence modeling primitives. Our code is available at: https://github.com/NX-AI/mlstm_kernels * Now at Google Deepmind.
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.
9 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
- DeltaProduct: Improving State-Tracking in Linear RNNs via Householder Products cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- DeltaProduct: Improving State-Tracking in Linear RNNs via Householder Products cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- xLSTM Scaling Laws: Competitive Performance with Linear Time-Complexity cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Effective Distillation to Hybrid xLSTM Architectures cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Effective Distillation to Hybrid xLSTM Architectures cites xLSTM Scaling Laws: Competitive Performance with Linear Time-Complexity
- Effective Distillation to Hybrid xLSTM Architectures cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Effective Distillation to Hybrid xLSTM Architectures cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- Effective Distillation to Hybrid xLSTM Architectures cites Short Window Attention Enables Long-Term Memorization
- 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 Language Models are Few-Shot Learners
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Log-Linear Attention cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Log-Linear Attention cites DeltaProduct: Improving State-Tracking in Linear RNNs via Householder Products
- Log-Linear Attention cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Log-Linear Attention cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Log-Linear Attention 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 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Language Models are Few-Shot Learners
- Short Window Attention Enables Long-Term Memorization cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
Cited by top-tier papers9
- DeltaProduct: Improving State-Tracking in Linear RNNs via Householder ProductsJulien Siems, Timur Carstensen, Arber Zela, Frank Hutter et al.NeurIPS 2025 · 75 citations
- Log-Linear AttentionHan Guo, Songlin Yang, Tarushii Goel, Eric P. Xing et al.ICLR 2026 · 41 citations
- Short Window Attention Enables Long-Term MemorizationLoïc Cabannes, Maximilian Beck, Maria Lomeli, Gergely Szilvasy et al.ICLR 2026 · 11 citations
- xLSTM Scaling Laws: Competitive Performance with Linear Time-ComplexityMaximilian Beck, Kajetan Schweighofer, Sebastian Böck, Sebastian Lehner et al.ICLR 2026 · 3 citations
- Effective Distillation to Hybrid xLSTM ArchitecturesLukas Hauzenberger, Niklas Schmidinger, Thomas Schmied, Anamaria-Roberta Hartl et al.ICML 2026 · 3 citations
Builds on23
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 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
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations
Related papers
- Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda et al.ICML 2024 · 390 citations
- FlexLinearAttention: Compiling a Unified Abstraction into Scalable Kernels for Linear AttentionHaojie Duanmu, Size Zheng, Ningxin Zheng, Jianqiao Lu et al.ICLR 2026
- QiMeng-Attention: SOTA Attention Operator is generated by SOTA Attention AlgorithmQirui Zhou, Shaohui Peng, Weiqiang Xiong, Haixin Chen et al.ACL Findings 2025 · 1 citation
- Various Lengths, Constant Speed: Efficient Language Modeling with Lightning AttentionZhen Qin, Weigao Sun, Dong Li, Xuyang Shen et al.ICML 2024 · 26 citations
- Masked Gated Linear UnitYukito Tajima, Nakamasa Inoue, Yusuke Sekikawa, Ikuro Sato et al.NeurIPS 2025
