1Microsoft Research 2University of Amsterdam
*Equal contribution †Work done during an internship at Microsoft
On-policy distillation (OPD) for agentic tasks is costly: every update rolls the student through a live environment and queries the teacher at each visited history. We propose Replayed-Prefix On-Policy Distillation (ReOPD), an off-environment alternative that replays pre-collected teacher trajectories as prefixes: the student acts at selected steps and receives dense per-step teacher supervision, with no new environment interaction. Multi-turn OPD faces a prefix trap — a two-sided shift between student occupancy and teacher reliability — which ReOPD resolves with a step-decaying sampling schedule that favors early, lower-shift prefixes. Across math (Python-tool) and search environments and multiple model scales, ReOPD preserves or improves OPD-level accuracy with zero tool calls during training and at least 4× faster rollouts, turning expensive agent-environment interaction into a reusable offline resource.
On-policy distillation for agents without the environment: replay teacher prefixes instead of live rollouts.
Online OPD (top) keeps the environment alive during the whole training run: every update re-rolls the student through the environment and queries the teacher at each visited history. ReOPD (bottom) replays a teacher-forced prefix from an offline trajectory pool — collected for free while the teacher is trained with RL — and lets the student act only at the supervised step, where the teacher's per-token conditional is the distillation target. No action is ever executed against the environment.
Removing the environment does not remove the temporal structure of multi-turn learning. We identify a prefix trap with a two-sided distribution shift: fully student-on-policy prefixes are relevant to the student but can query the teacher where it is unreliable, while teacher-forced prefixes are reliable but less relevant. ReOPD balances the two with a reliability-aware step-decay schedule: supervised positions are sampled with probability pt ∝ κt (κ = 0.6), concentrating supervision on early, low-shift prefixes. The decay is applied purely at data-processing time, so the training loss itself stays unchanged.
The results confirm the two regimes predicted by our analysis: ReOPD yields its largest gains when the teacher–student gap is wide (math, e.g. AIME24 28.3 → 36.7 under the Qwen3-8B teacher) and essentially matches student-on-policy OPD when the teacher stays reliable on student-induced histories (search). A single fixed κ = 0.6 obtains the regime-appropriate behavior across tasks.
Unlike OPD, which must execute fresh environment rollouts and tool calls during every student update, ReOPD replays teacher-recorded prefixes and therefore uses zero tool calls during student training and is at least 4× faster per rollout (4.2× on math, 9.1× on search; see the teaser figure above). The environment infrastructure disappears entirely from the training loop: OPD needs a 32-process sandbox concurrency for math and an 80 GB-GPU retrieval server for search, while ReOPD needs neither — and the gap only grows as more environments are added. Training completes within 3 hours on 8×H100.
@misc{liao2026reopd,
title={Multi-Turn On-Policy Distillation with Prefix Replay},
author={Baohao Liao and Hanze Dong and Christof Monz and Xinxing Xu and Li Dong and Furu Wei},
year={2026},
eprint={2607.04763},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2607.04763},
}