SWE-OPD: On-Policy Distillation for Agentic Coding
Yuhang He, Yanyu Chen, Chuanzhe Guo, Jie Zhu, Zichen Tian, Hongyu Ge, Zixuan Ren, Huang He, Bingjin Chen, Junyuan Shang, Shuohuan Wang, Yongqi Zhang, Irwin King, Jing Liu
Abstract
In this work, we study on-policy distillation (OPD) for transferring agentic coding capabilities from a large teacher model to a smaller student model. Prior work has focused primarily on reasoning and short-horizon agentic tasks. We present SWE-OPD, a minimal OPD study for software engineering, where the student interacts with executable repositories and the teacher supervises the prefixes visited by the student. Across three teacher--student pairs, two training sources, and three SWE benchmarks, we find that on-policy supervision transfers coding capability: supervision from Qwen3.6-27B increases the SWE-bench Pro resolve rate of Qwen3.5-9B from 35.9% to 39.4%. Refreshing trajectories is not strictly required either, as an offline variant with cached teacher scores still improves over the student baselines while cutting end-to-end GPU-hours by 59.4%--72.6% and halving peak GPU allocation, at benchmark-dependent accuracy. Furthermore, we extend the offline variant to corss-tokenizer scenarios: distilling GLM-4.5-Air from DeepSeek-V4-Flash-0731 raises its SWE-bench Pro and Multilingual resolve rate from 35.8% to 39.7% and from 41.8% to 46.2%, around 4% and 4.6% improvement, respectively. We also find that a decreasing loss, however, does not necessarily indicate improved agent performance: under top-K reverse-KL loss, one student exhibits severe repetition despite a decreasing loss. We identify a support-mass gradient term as a potential mechanism underlying this failure.
Create a lesson
Related papers
Agentic On-Policy Distillation Implicitly Reshapes LLMs' ReAct Patterns
Shared title terminology · Deyang Kong, Zhaoyi Li, Sijian Ren et al.
When Students Fail to Learn from Teachers: Learning Dynamics of On-Policy Distillation
Shared title terminology · Xinnan Zhang, Zeyi Liao, Siliang Zeng et al.
Streaming On-Policy Distillation: Decoupling Three Clocks for Stage-Wise Supervision Consumption
Shared title terminology · Yun Zhu Da Wang
Conflict-Aware Multi-Teacher On-Policy Distillation in Aligned Action Spaces for Cross-Game Generalization
Shared title terminology · Jing Yi, Cehao Yang, Hualei Zhang et al.
Bel: Step-Level Policy Improvement of Visual Agents Without Training
Shared title terminology · Jiajun Fan, Ziwen Wang, Zhaoyu Zhu et al.
How Much Should an Agent Remember? Deployment Lessons from Self-Distilled Memory for LLM Agents
Shared title terminology · K. R. Jayaram, Vatche Isahagian, Aswath Vaithinathan Aravindan et al.