Forgetting Transformer: Softmax Attention with a Forget Gate
Zhixuan Lin, Evgenii Nikishin, Xu Owen He, Aaron C. Courville
摘要
An essential component of modern recurrent sequence models is the forget gate. While Transformers do not have an explicit recurrent form, we show that a forget gate can be naturally incorporated into Transformers by down-weighting the unnormalized attention scores in a data-dependent way. We name this attention mechanism Forgetting Attention and the resulting model the Forgetting Transformer (FoX). We show that FoX outperforms the Transformer on longcontext language modeling, length extrapolation, and short-context downstream tasks, while performing on par with the Transformer on long-context downstream tasks. Moreover, it is compatible with the FlashAttention algorithm and does not require any positional embeddings. Several analyses, including the needle-in-the-haystack test, show that FoX also retains the Transformer's superior long-context capabilities over recurrent sequence models such as Mamba-2, HGRN2, and DeltaNet. We also introduce a "Pro" block design that incorporates some common architectural components in recurrent sequence models and find it significantly improves the performance of both FoX and the Transformer. Our code is available at https://github.com/zhixuan-lin/ forgetting-transformer.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 20 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- DeltaProduct: Improving State-Tracking in Linear RNNs via Householder Products 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- DeltaProduct: Improving State-Tracking in Linear RNNs via Householder Products 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- DeltaProduct: Improving State-Tracking in Linear RNNs via Householder Products 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- Test-Time Training Done Right 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Test-Time Training Done Right 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- Log-Linear Attention 引用了 DeltaProduct: Improving State-Tracking in Linear RNNs via Householder Products
- Log-Linear Attention 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- Log-Linear Attention 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Log-Linear Attention 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- MesaNet: Sequence Modeling by Locally Optimal Test-Time Training 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- MesaNet: Sequence Modeling by Locally Optimal Test-Time Training 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- MesaNet: Sequence Modeling by Locally Optimal Test-Time Training 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- MesaNet: Sequence Modeling by Locally Optimal Test-Time Training 引用了 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 引用了 Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
引用它的顶会 Paper20
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-FreeZihan Qiu, Zekun Wang, Bo Zheng, Zeyu Huang 等NeurIPS 2025 · 336 次引用
- Test-Time Training Done RightTianyuan Zhang, Sai Bi, Yicong Hong, Kai Zhang 等ICLR 2026 · 127 次引用
- DeltaProduct: Improving State-Tracking in Linear RNNs via Householder ProductsJulien Siems, Timur Carstensen, Arber Zela, Frank Hutter 等NeurIPS 2025 · 75 次引用
- MesaNet: Sequence Modeling by Locally Optimal Test-Time TrainingJohannes von Oswald, Nino Scherrer, Seijin Kobayashi, Luca Versari 等ICLR 2026 · 45 次引用
- Log-Linear AttentionHan Guo, Songlin Yang, Tarushii Goel, Eric P. Xing 等ICLR 2026 · 41 次引用
它引用的 Paper29
- Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 次引用
- PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao 等AAAI 2020 · 2,916 次引用
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 次引用
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 次引用
- Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 次引用
相关 Paper
- Transformer Quality in Linear TimeWeizhe Hua, Zihang Dai, Hanxiao Liu, Quoc V. LeICML 2022 · 335 次引用
- FiX: Introducing Fine-grained Forget Gate into Softmax AttentionRunzhong Li, Renjie Liu, Qing Li, Bo TangICML 2026
- Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda 等ICML 2024 · 390 次引用
- RAT: Bridging RNN Efficiency and Attention Accuracy via Chunk-based Sequence ModelingXiuying Wei, Anunay Yadav, Razvan Pascanu, Caglar GulcehreNeurIPS 2025 · 3 次引用
- Gated Delta Networks: Improving Mamba2 with Delta RuleSonglin Yang, Jan Kautz, Ali HatamizadehICLR 2025
