Long-Short Alignment for Effective Long-Context Modeling in LLMs
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have exhibited impressive performance and surprising emergent properties. However, their effectiveness remains limited by the fixed context window of the transformer architecture, posing challenges for long-context modeling. Among these challenges, length generalization -- the ability to generalize to sequences longer than those seen during training -- is a classical and fundamental problem. In this work, we propose a fresh perspective on length generalization, shifting the focus from the conventional emphasis on input features such as positional encodings or data structures to the output distribution of the model. Specifically, through case studies on synthetic tasks, we highlight the critical role of long-short alignment -- the consistency of output distributions across sequences of varying lengths. Extending this insight to natural language tasks, we propose a metric called Long-Short Misalignment to quantify this phenomenon, uncovering a strong correlation between the metric and length generalization performance. Building on these findings, we develop a regularization term that promotes long-short alignment during training. Extensive experiments validate the effectiveness of our approach, offering new insights for achieving more effective long-context modeling in LLMs. Code is available at https://github.com/PKU-ML/LongShortAlignment.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 41 of its 46 references that are in the map. First posted on arXiv 13 Jun 2025.
Builds on
41 of 46 references.
References · 41
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,418
- 2023Qwen Technical Reportcited by 3,344
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 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
29 more
- 2019Compressive Transformers for Long-Range Sequence Modellingcited by 726
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
- 2022Towards Reasoning in Large Language Models: A Surveycited by 596
- 2019Symmetric Cross Entropy for Robust Learning with Noisy Labelscited by 500
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
- 2024Long-context LLMs Struggle with Long In-context Learningcited by 286
- 2022Transformers Learn Shortcuts to Automatacited by 268
- 2022Neural Networks and the Chomsky Hierarchycited by 217
- 2024BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystackcited by 215
- 2022Exploring Length Generalization in Large Language Modelscited by 206
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 199
- 2025When More is Less: Understanding Chain-of-Thought Length in LLMscited by 183
- 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 139
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 136
- 2022A Length-Extrapolatable Transformercited by 127
- 2023Teaching Arithmetic to Small Transformerscited by 123
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 117
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 98
- 2021Neural Algorithmic Reasoningcited by 94
- 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 86
- 2021Making Transformers Solve Compositional Taskscited by 72
- 2024What is Wrong with Perplexity for Long-context Language Modeling?cited by 69
- 2023Length Generalization in Arithmetic Transformerscited by 66
- 2023CLEX: Continuous Length Extrapolation for Large Language Modelscited by 44
- 2024A Theoretical Understanding of Self-Correction through In-context Alignmentcited by 44
- 2022Dissecting Transformer Length Extrapolation via the Lens of Receptive Field Analysiscited by 42
- 2024Resonance RoPE: Improving Context Length Generalization of Large Language Modelscited by 27
- 2024Extending LLMs' Context Window with 100 Samplescited by 21
- 2024Look Ahead or Look Around? A Theoretical Comparison Between Autoregressive and Masked Pretrainingcited by 7
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2025Language Ranker: A Lightweight Ranking framework for LLM Decodingcited by 2
- 2026Exploration of Fast-Slow Latent Recurrence for Train-Short, Test-Long Generalizationcited by 2
- 2026S3-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inferencecited by 1
- 2026Length Generalization Needs Proper Regularizationcited by 0
- 2026Length Generalization Needs Proper Regularization3 Oct 2026
- 2026Exploration of Fast-Slow Latent Recurrence for Train-Short, Test-Long Generalization2 Apr 2026
- 2026S3-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inference25 Jan 2026
- 2025Language Ranker: A Lightweight Ranking framework for LLM Decoding23 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2024LongAlign: A Recipe for Long Context Alignment of Large Language Models
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models
- 2025Beyond Single-Task: Robust Multi-Task Length Generalization for LLMs
- 2024Efficient Alignment of Large Language Models via Data Sampling
- 2024Long Context Alignment with Short Instructions and Synthesized Positions
- 2025From 128K to 4M: Efficient Training of Ultra-Long Context Large Language Models
- 2023A Comprehensive Overview of Large Language Models
- 2025LongPO: Long Context Self-Evolution of Large Language Models through Short-to-Long Preference Optimization