When Long Helps Short: How Context Length in Supervised Fine-tuning Affects Behavior of Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have achieved impressive performance across natural language processing (NLP) tasks. As real-world applications increasingly demand longer context windows, continued pretraining and supervised fine-tuning (SFT) on long-context data has become a common approach. While the effects of data length in continued pretraining have been extensively studied, their implications for SFT remain unclear. In this work, we systematically investigate how SFT data length influences LLM behavior on short-context tasks. Counterintuitively, we find that long-context SFT improves short-context performance, contrary to the commonly observed degradation from long-context pretraining. To uncover the underlying mechanisms of this phenomenon, we first decouple and analyze two key components, Multi-Head Attention (MHA) and Feed-Forward Network (FFN), and show that both independently benefit from long-context SFT. We further study their interaction and reveal a knowledge preference bias: long-context SFT promotes contextual knowledge, while short-context SFT favors parametric knowledge, making exclusive reliance on long-context SFT suboptimal. Finally, we demonstrate that hybrid training mitigates this bias, offering explainable guidance for fine-tuning LLMs.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 35 of its 43 references that are in the map. First posted on arXiv 23 Sep 2025.
Builds on
35 of 43 references.
References · 35
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,164
- 2022Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Themcited by 1,807
23 more
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2019PubMedQA: A Dataset for Biomedical Research Question Answeringcited by 1,288
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 1,003
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 992
- 2023Enhancing Chat Language Models by Scaling High-quality Instructional Conversationscited by 839
- 2019Attention is not not Explanationcited by 636
- 2020Transformer Interpretability Beyond Attention Visualizationcited by 627
- 2017The NarrativeQA Reading Comprehension Challengecited by 597
- 2021QMSum: A New Benchmark for Query-based Multi-domain Meeting Summarizationcited by 365
- 2024Knowledge Conflicts for LLMs: A Surveycited by 283
- 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 232
- 2023Localizing Model Behavior with Path Patchingcited by 195
- 2024Data Engineering for Scaling Language Models to 128K Contextcited by 186
- 2024How to Train Long-Context Language Models (Effectively)cited by 146
- 2023Focused Transformer: Contrastive Training for Context Scalingcited by 133
- 2020Self-Attention Attribution: Interpreting Information Interactions Inside Transformercited by 125
- 2020BERT-of-Theseus: Compressing BERT by Progressive Module Replacingcited by 113
- 2024Cutting Off the Head Ends the Conflict: A Mechanism for Interpreting and Mitigating Knowledge Conflicts in Language Modelscited by 91
- 2024Knowledge Circuits in Pretrained Transformerscited by 60
- 2024ChatQA 2: Bridging the Gap to Proprietary LLMs in Long Context and RAG Capabilitiescited by 53
- 2025Massive Values in Self-Attention Modules are the Key to Contextual Knowledge Understandingcited by 47
- 2024Differentiation and Specialization of Attention Heads via the Refined Local Learning Coefficientcited by 40
- 2024From Artificial Needles to Real Haystacks: Improving Retrieval Capabilities in LLMs by Finetuning on Synthetic Datacited by 18
Built on by
Citing papers per year: 2025: 1.
1 paper.