Preprint
Computer Vision

Multi-Turn On-Policy Distillation with Prefix Replay

Baohao Liao, Hanze Dong, Christof Monz, Xinxing Xu, Li Dong, Furu Wei
July 16, 2026

0

Citations

0

Influential Citations

Venue

2026

Year

Abstract

We study on-policy distillation (OPD) for agentic tasks, where an LLM agent interacts with an environment over multiple turns and a student imitates a teacher over these multi-turn interaction histories. Fully online OPD is costly because each update requires fresh student rollouts through the environment and teacher queries at visited histories. We propose Replayed-Prefix On-Policy Distillation (ReOPD), an off-environment alternative that reuses pre-collected teacher trajectories as replayed prefixes: the student acts at selected steps, while the teacher provides dense per-step supervision without executing new environment interactions. We show that multi-turn OPD introduces a prefix trap: making histories more student-on-policy improves relevance to the student, but can query the teacher on histories where its target is unreliable. This creates a two-sided distribution shift between student occupancy and teacher reliability. ReOPD addresses this by treating multi-turn OPD as a reliability-aware prefix distribution design and implements it with a simple step-decaying sampling schedule that emphasizes early, lower-shift prefixes. Across mathematical reasoning with Python and search environments over multiple teacher and student model scales, ReOPD preserves or improves OPD-level accuracy, uses zero tool calls during student training, and is at least 4times faster per rollout than OPD. ReOPD therefore turns expensive agent-environment interaction into a reusable offline resource, enabling scalable distillation across tools, tasks, and environments.

Analysis

Why This Paper Matters

This paper addresses a critical bottleneck in training LLM agents for multi-turn tasks: the prohibitive cost of on-policy distillation (OPD). In agentic settings, each update requires fresh student rollouts through the environment and teacher queries at visited histories, making OPD expensive and difficult to scale. The authors identify a fundamental trade-off—the 'prefix trap'—where making histories more student-on-policy improves relevance but can query the teacher on unreliable targets. This insight is crucial for practitioners building interactive AI systems, as it highlights the need for reliability-aware sampling strategies.

By proposing ReOPD, the paper offers a practical solution that reuses pre-collected teacher trajectories as replayed prefixes, eliminating the need for environment interactions during student training. This turns a costly online process into an efficient offline resource, which is especially valuable for tasks like mathematical reasoning and search where environment interactions are expensive or slow. The work is timely given the growing interest in agentic AI and the need for scalable training methods.

Technical Contributions

  • Prefix Trap Identification: Formalizes the two-sided distribution shift between student occupancy and teacher reliability in multi-turn OPD, showing that naive on-policy sampling can degrade teacher supervision quality.
  • ReOPD Framework: Introduces an off-environment alternative that reuses teacher trajectories as replayed prefixes, with the student acting only at selected steps and the teacher providing dense per-step supervision without new environment interactions.
  • Step-Decaying Sampling Schedule: A simple yet effective schedule that emphasizes early prefixes (where distribution shift is lower) and decays the probability of sampling later prefixes, balancing relevance and reliability.
  • Zero Tool Calls: During student training, ReOPD requires no tool calls (environment interactions), significantly reducing computational overhead.

Results

The paper reports that ReOPD preserves or improves OPD-level accuracy across mathematical reasoning with Python and search environments, tested with multiple teacher and student model scales. Key metrics include: at least 4x faster per rollout compared to fully online OPD, and zero tool calls during student training. The method is evaluated on both small and large models, demonstrating robustness across scales. While exact accuracy numbers are not provided in the abstract, the claim of preserved or improved accuracy suggests competitive performance with substantial efficiency gains.

Significance

ReOPD has broad implications for the AI field, particularly for training LLM agents in interactive environments. By making distillation scalable and cost-effective, it enables practitioners to train agents on a wider range of tasks without the overhead of live environment interactions. This could accelerate progress in areas like tool use, web navigation, and multi-step reasoning. The approach also opens the door to reusing offline datasets for agent training, similar to how offline RL has impacted reinforcement learning. For Neura Market's audience, this paper provides a concrete method to reduce training costs while maintaining performance, making it a valuable addition to the toolkit for building production-ready AI agents.