Length Generalization Needs Proper Regularization
Not on the map. Why?
Abstract (arXiv)
Length generalization is the ability of sequential models to perform well on context lengths unseen during training. In this work, we show that the challenge of achieving length generalization is related not only to architectural choices such as positional encoding and the attention mechanism but also to the training procedure itself. We study how regularization affects length generalization and find that weight decay can hinder extrapolation. In contrast, dropout improves extrapolation when its placement within the architecture is reconsidered. In that regard, we show that the standard placement of dropout before layer normalization introduces a systematic distributional mismatch, and that applying dropout just before the linear projection resolves this issue. For example, a modified SmolLM3 with sliding window attention, continually pre-trained with dropout, can extrapolate perfectly to 64× on Needle-in-a-Haystack and far beyond the pre-training context size on RULER and HELMET. Mamba2 also benefits from dropout, suggesting an architecture-agnostic nature of the problem. We further propose Variance-Preserving Affine Dropout (VPAD), a new dropout strategy that substantially reduces the resulting pre-activation variance mismatch, leading to further extrapolation improvements in transformers.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 72 of its 83 references that are in the map. First posted on arXiv 3 Oct 2026.
Builds on
72 of 83 references.
References · 72
- 2017Attention Is All You Needcited by 60,361
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2025Qwen3 Technical Reportcited by 8,820
- 2016Layer Normalizationcited by 5,669
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2015Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classificationcited by 3,611
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2023Mistral 7Bcited by 3,164
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
38 more
- 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
- 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
- 2018Averaging Weights Leads to Wider Optima and Better Generalizationcited by 1,209
- 2018Self-Attention with Relative Position Representationscited by 1,120
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
- 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
- 2017Self-Normalizing Neural Networkscited by 598
- 2017Convolutional Sequence to Sequence Learningcited by 552
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
- 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 313
- 2023Effective Long-Context Scaling of Foundation Modelscited by 303
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
- 2022Exploring Length Generalization in Large Language Modelscited by 206
- 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 204
- 2024Data Engineering for Scaling Language Models to 128K Contextcited by 186
- 2024An Empirical Study of Mamba-based Language Modelscited by 186
- 2024How to Train Long-Context Language Models (Effectively)cited by 146
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 136
- 2022A Length-Extrapolatable Transformercited by 127
- 2023Scaling Laws of RoPE-based Extrapolationcited by 125
- 2023LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Modelscited by 124
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 117
- 2022Overcoming a Theoretical Limitation of Self-Attentioncited by 113
- 2023PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Trainingcited by 111
- 2013Dropout Training as Adaptive Regularizationcited by 93
- 2024Transformers need glasses! Information over-squashing in language taskscited by 91
- 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 86
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 86
- 2024TorchTitan: One-stop PyTorch native solution for production ready LLM pre-trainingcited by 85
- 2024Exponential Moving Average of Weights in Deep Learning: Dynamics and Benefitscited by 71
- 2024Why Does the Effective Context Length of LLMs Fall Short?cited by 63
- 2024Training-Free Long-Context Scaling of Large Language Modelscited by 62
- 2024Contextual Position Encoding: Learning to Count What's Importantcited by 54
- 2024Base of RoPE Bounds Context Lengthcited by 52
- 2024DeciMamba: Exploring the Length Extrapolation Potential of Mambacited by 49
50 most cited of 72 All 72 (JSON)
Built on by
Not cited yet.