On-Policy Context Distillation for Language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Ye, Tianzhu, Dong, Li, Wu, Xun, Huang, Shaohan, Wei, Furu
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866910064676175872
author Ye, Tianzhu
Dong, Li
Wu, Xun
Huang, Shaohan
Wei, Furu
author_facet Ye, Tianzhu
Dong, Li
Wu, Xun
Huang, Shaohan
Wei, Furu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2602_12275
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle On-Policy Context Distillation for Language Models
Ye, Tianzhu
Dong, Li
Wu, Xun
Huang, Shaohan
Wei, Furu
Computation and Language
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.
title On-Policy Context Distillation for Language Models
topic Computation and Language
url https://arxiv.org/abs/2602.12275