On the Measurement and Efficient Mitigation of Length Generalization Gaps in Large Language Models
Jiaqi WANG, Binghui Xie, Dongchi Huang, Ming Hu, Qiguang Chen, Feilong Tang, Junjun He, James Cheng
ICLR 2026 submission
Abstract. Large Language Models (LLMs) typically train on short text due to the quadratic complexity of their self-attention architectures. As a result, their performance suffers drastically on inputs longer than those encountered during training, substantially limiting their applications in real-world tasks involving long contexts. In this paper, we rigorously establish an upper bound on length generalization in the measurement space and identify two length-related factors that limit performance. Our theory explains two recent observations: (i) out-of-distribution positions in longer contexts reduce length generalization, and (ii) fine-tuning on entire sequences is not necessary. Motivated by these insights, we propose Virtual-context Learning (VCL), a flexible method that requires minimal modifications to most fine-tuning approaches. Experiments on various tasks show that VCL allows LLMs to generalize to 4 context windows while retaining perplexity and improving performance on downstream tasks such as Passkey Retrieval and LongBench. VCL brings substantial efficiency improvements, reducing decoding time and memory usage by up to 50% compared with fine-tuning baselines.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperadd · history
Loading the discussion…