Context distillation enables language models to internalize in-context knowledge into their parameters. In our work, we propose On-Policy Context Distillation (OPCD), a framework that bridges on-policy distillation with context distillation by training a student model on its own generated trajectories while minimizing reverse Kullback-Leibler divergence against a context-conditioned teacher. We demonstrate the effectiveness of OPCD on two important applications: experiential knowledge distillation, where models extract and consolidate transferable knowledge from their historical solution traces, and system prompt distillation, where models internalize beneficial behaviors encoded in optimized prompts. Across mathematical reasoning, text-based games, and domain-specific tasks, OPCD consistently outperforms baseline methods, achieving higher task accuracy while better preserving out-of-distribution capabilities. We further show that OPCD enables effective cross-size distillation, where smaller student models can internalize experiential knowledge from larger teachers.


翻译:上下文蒸馏使语言模型能够将上下文知识内化至其参数中。在本工作中,我们提出了基于策略的上下文蒸馏(OPCD),该框架通过策略蒸馏与上下文蒸馏的融合,在最小化与上下文条件教师模型的反向Kullback-Leibler散度的同时,利用学生模型自身生成的轨迹对其进行训练。我们展示了OPCD在两个重要应用中的有效性:经验知识蒸馏——模型从其历史求解轨迹中提取并整合可迁移知识;以及系统提示蒸馏——模型将编码在优化提示中的有益行为内化。在数学推理、文本游戏和特定领域任务中,OPCD始终优于基线方法,在实现更高任务准确率的同时,更好地保持了分布外泛化能力。我们进一步证明,OPCD能够实现有效的跨规模蒸馏,使较小的学生模型能够内化来自较大教师模型的经验知识。

0
下载
关闭预览

相关内容

【博士论文】基于多模态基础模型的上下文学习
专知会员服务
22+阅读 · 2025年12月17日
130页pdf《长上下文语言建模综合研究》综述
专知会员服务
39+阅读 · 2025年3月25日
大型语言模型的高效提示方法综述
专知会员服务
75+阅读 · 2024年4月2日
模型压缩 | 知识蒸馏经典解读
AINLP
11+阅读 · 2020年5月31日
AI新视野 | 数据蒸馏Dataset Distillation
人工智能前沿讲习班
31+阅读 · 2019年6月14日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员