mlsanityData to 7 Oct 2026

Forgetting Transformer: Softmax Attention with a Forget Gate

arXiv 2503.02130 ↗First posted 3 Mar 2025cs.LG cs.AI cs.CLcited by 50

Not on the map. Why?

Abstract (arXiv)

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 long-context 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.

Key facts. Cited by 50 papers in the map (data through 7 Oct 2026). Builds on 61 of its 73 references that are in the map. First posted on arXiv 3 Mar 2025.

Builds on

61 of 73 references.

References · 61

  1. 2017Attention Is All You Needcited by 59,932
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  4. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
  5. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  7. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
  8. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
  9. 2016Pointer Sentinel Mixture Modelscited by 2,992
  10. 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
  11. 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
  12. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
38 more
  1. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
  2. 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,140
  3. 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,114
  4. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  5. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  6. 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,283
  7. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
  8. 2020Constructing A Multi-hop QA Dataset for Comprehensive Evaluation of Reasoning Stepscited by 1,259
  9. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  10. 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 960
  11. 2022In-context Learning and Induction Headscited by 930
  12. 2021MuSiQue: Multihop Questions via Single-hop Question Compositioncited by 893
  13. 2023Scaling Vision Transformers to 22 Billion Parameterscited by 690
  14. 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
  15. 2017The NarrativeQA Reading Comprehension Challengecited by 590
  16. 2019SAMSum Corpus: A Human-annotated Dialogue Dataset for Abstractive Summarizationcited by 530
  17. 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 490
  18. 2021A Dataset of Information-Seeking Questions and Answers Anchored in Research Paperscited by 475
  19. 2019Multi-News: a Large-Scale Multi-Document Summarization Dataset and Abstractive Hierarchical Modelcited by 431
  20. 2023Resurrecting Recurrent Neural Networks for Long Sequencescited by 397
  21. 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 373
  22. 2021QMSum: A New Benchmark for Query-based Multi-domain Meeting Summarizationcited by 363
  23. 2021Random Feature Attentioncited by 350
  24. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
  25. 2021Efficient Attentions for Long Document Summarizationcited by 342
  26. 2024Learning to (Learn at Test Time): RNNs with Expressive Hidden Statescited by 329
  27. 2024xLSTM: Extended Long Short-Term Memorycited by 320
  28. 2015LSTM: A Search Space Odysseycited by 315
  29. 2023Effective Long-Context Scaling of Foundation Modelscited by 301
  30. 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 232
  31. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 208
  32. 2022Mega: Moving Average Equipped Gated Attentioncited by 178
  33. 2024An Empirical Study of Mamba-based Language Modelscited by 177
  34. 2024Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modelingcited by 167
  35. 2024Eagle and Finch: RWKV with Matrix-Valued States and Dynamic Recurrencecited by 155
  36. 2024HGRN2: Gated Linear RNNs with State Expansioncited by 122
  37. 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
  38. 2024LongAlign: A Recipe for Long Context Alignment of Large Language Modelscited by 102

50 most cited of 61 All 61 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 28; 2026: 22.

50 papers.

Sort:

By area:

  1. 2025Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Freecited by 266
  2. 2025Kimi Linear: An Expressive, Efficient Attention Architecturecited by 169
  3. 2025Test-Time Training Done Rightcited by 121
  4. 2025Log-Linear Attentioncited by 39
  5. 2025MesaNet: Sequence Modeling by Locally Optimal Test-Time Trainingcited by 37
  6. 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 32
  7. 2025Understanding Transformer from the Perspective of Associative Memorycited by 31
  8. 2025Lattice: Learning to Efficiently Compress the Memorycited by 18
  9. 2025Cache What Lasts: Token Retention for Memory-Bounded KV Cache in LLMscited by 18
  10. 2025StateSpaceDiffuser: Bringing Long Context to Diffusion World Modelscited by 16
  11. 2025Comba: Improving Bilinear RNNs with Closed-loop Controlcited by 12
  12. 2025Learning to Skip the Middle Layers of Transformerscited by 8
