Cross-Vocabulary On-Policy Distillation Transfers 800B Model Capabilities to Agentic Coding Without RL
Researchers introduce SWE-OPD, the first cross-vocabulary on-policy distillation method for long-horizon agentic coding, demonstrating effective capability transfer from 800B-parameter teachers to smaller models without reinforcement learning or trajectory filtering, achieving up to 4.6% resolve rate improvements on SWE-bench benchmarks while reducing GPU costs by up to 72.6% via offline distillation.
Reading font

Background: From Text Generation to Agentic Coding
As large language models evolve from text generation to Agentic Coding , model capability improvement is no longer limited to single-turn code generation. Models must now perform multi-turn interaction, tool use, code editing, test verification, and long-horizon reasoning in real software repositories.
A key challenge is transferring stronger models' Agentic Coding abilities to smaller models while balancing training effectiveness, compute cost, and engineering scalability. On-Policy Distillation (OPD) offers a new approach: the Student explores and generates interaction trajectories following its own policy, while the Teacher provides fine-grained token-level supervision on the states actually visited by the Student.
Limitations of Prior OPD Work
Existing OPD research has focused on mathematical reasoning, short-horizon tasks, and relatively simple agent scenarios. The question remains whether OPD can handle real software engineering tasks with long-horizon interaction, complex tool calls, and dynamic environment states — and whether it works across different tokenizers.
SWE-OPD: On-Policy Distillation for Agentic Coding
The authors introduce SWE-OPD , applying OPD to real software engineering (SWE) tasks to evaluate capability transfer in industrial-grade long-horizon Agentic Coding scenarios.
Core Mechanism
Student autonomous exploration : In real, executable software repositories, the Student completes tasks through multi-turn interaction, generating code, calling tools, and receiving environment feedback.
Teacher provides supervision : The Teacher does not need to generate a complete reference solution. Instead, it provides token-level probability supervision on the context and states actually visited by the Student.
Student continuous optimization : By aligning Teacher and Student prediction distributions, the Student learns the stronger model's capabilities within its own visited state space.
Unlike traditional Teacher Rollout Distillation, SWE-OPD lets the Teacher supervise the Student's own trajectories, not require the Student to mimic the Teacher's completed trajectories.
Experimental Setup
Systematic experiments were conducted on three software engineering benchmarks: SWE-bench Verified , SWE-bench Pro , and SWE-bench Multilingual .
Same-Tokenizer Experiments
Using Qwen3.5-9B as Student and Qwen3.6-27B as Teacher , after OPD training the Student's Resolve Rate on SWE-bench Pro improved from 35.9% to 39.4% .
Cross-Tokenizer Experiments
To validate cross-vocabulary OPD feasibility, experiments used industrial-grade models with different tokenizers:
DeepSeek-V4-Flash-0731 (~300B parameters)
GLM-5.2 (~800B parameters)
A simple, conservative alignment scheme was adopted: reuse the Teacher's tokenizer to encode the Student's generated trajectories, establishing correspondence for tokens covering the same character spans. For tokens that cannot be directly aligned, they are retained in context and merged using a simple GOLD strategy . No complex cross-vocabulary mapping mechanisms were introduced, preserving the original OPD simplicity.
Example result: with GLM-4.5-Air as Student and DeepSeek-V4-Flash-0731 as Teacher , the Student improved on all three benchmarks, with SWE-bench Multilingual improving by 4.6 percentage points .
Vanilla OPD: No RL, No Trajectory Filtering, Preserving Native Chain-of-Thought
A common approach in Agentic Coding is to introduce reinforcement learning (RL) using task success or test pass as reward signals, combined with trajectory filtering and successful sample mining. This adds training complexity: reward design, credit assignment for long-horizon tasks, and extensive trajectory curation.
The authors deliberately chose a simpler path: Vanilla OPD . In SWE-OPD they:
Do not introduce RL : No GRPO, PPO, or other RL training flows; no use of final task success as an extra reward signal.
Do not filter trajectories : Retain valid Student native interaction trajectories, including unsolved tasks and trajectories truncated due to interaction budget exhaustion.
Preserve native generation process : Keep the Student's own reasoning text, tool calls, and code edits; do not require the Student to imitate the Teacher's full chain-of-thought.
Do not rely on complex data curation : No rejection sampling based on task success rate; no construction of curated successful trajectory datasets.
The entire training process maintains the core OPD form: Student explores the environment following its own policy, Teacher provides fine-grained supervision on the Student's actually visited context, and Student is updated via token-level distillation.
Experiments across different Student-Teacher combinations, training data, and multiple SWE benchmarks show stable capability improvements, confirming that even without RL or success trajectory filtering, Vanilla OPD can achieve effective agent capability transfer.
Engineering Validation: Offline SWE-OPD for Cost Reduction
Online OPD requires simultaneous GPU resources for Student Rollout, Teacher Scoring, and Student Training, incurring high resource overhead. The authors explored Offline SWE-OPD : pre-collect Student trajectories and pre-compute Teacher supervision signals, decoupling Rollout, Teacher Scoring, and Student Training so that different stages can reuse the same GPU resource pool.
On internal datasets, compared to online OPD:
Qwen experiment end-to-end GPU-hours reduced by 59.4%
GLM experiment end-to-end GPU-hours reduced by 72.6%
Peak GPU demand reduced from 64 to 32 GPUs
Combined with industrial-grade models and cross-vocabulary experiments, large-scale compute validation provides practical evidence for deploying OPD in real Agentic Coding systems.
Key Findings and Limitations
Scenario breakthrough : OPD advanced from traditional short-text reasoning and simple agent tasks to real software engineering scenarios requiring multi-turn interaction, tool use, and long-horizon reasoning, with cross-vocabulary distillation feasibility verified.
Method simplification : Vanilla OPD achieves Student programming agent capability improvement without RL or task success rate filtering.
Engineering validation : Distillation experiments between industrial-grade models with different tokenizers, and Offline OPD significantly reduces training cost and peak GPU requirements.
The study does not propose a complex new training framework but aims to verify a fundamental question: can OPD serve as a simple, effective, and engineering-scalable capability transfer method for long-horizon Agentic Coding?
An important observation: training loss decrease does not always translate to actual agent capability improvement. For example, in some GLM experiments, Top-K Reverse KL training exhibited severe repetitive generation, while Sampled-token training remained stable. This indicates that for long-horizon agents, training objectives, optimization processes, and final task performance must be evaluated together.
Future Directions
Further exploration of combining OPD with RL, cross-vocabulary alignment, long-horizon trajectory optimization, and pre-training applications to advance On-Policy Distillation in more complex agent scenarios.
Paper : https://arxiv.org/pdf/2611.21020v1
Code : https://github.com/ernie-research/SWE-OPD
For questions about attribution, corrections or content rights, please contactand we will review it promptly.