mlsanityData to 7 Oct 2026

Beyond Single-Task: Robust Multi-Task Length Generalization for LLMs

arXiv 2502.11525 ↗First posted 17 Feb 2025cs.CLcited by 7

Not on the map. Why?

Abstract (arXiv)

Length generalization, the ability to solve problems longer than those seen during training, remains a critical challenge for large language models (LLMs). Previous work modifies positional encodings (PEs) and data formats to improve length generalization on specific symbolic tasks such as addition and sorting. However, these approaches are fundamentally limited to special tasks, often degrading general language performance. Furthermore, they are typically evaluated on small transformers trained from scratch on single tasks and can cause performance drop when applied during post-training stage of practical LLMs with general capabilities. Hu et al., (2024) proposed Rule-Following Fine-Tuning (RFFT) to improve length generalization in the post-training stage of LLMs. Despite its compatibility with practical models and strong performance, RFFT is proposed for single tasks too, requiring re-training for each individual task with extensive examples. In this paper, we study length generalization in multi-task settings and propose Meta Rule-Following Fine-Tuning (Meta-RFFT), the first framework enabling robust cross-task length generalization. As our first contribution, we construct a large length generalization dataset containing 86 tasks spanning code execution, number processing, symbolic and logical reasoning tasks, beyond the common addition or multiplication tasks. Secondly, we show that cross-task length generalization is possible with Meta-RFFT. After training on a large number of tasks and instances, the models achieve remarkable length generalization ability on unseen tasks with minimal fine-tuning or one-shot prompting. For example, after fine-tuning on 1 to 5 digit addition, our 32B model achieves 95% accuracy on 30 digit addition, significantly outperforming the state-of-the-art reasoning models (DeepSeek-R1-671B: 72%), despite never seeing this task during RF-pretraining.

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 41 of its 44 references that are in the map. First posted on arXiv 17 Feb 2025.

Builds on

41 of 44 references.

References · 41

  1. 2022Training language models to follow instructions with human feedbackcited by 15,712
  2. 2017Proximal Policy Optimization Algorithmscited by 14,441
  3. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  4. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
  5. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  6. 2022Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Themcited by 1,767
  7. 2023WizardLM: Empowering large pre-trained language models to follow complex instructionscited by 1,116
  8. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
  9. 2024Tulu 3: Pushing Frontiers in Open Language Model Post-Trainingcited by 988
  10. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 956
  11. 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
  12. 2022Super-NaturalInstructions: Generalization via Declarative Instructions on 1600+ NLP Taskscited by 858
29 more
  1. 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
  2. 2022PAL: Program-aided Language Modelscited by 635
  3. 2023Instruction Tuning for Large Language Models: A Surveycited by 617
  4. 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 599
  5. 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
  6. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  7. 2024PiSSA: Principal Singular Values and Singular Vectors Adaptation of Large Language Modelscited by 261
  8. 2023Reasoning or Reciting? Exploring the Capabilities and Limitations of Language Models Through Counterfactual Taskscited by 243
  9. 2022Towards Understanding Grokking: An Effective Theory of Representation Learningcited by 229
  10. 2022Exploring Length Generalization in Large Language Modelscited by 204
  11. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
  12. 2024SWE-bench Multimodal: Do AI Systems Generalize to Visual Software Domains?cited by 196
  13. 2021Counterfactual Memorization in Neural Language Modelscited by 155
  14. 2023The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networkscited by 153
  15. 2024Marco-o1: Towards Open Reasoning Models for Open-Ended Solutionscited by 142
  16. 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 136
  17. 2023Teaching Arithmetic to Small Transformerscited by 121
  18. 2023Chain of Code: Reasoning with a Language Model-Augmented Code Emulatorcited by 120
  19. 2024OpenR: An Open Source Framework for Advanced Reasoning with Large Language Modelscited by 92
  20. 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
  21. 2024Transformers Can Do Arithmetic with the Right Embeddingscited by 77
  22. 2024Self-play with Execution Feedback: Improving Instruction-following Capabilities of Large Language Modelscited by 73
  23. 2024Number Cookbook: Number Understanding of Language Models and How to Improve Itcited by 41
  24. 2024Case-Based or Rule-Based: How Do Transformers Do the Math?cited by 26
  25. 2024Universal Length Generalization with Turing Programscited by 25
  26. 2024Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structurecited by 22
  27. 2024Arithmetic Transformers Can Length-Generalize in Both Operand Length and Countcited by 18
  28. 2023Code Prompting: a Neural Symbolic Method for Complex Reasoning in Large Language Modelscited by 16
  29. 2023Improving Length-Generalization in Transformers via Task Hintingcited by 12

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 2; 2026: 5.

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Long-Short Alignment for Effective Long-Context Modeling in LLMs
  2. 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models
  3. 2025Generalizing From Short to Long: Effective Data Synthesis for Long-Context Instruction Tuning
  4. 2025LIFEBench: Evaluating Length Instruction Following in Large Language Models
  5. 2025The Unreasonable Effectiveness of Model Merging for Cross-Lingual Transfer in LLMs
  6. 2023Towards Better Parameter-Efficient Fine-Tuning for Large Language Models: A Position Paper
  7. 2025Massive Supervised Fine-tuning Experiments Reveal How Data, Layer, and Training Factors Shape LLM Alignment Quality
  8. 2024Mixing It Up: The Cocktail Effect of Multi-Task Fine-Tuning on LLM Performance -- A Case Study in Finance