38 more
  1. 2025Selective Rotary Position Embeddingcited by 8
  2. 2025Adaptive Computation Pruning for the Forgetting Transformercited by 6
  3. 2025On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspectivecited by 6
  4. 2025Group Representational Position Encodingcited by 5
  5. 2025Local Linear Attention: An Optimal Interpolation of Linear and Softmax Attention For Test-Time Regressioncited by 4
  6. 2026Raven: High-Recall Sequence Modeling with Sparse Memory Routingcited by 4
  7. 2025Event2Vec: Processing Neuromorphic Events Directly by Representations in Vector Spacecited by 3
  8. 2025Scaling Context Requires Rethinking Attentioncited by 3
  9. 2025RePo: Language Models with Context Re-Positioningcited by 3
  10. 2026The Topological Trouble With Transformerscited by 3
  11. 2026Agentic Discovery of Neural Architectures: AIRA-Compose and AIRA-Designcited by 3
  12. 2025Differential Mambacited by 2
  13. 2025Distributed Associative Memory via Online Convex Optimizationcited by 2
  14. 2025Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMscited by 2
  15. 2025TRA: Better Length Generalisation with Threshold Relative Attentioncited by 1
  16. 2025Amplify Adjacent Token Differences: Enhancing Long Chain-of-Thought Reasoning with Shift-FFNcited by 1
  17. 2025Design Principles for Sequence Models via Coefficient Dynamicscited by 1
  18. 20262Mamba2Furious: Linear in Complexity, Competitive in Accuracycited by 1
  19. 2026Screening Is Enoughcited by 1
  20. 2026Kaczmarz Linear Attentioncited by 1
  21. 2026Remember to Forget: Gated Adaptive Positional Encodingcited by 1
  22. 2026Kalman Delta Networks: Uncertainty-aware Associative Memorycited by 1
  23. 2025An empirical study on the limitation of Transformers in program trace generationcited by 0
  24. 2025Distributed Dynamic Associative Memory via Online Convex Optimizationcited by 0
  25. 2026LINA: Linear Autoregressive Image Generative Models with Continuous Tokenscited by 0
  26. 2026Gated Graph Attention Networks with Learnable Temperaturecited by 0
  27. 2026Forget Attention: Importance-Aware Attention Is All You Needcited by 0
  28. 2026Spatial Priors via Space Filling Curves for Small and Limited Data Vision Transformerscited by 0
  29. 2026Why Do Accumulated Transformations Extrapolate?cited by 0
  30. 2026Spectral Origins of the Self-Correction Blind Spot in Autoregressive Generationcited by 0
  31. 2026Caching for the Future: Scrub Jay Episodic Memory Principles for Agent Memory Systemscited by 0
  32. 2026Beyond Static and Linear: What Attention Constraints Best Fit Human Reading Times?cited by 0
  33. 2026Abstention and Noise Filtering: Two Missing Primitives of Softmax Attentioncited by 0
  34. 2026AI as a Compiler: Compiling Triton kernels without the Triton compilercited by 0
  35. 2026How Local Mixing Encodes Relative Position in Global NoPE Attentioncited by 0
  36. 2026Switching Linear Attentioncited by 0
  37. 2026A Self-Pruning Transformer: Extreme KV-Cache Compression with Universal Attentioncited by 0
  38. 2026Mechanics of Long-Context Hybrid Models Part 1.1: From Hybrid Attention to Hybrid Positioncited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2026Adaptive Memory Decay for Log-Linear Attention
  2. 2026Blurry Window Attention
  3. 2025GatedFWA: Linear Flash Windowed Attention with Gated Associative Memory
  4. 2025Trellis: Learning to Compress Key-Value Memory in Attention Models
  5. 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
  6. 2024RecurFormer: Not All Transformer Heads Need Self-Attention
  7. 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformer
  8. 2025It's All Connected: A Journey Through Test-Time Memorization, Attentional Bias, Retention, and Online Optimization