Forgetting Transformer: Softmax Attention with a Forget Gate
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
- 2017Attention Is All You Needcited by 59,932
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2016Pointer Sentinel Mixture Modelscited by 2,992
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
38 more
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
- 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,140
- 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,114
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
- 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,283
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
- 2020Constructing A Multi-hop QA Dataset for Comprehensive Evaluation of Reasoning Stepscited by 1,259
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 960
- 2022In-context Learning and Induction Headscited by 930
- 2021MuSiQue: Multihop Questions via Single-hop Question Compositioncited by 893
- 2023Scaling Vision Transformers to 22 Billion Parameterscited by 690
- 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
- 2017The NarrativeQA Reading Comprehension Challengecited by 590
- 2019SAMSum Corpus: A Human-annotated Dialogue Dataset for Abstractive Summarizationcited by 530
- 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 490
- 2021A Dataset of Information-Seeking Questions and Answers Anchored in Research Paperscited by 475
- 2019Multi-News: a Large-Scale Multi-Document Summarization Dataset and Abstractive Hierarchical Modelcited by 431
- 2023Resurrecting Recurrent Neural Networks for Long Sequencescited by 397
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 373
- 2021QMSum: A New Benchmark for Query-based Multi-domain Meeting Summarizationcited by 363
- 2021Random Feature Attentioncited by 350
- 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
- 2021Efficient Attentions for Long Document Summarizationcited by 342
- 2024Learning to (Learn at Test Time): RNNs with Expressive Hidden Statescited by 329
- 2024xLSTM: Extended Long Short-Term Memorycited by 320
- 2015LSTM: A Search Space Odysseycited by 315
- 2023Effective Long-Context Scaling of Foundation Modelscited by 301
- 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 232
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 208
- 2022Mega: Moving Average Equipped Gated Attentioncited by 178
- 2024An Empirical Study of Mamba-based Language Modelscited by 177
- 2024Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modelingcited by 167
- 2024Eagle and Finch: RWKV with Matrix-Valued States and Dynamic Recurrencecited by 155
- 2024HGRN2: Gated Linear RNNs with State Expansioncited by 122
- 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
- 2024LongAlign: A Recipe for Long Context Alignment of Large Language Modelscited by 102
50 most cited of 61 All 61 (JSON)
Built on by
Citing papers per year: 2025: 28; 2026: 22.
50 papers.
Sort:
By area:
- 2025Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Freecited by 266
- 2025Kimi Linear: An Expressive, Efficient Attention Architecturecited by 169
- 2025Test-Time Training Done Rightcited by 121
- 2025Log-Linear Attentioncited by 39
- 2025MesaNet: Sequence Modeling by Locally Optimal Test-Time Trainingcited by 37
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 32
- 2025Understanding Transformer from the Perspective of Associative Memorycited by 31
- 2025Lattice: Learning to Efficiently Compress the Memorycited by 18
- 2025Cache What Lasts: Token Retention for Memory-Bounded KV Cache in LLMscited by 18
- 2025StateSpaceDiffuser: Bringing Long Context to Diffusion World Modelscited by 16
- 2025Comba: Improving Bilinear RNNs with Closed-loop Controlcited by 12
- 2025Learning to Skip the Middle Layers of Transformerscited by 8
38 more
- 2025Selective Rotary Position Embeddingcited by 8
- 2025Adaptive Computation Pruning for the Forgetting Transformercited by 6
- 2025On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspectivecited by 6
- 2025Group Representational Position Encodingcited by 5
- 2025Local Linear Attention: An Optimal Interpolation of Linear and Softmax Attention For Test-Time Regressioncited by 4
- 2026Raven: High-Recall Sequence Modeling with Sparse Memory Routingcited by 4
- 2025Event2Vec: Processing Neuromorphic Events Directly by Representations in Vector Spacecited by 3
- 2025Scaling Context Requires Rethinking Attentioncited by 3
- 2025RePo: Language Models with Context Re-Positioningcited by 3
- 2026The Topological Trouble With Transformerscited by 3
- 2026Agentic Discovery of Neural Architectures: AIRA-Compose and AIRA-Designcited by 3
- 2025Differential Mambacited by 2
- 2025Distributed Associative Memory via Online Convex Optimizationcited by 2
- 2025Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMscited by 2
- 2025TRA: Better Length Generalisation with Threshold Relative Attentioncited by 1
- 2025Amplify Adjacent Token Differences: Enhancing Long Chain-of-Thought Reasoning with Shift-FFNcited by 1
- 2025Design Principles for Sequence Models via Coefficient Dynamicscited by 1
- 20262Mamba2Furious: Linear in Complexity, Competitive in Accuracycited by 1
- 2026Screening Is Enoughcited by 1
- 2026Kaczmarz Linear Attentioncited by 1
- 2026Remember to Forget: Gated Adaptive Positional Encodingcited by 1
- 2026Kalman Delta Networks: Uncertainty-aware Associative Memorycited by 1
- 2025An empirical study on the limitation of Transformers in program trace generationcited by 0
- 2025Distributed Dynamic Associative Memory via Online Convex Optimizationcited by 0
- 2026LINA: Linear Autoregressive Image Generative Models with Continuous Tokenscited by 0
- 2026Gated Graph Attention Networks with Learnable Temperaturecited by 0
- 2026Forget Attention: Importance-Aware Attention Is All You Needcited by 0
- 2026Spatial Priors via Space Filling Curves for Small and Limited Data Vision Transformerscited by 0
- 2026Why Do Accumulated Transformations Extrapolate?cited by 0
- 2026Spectral Origins of the Self-Correction Blind Spot in Autoregressive Generationcited by 0
- 2026Caching for the Future: Scrub Jay Episodic Memory Principles for Agent Memory Systemscited by 0
- 2026Beyond Static and Linear: What Attention Constraints Best Fit Human Reading Times?cited by 0
- 2026Abstention and Noise Filtering: Two Missing Primitives of Softmax Attentioncited by 0
- 2026AI as a Compiler: Compiling Triton kernels without the Triton compilercited by 0
- 2026How Local Mixing Encodes Relative Position in Global NoPE Attentioncited by 0
- 2026Switching Linear Attentioncited by 0
- 2026A Self-Pruning Transformer: Extreme KV-Cache Compression with Universal Attentioncited by 0
- 2026Mechanics of Long-Context Hybrid Models Part 1.1: From Hybrid Attention to Hybrid Positioncited by 0
- 2026Mechanics of Long-Context Hybrid Models Part 1.1: From Hybrid Attention to Hybrid Position7 Oct 2026
- 2026A Self-Pruning Transformer: Extreme KV-Cache Compression with Universal Attention6 Oct 2026
- 2026Switching Linear Attention30 Sep 2026
- 2026How Local Mixing Encodes Relative Position in Global NoPE Attention29 Sep 2026
- 2026AI as a Compiler: Compiling Triton kernels without the Triton compiler29 Sep 2026
- 2026Abstention and Noise Filtering: Two Missing Primitives of Softmax Attention18 Sep 2026
- 2026Kalman Delta Networks: Uncertainty-aware Associative Memory7 Sep 2026
- 2026Beyond Static and Linear: What Attention Constraints Best Fit Human Reading Times?24 Aug 2026
- 2026Caching for the Future: Scrub Jay Episodic Memory Principles for Agent Memory Systems5 Aug 2026
- 2026Raven: High-Recall Sequence Modeling with Sparse Memory Routing28 Jul 2026
- 2026Spectral Origins of the Self-Correction Blind Spot in Autoregressive Generation9 Jul 2026
- 2026Why Do Accumulated Transformations Extrapolate?23 Jun 2026
38 more
- 2026Spatial Priors via Space Filling Curves for Small and Limited Data Vision Transformers8 Jun 2026
- 2026Forget Attention: Importance-Aware Attention Is All You Need1 Jun 2026
- 2026Gated Graph Attention Networks with Learnable Temperature28 May 2026
- 2026Agentic Discovery of Neural Architectures: AIRA-Compose and AIRA-Design15 May 2026
- 2026Remember to Forget: Gated Adaptive Positional Encoding11 May 2026
- 2026Kaczmarz Linear Attention9 May 2026
- 2026The Topological Trouble With Transformers18 Apr 2026
- 2026Screening Is Enough1 Apr 2026
- 20262Mamba2Furious: Linear in Complexity, Competitive in Accuracy19 Feb 2026
- 2026LINA: Linear Autoregressive Image Generative Models with Continuous Tokens30 Jan 2026
- 2025RePo: Language Models with Context Re-Positioning16 Dec 2025
- 2025Group Representational Position Encoding8 Dec 2025
- 2025Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMs8 Dec 2025
- 2025Cache What Lasts: Token Retention for Memory-Bounded KV Cache in LLMs3 Dec 2025
- 2025Distributed Dynamic Associative Memory via Online Convex Optimization28 Nov 2025
- 2025Selective Rotary Position Embedding21 Nov 2025
- 2025Kimi Linear: An Expressive, Efficient Attention Architecture30 Oct 2025
- 2025Design Principles for Sequence Models via Coefficient Dynamics10 Oct 2025
- 2025Local Linear Attention: An Optimal Interpolation of Linear and Softmax Attention For Test-Time Regression1 Oct 2025
- 2025An empirical study on the limitation of Transformers in program trace generation29 Sep 2025
- 2025Distributed Associative Memory via Online Convex Optimization26 Sep 2025
- 2025On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspective31 Jul 2025
- 2025Differential Mamba8 Jul 2025
- 2025Scaling Context Requires Rethinking Attention6 Jul 2025
- 2025Learning to Skip the Middle Layers of Transformers26 Jun 2025
- 2025MesaNet: Sequence Modeling by Locally Optimal Test-Time Training5 Jun 2025
- 2025Log-Linear Attention5 Jun 2025
- 2025Comba: Improving Bilinear RNNs with Closed-loop Control3 Jun 2025
- 2025Test-Time Training Done Right29 May 2025
- 2025StateSpaceDiffuser: Bringing Long Context to Diffusion World Models28 May 2025
- 2025Understanding Transformer from the Perspective of Associative Memory26 May 2025
- 2025Amplify Adjacent Token Differences: Enhancing Long Chain-of-Thought Reasoning with Shift-FFN22 May 2025
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformations22 May 2025
- 2025Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free10 May 2025
- 2025Event2Vec: Processing Neuromorphic Events Directly by Representations in Vector Space21 Apr 2025
- 2025Adaptive Computation Pruning for the Forgetting Transformer9 Apr 2025
- 2025Lattice: Learning to Efficiently Compress the Memory8 Apr 2025
- 2025TRA: Better Length Generalisation with Threshold Relative Attention29 Mar 2025
- 2025Differential Mambacited by 2
- 20262Mamba2Furious: Linear in Complexity, Competitive in Accuracycited by 1
- 20262Mamba2Furious: Linear in Complexity, Competitive in Accuracy19 Feb 2026
- 2025Differential Mamba8 Jul 2025
- 2025Test-Time Training Done Rightcited by 121
- 2025Test-Time Training Done Right29 May 2025
- 2025Kimi Linear: An Expressive, Efficient Attention Architecturecited by 169
- 2025Log-Linear Attentioncited by 39
- 2025MesaNet: Sequence Modeling by Locally Optimal Test-Time Trainingcited by 37
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 32
- 2025Understanding Transformer from the Perspective of Associative Memorycited by 31
- 2025Lattice: Learning to Efficiently Compress the Memorycited by 18
- 2025Comba: Improving Bilinear RNNs with Closed-loop Controlcited by 12
- 2025Selective Rotary Position Embeddingcited by 8
- 2025Adaptive Computation Pruning for the Forgetting Transformercited by 6
- 2025On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspectivecited by 6
- 2025Group Representational Position Encodingcited by 5
- 2025Local Linear Attention: An Optimal Interpolation of Linear and Softmax Attention For Test-Time Regressioncited by 4
12 most cited of 39 All 39 (JSON)
- 2026Mechanics of Long-Context Hybrid Models Part 1.1: From Hybrid Attention to Hybrid Position7 Oct 2026
- 2026Switching Linear Attention30 Sep 2026
- 2026How Local Mixing Encodes Relative Position in Global NoPE Attention29 Sep 2026
- 2026AI as a Compiler: Compiling Triton kernels without the Triton compiler29 Sep 2026
- 2026Abstention and Noise Filtering: Two Missing Primitives of Softmax Attention18 Sep 2026
- 2026Kalman Delta Networks: Uncertainty-aware Associative Memory7 Sep 2026
- 2026Beyond Static and Linear: What Attention Constraints Best Fit Human Reading Times?24 Aug 2026
- 2026Raven: High-Recall Sequence Modeling with Sparse Memory Routing28 Jul 2026
- 2026Spectral Origins of the Self-Correction Blind Spot in Autoregressive Generation9 Jul 2026
- 2026Why Do Accumulated Transformations Extrapolate?23 Jun 2026
- 2026Spatial Priors via Space Filling Curves for Small and Limited Data Vision Transformers8 Jun 2026
- 2026Forget Attention: Importance-Aware Attention Is All You Need1 Jun 2026
12 newest of 39 All 39 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2026Adaptive Memory Decay for Log-Linear Attention
- 2026Blurry Window Attention
- 2025GatedFWA: Linear Flash Windowed Attention with Gated Associative Memory
- 2025Trellis: Learning to Compress Key-Value Memory in Attention Models
- 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- 2024RecurFormer: Not All Transformer Heads Need Self-Attention
- 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformer
- 2025It's All Connected: A Journey Through Test-Time Memorization, Attentional Bias, Retention, and Online Optimization