paper-with-me

홈 › Papers

Forgetting Transformer: Softmax Attention with a Forget Gate

2025-03-03 · Zhixuan Lin, Evgenii Nikishin, Xu Owen He, Aaron 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 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.

📄 PDF Abstract BibTeX arXiv:2503.02130

Code (1)

zhixuan-lin/forgetting-transformer 공식 구현 pytorch

Tasks

Language ModelingLanguage ModellingMamba

Methods 이 논문이 사용한 방법론

Attention 설명 없음
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Residual Connection 설명 없음
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…

Similar Papers 제목 키워드 기반

Gated Slot Attention for Efficient Linear-Time Sequence Modeling

2024-09-11 · Yu Zhang, Songlin Yang, Ruijie Zhu, Yue Zhang 외

Linear attention Transformers and their gated variants, celebrated for enabling parallel training and efficient recurrent inference, still fall short in recall-intensive tasks compared to traditional Transformers and dem…

Selective Rotary Position Embedding

2025-11-21 · Sajad Movahedi, Timur Carstensen, Arshia Afzal, Frank Hutter 외 arxiv

Position information is essential for language modeling. In softmax transformers, Rotary Position Embeddings (\textit{RoPE}) encode positions through \textit{fixed-angle} rotations, while in linear transformers, order is…

Revisiting Softmax Masking: Stop Gradient for Enhancing Stability in Replay-based Continual Learning

2023-09-26 · Hoyong Kim, Minchan Kwon, Kangil Kim

In replay-based methods for continual learning, replaying input samples in episodic memory has shown its effectiveness in alleviating catastrophic forgetting. However, the potential key factor of cross-entropy loss with …

Continual LearningIncremental Learning

Elastic Weight Consolidation for Reduction of Catastrophic Forgetting in GPT-2

2022-01-16 · ACL ARR January 2022 1 · Anonymous

Neural networks are naturally prone to the effects of catastrophic forgetting during fine-tuning. Despite the extensive adoption of transformers, little research has been done to investigate the effects of catastrophic f…

Continual Learning for Seq2Seq Generations with Transformer Calibration

2022-01-16 · ACL ARR January 2022 1 · Anonymous

Conventional NLP generation models are trained offline with a given dataset for a particular task, which is referred to as isolated learning. Research on sequence-to-sequence language generation aims to study continual l…

Continual LearningLifelong learningParaphrase GenerationText Generation