SFT-as-Context Mitigates Forgetting in Supervised Fine-Tuning
作者: Kenan Tang, Andong Hua, Chengxuan Qian, Saket Tiwari, Yao Qin
分类: cs.CL, cs.AI, cs.LG
发布日期: 2026-10-08
备注: 37 pages
💡 一句话要点
提出SFT-as-context以缓解监督微调中的遗忘问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 监督微调 大型语言模型 上下文学习 贝叶斯框架 模型遗忘 自然语言处理 智能问答
📋 核心要点
- 现有的监督微调方法在提升特定任务能力的同时,往往导致模型遗忘其通用能力,限制了其应用场景。
- 本文提出SFT-as-context方法,通过将SFT模型的响应作为上下文,允许父模型在保持通用能力的同时,利用上下文学习获取微调能力。
- 实验结果表明,SFT-as-context在微调能力上与SFT模型相近,同时在通用能力上保持稳定,能够有效解决需要两种能力的查询。
📝 摘要(中文)
监督微调(SFT)为大型语言模型(LLMs)赋予了专业能力,但往往会导致其遗忘原有的通用能力。本文提出了一种训练无关的方法SFT-as-context,利用SFT模型的响应作为上下文,帮助父模型在回答查询时保留通用能力并获取微调能力。通过19对父模型和SFT模型的实验,SFT-as-context在微调能力上与SFT模型接近,同时在通用能力上保持相对稳定,能够解决需要两者能力的查询。此外,采用贝叶斯框架提供了理论保证,确保SFT-as-context在微调和通用能力上的表现。
🔬 方法详解
问题定义:本文旨在解决监督微调过程中模型遗忘通用能力的问题。现有方法在提升特定任务能力时,常常导致模型对一般性知识的遗忘,限制了其在复杂查询中的表现。
核心思路:SFT-as-context方法的核心在于利用SFT模型的输出作为上下文信息,帮助父模型在回答查询时同时保留其通用能力并获取微调能力。通过这种方式,父模型能够在不进行额外训练的情况下,利用上下文学习来提升其性能。
技术框架:该方法的整体架构包括父模型和SFT模型的交互,父模型在接收到查询时,结合SFT模型的响应进行推理。主要模块包括上下文生成、响应整合和推理过程。
关键创新:SFT-as-context的主要创新在于其训练无关的特性,允许父模型通过上下文学习而不需要重新训练,同时保持其原有的通用能力。这与传统的微调方法形成鲜明对比。
关键设计:在实现过程中,关键设计包括选择合适的上下文生成策略和响应整合机制,以确保父模型能够有效利用SFT模型的输出。此外,采用贝叶斯框架为模型的表现提供了理论保证,确保其在微调和通用能力上的平衡。
🖼️ 关键图片
📊 实验亮点
实验结果显示,SFT-as-context在微调能力上与SFT模型的差距仅为2.2和2.1个百分点,而在通用能力上与父模型的差距平均保持在2.2个百分点以内。此外,该方法能够成功解决需要同时具备微调和通用能力的查询,表现出显著的优势。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、对话系统和智能问答等场景。通过有效结合微调能力与通用能力,SFT-as-context能够提升模型在复杂任务中的表现,具有重要的实际价值和广泛的应用前景。
📄 摘要(原文)
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.