On-Policy Context Distillation for Language Models
AI 摘要
提出On-Policy上下文蒸馏(OPCD),通过在生成轨迹上训练学生模型来提取和整合上下文知识。
主要贡献
- 提出On-Policy上下文蒸馏框架OPCD
- OPCD在经验知识蒸馏和系统提示蒸馏上的有效性
- 证明OPCD在跨尺寸蒸馏中的有效性
方法论
OPCD训练学生模型在自身生成轨迹上最小化与上下文条件教师的反向KL散度,从而实现上下文知识的内化。
原文摘要
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.