OPRD: On-Policy Reminder Distillation for Long-Horizon Coding Agents
Organizations: Tsinghua University · Independent Researcher · Shanghai Artificial Intelligence Laboratory · National University of Singapore
Abstract
Reliable repository-level coding requires agents not only to generate correct code but also to preserve constraints and respond to tool feedback across long interactions. However, our diagnostic analysis shows that agents often fail to act on relevant information already available in context, while final Pass/Fail outcomes provide only sparse process supervision. We introduce On-Policy Reminder Distillation (OPRD), which combines Multi-Scope Reminder supervision with outcome-based routing on reminder-free student rollouts. Successful rollouts provide autoregressive self-imitation targets, whereas failed rollouts receive Reminder-conditioned reverse-KL supervision from a teacher that re-evaluates the same student-generated prefixes. A Global Reminder converts final-test diagnostics into trajectory-level guidance, while Turn-local Reminders apply only to the next decision following the relevant environment observation. The teacher and student share a two-stage initialization from Coding SFT and Instruction-Following (IF) SFT. At inference, the student operates without Reminders. On SWE-bench Verified, SWE-bench Pro, and SWE-bench Multilingual, OPRD improves the benchmark-averaged task resolution rate by 11.3 points over the open-source Qwen3.5-4B base model. Under the same diagnostic protocol, it reduces the aggregate error-event count from 446 to 222, a 50.2% reduction.
Figures & tables
| Stage | Unit | SWE-rebench V2 | Multi- SWE-RL |
|---|---|---|---|
| Coding SFT | Trajectory | 7,262 | 738 |
| IF SFT | Example | 2,000 | 0 |
| OPRD | Task | 3,630 | 370 |
| Training Configuration | SWE-bench | SWE-bench | SWE-bench | Average (%) |
|---|---|---|---|---|
| Verified (%) | Pro (%) | Multilingual (%) | ||
| Qwen3.5-4B | 50.4 | 24.2 | 35.3 | 36.6 |
| Coding SFT | 53.6 | 25.6 | 38.7 | 39.3 |
| Coding SFT IF SFT | 55.8 | 26.7 | 42.3 | 41.6 |
| Coding SFT OPRD (w/o IF SFT) | 58.4 | 28.3 | 46.3 | 44.3 |
| Coding SFT IF SFT OPRD (Ours) | 61.2 | 30.5 | 52.0 | 47.9 |
| Setting | SWE-bench | SWE-bench | SWE-bench | Average (%) |
|---|---|---|---|---|
| Verified (%) | Pro (%) | Multilingual (%) | ||
| KL Support and Distillation Temperature | ||||
| Full Vocabulary, | 59.8 | 29.4 | 50.3 | 46.5 |
| Top-100, | 60.2 | 29.7 | 50.7 | 46.9 |
| Top-100, (Ours) | 61.2 | 30.5 | 52.0 | 47.9 |
| Top-100, | 60.4 | 29.8 | 51.0 | 47.1 |
| Ver. | Pro | Multi. | Avg. | |
|---|---|---|---|---|
| 0.25:1 | 59.6 | 28.7 | 49.7 | 46.0 |
| 0.5:1 | 60.4 | 29.5 | 51.0 | 47.0 |
| 1:1 (Ours) | 61.2 | 30.5 | 52.0 | 47.9 |
| 2:1 | 60.8 | 29.8 | 51.3 | 47.3 |
| 4:1 | 59.8 | 28.9 | 50.3 | 46.3 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Parameter | Value | Parameter | Value |
| Model | Qwen3.5-4B | Maximum sequence length | 131,072 |
| Training framework | VeOmni | LR start | 0 |
| Epochs | 3 | GPU | 16 NVIDIA H20 |
| Global batch size | 32 | Micro batch size | 1 |
| Peak learning rate | Minimum learning rate | ||
| LR schedule | Cosine | Warmup ratio | 0.005 |
| ID | Functional Class | Original Rubric Source | Count |
|---|---|---|---|
| R1 | Tool-Feedback Recovery | Deterministic hard rules | 10 |
| R2 | Scope and Source Grounding | Scope/patch and source/path slots | 10 |
| R3 | Scenario-Condition Reasoning | Scenario/condition slot | 5 |
| R4 | Post-Edit Control and Validation | Post-edit drift and validation/wrap-up slots | 7 |
| Total | 10 hard rules and 22 non-hard strategies | 32 |
AI Coding Agents
AI coding agents use language models and software tools to plan, edit, test, and maintain code with varying levels of autonomy.
See all 321 papers