TL;DR
Step-Level On-Policy Distillation (SOPD) bridges the gap between token-level On-Policy Distillation (OPD) and Supervised Fine-Tuning (SFT). By providing step-level teacher corrections on student-generated trajectories, it delivers coherent, long-horizon guidance while remaining faithfully on-policy, significantly boosting performance in reasoning and agent tasks.
What Problem Does This Paper Address?
Distilling knowledge from a large teacher LLM to a smaller student model typically follows one of two paradigms: off-policy Supervised Fine-Tuning (SFT) or On-Policy Distillation (OPD).
While SFT provides coherent, long-range targets, it suffers from a "train-test mismatch" because the student is trained purely on teacher-generated data and never learns how to recover from its own mistakes. OPD fixes this by querying the teacher on student-generated tokens. However, standard token-level OPD provides fragmented, token-by-token corrections. If a student makes a mistake, the teacher's next-token logit doesn't map out a complete, executable repair path; it merely tries to fix the very next token based on an already broken prefix.
The authors address this fragmentation by introducing a method that retains the state-distribution benefits of on-policy data while providing the long-horizon coherence of step-level corrections.
Methods
The authors propose Step-Level On-Policy Distillation (SOPD), which operates in four main phases:
- Student Rollout: The student model generates a complete trajectory (e.g., a full multi-turn agent interaction or a multi-step math solution). This fixes the visited states according to the student's actual policy.
- Step-Level Teacher Correction: The trajectory is partitioned into natural steps (like an environment turn or a paragraph break). For every student prefix, the teacher is asked to generate one complete step of correction. Crucially, these teacher targets are detached—they are never fed back into the environment or the student's subsequent steps during the rollout.
- Step Balancing: To prevent long teacher responses from dominating the gradient, the loss function averages token cross-entropy within each step before averaging across all steps.
- Packed Attention Mask: To keep training efficient, the prompt, student trajectory, and multiple teacher targets are packed into a single sequence using a custom attention mask, allowing parallel processing in a single forward pass.
Datasets
The method was evaluated on two distinct types of long-horizon tasks:
- ALFWorld: An interactive, text-based embodied agent benchmark requiring multi-turn planning and tool execution. Evaluation was conducted on Valid Seen, Valid Unseen, and Hard task splits.
- DeepMath: A dataset of mathematical problems. The authors filtered it to 57,000 examples (difficulty level $\ge 6$) for training.
- Competition Math Benchmarks: The distilled models were evaluated on four competition-level math benchmarks: AIME24, AIME25, HMMT25-Feb, and HMMT25-Nov.
Key Insights and Ideas
- Theoretical Interpolation: SOPD elegantly unifies SFT and OPD. Mathematically, if the step size is the entire response, SOPD collapses into sequence SFT. If the step size is reduced to a single token, it approximates forward-KL OPD.
- Coherence Without Intervention: Unlike DAgger-style methods or On-Policy Expert Correction (OEC), which inject teacher actions back into the rollout (altering the student's state distribution), SOPD lets the student complete its trajectory naturally. The teacher provides independent, local "counterfactual" corrections.
- Black-Box Friendly: Standard OPD requires access to teacher logits, making it impossible to use with closed-source models. SOPD only requires text generations, meaning you can distill from black-box API models (like GPT-4) at a practical cost comparable to standard SFT.
Key Results
ALFWorld Agents
SOPD significantly outperformed Vanilla OPD and SFT across the board. It raised the success rate on Valid Seen tasks from 65.72% to 84.29% and on Valid Unseen tasks from 60.45% to 82.09%, while simultaneously reducing the number of environment interaction rounds required to solve the tasks.
Mathematical Reasoning
On competition-level math, SOPD achieved a 4-benchmark average accuracy of 57.7%, outperforming Vanilla OPD (47.7%) by a massive 10 percentage points. Analysis showed that as training progressed, the student model naturally learned to extend its solution process by organizing more structured, multi-step reasoning chains.
Limitations and Future Work
- Step Boundary Dependency: The method relies on defining "natural step boundaries" (e.g., paragraph breaks or environment turns). For highly unstructured tasks, defining or parsing these boundaries automatically could be challenging.
- Generation Overhead: While teacher queries can be executed in parallel after the student rollout, SOPD still requires generating multiple alternative steps per trajectory, which increases the training-time generation overhead compared to simple offline SFT.
- Future Directions: The authors suggest exploring adaptive step sizing and extending this paradigm to multi-modal agent settings.
Summary updated