mlsanityData to 14 Oct 2026

Remember to Forget: Gated Adaptive Positional Encoding

arXiv 2605.10414 ↗First posted 11 May 2026cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

Rotary Positional Encoding (RoPE) is widely used in modern large language models. However, when sequences are extended beyond the range seen during training, rotary phases can enter out-of-distribution regimes, leading to spurious long-range alignments, diffuse attention, and degraded retrieval. Existing remedies only partially address these failures, as they often trade local positional resolution for long-context stability. We propose GAPE (Gated Adaptive Positional Encoding), a drop-in augmentation for positional encodings that introduces a content-aware bias directly into the attention logits while preserving the rotary geometry. GAPE decouples distance-based suppression from token importance through a query-dependent gate that contracts irrelevant context and a key-dependent gate that preserves salient distant tokens. We show that weakly protected distant context is exponentially attenuated as a function of the query gate, while selected keys can remain accessible through landmark protection. We further show that GAPE can be implemented within standard scaled dot-product attention. Empirically, GAPE improves long-context robustness across controlled retrieval and language-modeling experiments, extrapolating up to 8x the training length. We further retrofit GAPE into a pretrained 7B model, maintaining performance on standard benchmarks and improving performance at the longest evaluated context. These results support adaptive context suppression as a complement to positional representation for long-context generalization.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 24 of its 29 references that are in the map. First posted on arXiv 11 May 2026.

Builds on

24 of 29 references.

References · 24

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2024The Llama 3 Herd of Modelscited by 14,715
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  5. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  6. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  7. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  8. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  9. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  10. 2024The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scalecited by 1,160
  11. 2018Self-Attention with Relative Position Representationscited by 1,120
  12. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
12 more
  1. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
  2. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
  3. 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 519
  4. 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 313
  5. 2023Scaling Laws of RoPE-based Extrapolationcited by 125
  6. 2024Round and Round We Go! What makes Rotary Positional Encodings useful?cited by 115
  7. 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 86
  8. 2026FlashAttention-4: Algorithm and Kernel Pipelining Co-Design for Asymmetric Hardware Scalingcited by 66
  9. 2025Forgetting Transformer: Softmax Attention with a Forget Gatecited by 53
  10. 2024Base of RoPE Bounds Context Lengthcited by 52
  11. 2024Softmax is not Enough (for Sharp Size Generalisation)cited by 46
  12. 2026Frayed RoPE and Long Inputs: A Geometric Perspectivecited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.