SFT-as-Context Mitigates Forgetting in Supervised Fine-Tuning
Kenan Tang, Andong Hua, Chengxuan Qian, Saket Tiwari, Yao Qin
Abstract
Supervised fine-tuning (SFT) equips large language models (LLMs) with specialized capabilities, but often comes at the cost of forgetting the general capabilities of their parent models (i.e., the pretrained models before fine-tuning). This trade-off is especially limiting for queries that require both specialized and general capabilities. We introduce SFT-as-context, a training-free method in which the parent model uses the SFT model's response as context to answer the query. This allows the parent model to acquire fine-tuned capabilities from the SFT response through in-context learning while preserving its own general capabilities. Across 19 parent-SFT model pairs and 11 benchmarks, SFT-as-context remains close to the SFT models on fine-tuned capabilities, with gaps of only 2.2 and 2.1 percentage points on AIME 2024 and LiveCodeBench and 2.0 macro MAE on NutriBench-English, while staying within 2.2 percentage points of the parent models on general capabilities on average. Remarkably, it can solve queries requiring both fine-tuned and general capabilities, even when neither the parent nor SFT model succeeds alone. This approach also extends beyond parent-SFT pairs: responses from a small open-source SFT model can improve a strong closed-source LLM, outperforming either model alone. Furthermore, we use a Bayesian framework to derive theoretical guarantees that bound the error of SFT-as-context relative to the SFT model on fine-tuned capabilities and to the parent model on general capabilities. In addition, we visualize the attention weights and find that the parent model attends more to useful SFT responses and less to irrelevant ones, suggesting that selective attention helps the parent model use the SFT response through in-context learning.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI, cs.LG
- Comments
- 37 pages
Related papers
Fine-Tuning Without Gradients? Closed-Form, LLM-Written Classifiers on a Frozen Encoder
Shared title terminologycs.CLMd Nasir Uddin, Musa Tur Farazi, Soumik Bhattacharjee et al.
SkillCore: Internalizing Generalizable Skills via Scaffolding-Removed Fine-Tuning
Shared title terminologycs.CLYi Liu, Changqing Ai, Peijie Dong et al.
Select or Rewrite: Oracle-Guided Fine-Tuning for Generative ASR Post-Editing from N-Best Hypotheses
Shared title terminologycs.CLShiran Liu, Gaohui Xu, Sergio Burdisso et al.
Is a 9B Decision Foundation Model Needed for Symptom-to-Disease Classification? Fine-Tuning Clef-Flash Against TF-IDF Baselines
Shared title terminologycs.CLS. M. Mahbub Uddin Ahmed
Grammar Concept Annotation at Scale: Deployed Fine-Tuned Small Language Models Outperform Prompted Frontier Models
Shared title terminologycs.CLMarjan Celikik, Ana Peleteiro Ramallo, Javier Morales
Stable Gated DeltaNet-2: Understanding and Mitigating Recurrent State Instability
Shared title terminologycs.CLXichong Zhang, Xixuan Hao, Zhichen Liu et al.