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