mlsanityData to 14 Oct 2026

TRA: Better Length Generalisation with Threshold Relative Attention

arXiv 2503.23174 ↗First posted 29 Mar 2025cs.LG cs.CLcited by 1

Not on the map. Why?

Abstract (arXiv)

Transformers struggle with length generalisation, displaying poor performance even on basic tasks. We test whether these limitations can be explained through two key failures of the self-attention mechanism. The first is the inability to fully remove irrelevant information. The second is tied to position, even if the dot product between a key and query is highly negative (i.e. an irrelevant key) learned positional biases may unintentionally up-weight such information - dangerous when distances become out of distribution. Put together, these two failure cases lead to compounding generalisation difficulties. We test whether they can be mitigated through the combination of a) selective sparsity - completely removing irrelevant keys from the attention softmax and b) contextualised relative distance - distance is only considered as between the query and the keys that matter. We show how refactoring the attention mechanism with these two mitigations in place can substantially improve the generalisation capabilities of decoder only transformers.

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

Builds on

53 of 59 references.

References · 53

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  4. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  5. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
  6. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  7. 2016Pointer Sentinel Mixture Modelscited by 3,096
  8. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  9. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,592
  10. 2022Survey of Hallucination in Natural Language Generationcited by 2,075
  11. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  12. 2020GLU Variants Improve Transformercited by 1,804
38 more
  1. 2020Big Bird: Transformers for Longer Sequencescited by 1,684
  2. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  3. 2019Root Mean Square Layer Normalizationcited by 1,480
  4. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  5. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
  6. 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,026
  7. 2024GSM-Symbolic: Understanding the Limitations of Mathematical Reasoning in Large Language Modelscited by 550
  8. 2023Resurrecting Recurrent Neural Networks for Long Sequencescited by 408
  9. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
  10. 2022Transformers Learn Shortcuts to Automatacited by 268
  11. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 199
  12. 2024The Illusion of State in State-Space Modelscited by 187
  13. 2021Thinking Like Transformerscited by 184
  14. 2019Sparse Sequence-to-Sequence Modelscited by 170
  15. 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 139
  16. 2019Well-Read Students Learn Better: On the Importance of Pre-training Compact Modelscited by 120
  17. 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 117
  18. 2024Round and Round We Go! What makes Rotary Positional Encodings useful?cited by 115
  19. 2021Long-Short Transformer: Efficient Transformers for Language and Visioncited by 102
  20. 2022State-of-the-art generalisation research in NLP: A taxonomy and reviewcited by 98
  21. 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 75
  22. 2021The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalizationcited by 62
  23. 2022Looking for a Needle in a Haystack: A Comprehensive Study of Hallucinations in Neural Machine Translationcited by 61
  24. 2017Neural Language Modeling by Jointly Learning Syntax and Lexiconcited by 57
  25. 2024Contextual Position Encoding: Learning to Count What's Importantcited by 54
  26. 2025Forgetting Transformer: Softmax Attention with a Forget Gatecited by 53
  27. 2021Sparse Attention with Linear Unitscited by 41
  28. 2019Location Attention for Extrapolation to Longer Sequencescited by 33
  29. 2023Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patternscited by 17
  30. 2021Modeling Hierarchical Structures with Continuous Recursive Neural Networkscited by 15
  31. 2024A Survey on Compositional Learning of AI Models: Theoretical and Experimental Practicescited by 15
  32. 2024Linear Recency Bias During Training Improves Transformers' Fit to Reading Timescited by 14
  33. 2024Your Context Is Not an Array: Unveiling Random Access Limitations in Transformerscited by 11
  34. 2020Addressing Some Limitations of Transformers with Feedback Memorycited by 9
  35. 2023Monotonic Location Attention for Length Generalizationcited by 9
  36. 2024Mechanisms of Symbol Processing for In-Context Learning in Transformer Networkscited by 6
  37. 2023On the effect of curriculum learning with developmental data for grammar acquisitioncited by 5
  38. 2024Compositional Generalization Across Distributional Shifts with Sparse Tree Operationscited by 5

50 most cited of 53 All 53 (JSON)

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.