arXiv(opens in a new tab)cs.CLOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.21496

OPRD: On-Policy Reminder Distillation for Long-Horizon Coding Agents

Yuechen Luo, Zhiyi Lai, Miao Ziqi, Zihang Xu, Jingxuan Xu, Songwei Yu, Wenqiang Zhu, Weihao Li, Junhao Fan, Haoyang Huang, Yanan Wu, Ken Deng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.

1 Introduction

Large language models have advanced in reasoning (Zhan et al. 2025a; Deng et al. 2025a; Xu et al. 2026b; Miao et al. 2026) and repository-level software engineering (Jimenez et al. 2024; Yang et al. 2024; Zhang et al. 2024; Ouyang et al. 2025; Xia et al. 2025). Reliable long-horizon coding nevertheless requires agents to preserve task constraints and adapt to tool and execution feedback (Yao et al. 2023; Chen et al. 2024). We examine this challenge on 200 SWE-REBENCH V2 validation tasks (Badertdinov et al. 2026), using two Qwen3.5-4B rollouts per task under identical inference settings (Qwen Team 2026). In the reminder-free rollout, deterministic rules identify explicit tool and execution failures, while GPT-5.4 classifies remaining context-dependent events from the task and complete trajectory (OpenAI 2026). Each event belongs to one of four categories in Table 6: Tool-Feedback Recovery, Scope and Source Grounding, Scenario-Condition Reasoning, and Post-Edit Control and Validation. In the second rollout, the agent restarts from the task under

Figure

Figure 1: Diagnostic analysis of Qwen3.5-4B on 200 tasks from the SWE-REBENCH v2 validation set. Left: a Scope and Source Grounding example in which a Turn-local Reminder prevents unsupported patch expansion. Right: aggregate error-event counts across four categories under Reminder-free and Reminder-augmented settings; percentages indicate relative reductions.

the same settings, and the Reminder mechanism examines each environment observation to decide whether to insert a Turn-local Reminder before the next action. Applying the same annotation protocol reveals fewer error events across all four categories (Fig. 1). Post-hoc annotation audits completed trajectories, while runtime Reminder selection uses only the currently visible interaction prefix. This finding suggests that reliable long-horizon coding requires models to preserve task-level constraints across a trajectory and use local interaction feedback at appropriate decision points. A natural direction is therefore to provide process-level corrective information with explicit temporal scope.

However, coding-agent training relies on supervised imitation of successful trajectories or executable-outcome optimization (Pan et al. 2025; Jain et al. 2025; Wei et al. 2025). These signals improve task completion but do not indicate which constraints should persist or which observation should guide the next decision. At inference time, agents can adapt to feedback (Yao et al. 2023; Chen et al. 2024) or recover missed information through reflection and self-critique (Shinn et al.

∗^{*}Equal contribution.

†^{\dagger}Corresponding author.

2023; Madaan et al. 2023; Gou et al. 2024). Runtime reminders require deployment-time construction and injection, consume context, and tie behavior to an agent scaffold. On-policy distillation trains students on self-generated outputs to reduce train-inference mismatch (Agarwal et al. 2024; Gu et al. 2024). Related work uses context- and feedback-conditioned distillation to internalize behavior induced by auxiliary instructions or environment feedback (Ye et al. 2026; Hübotter et al. 2026). Applying these ideas to long-horizon coding leaves two challenges. First, training-time corrective information can encode persistent constraints and local corrections from observations relevant to one decision. Without explicit scopes, local corrections may be diluted in long contexts or propagated to unrelated decisions. Second, models without instruction-following adaptation may ignore constraints and feedback, so teacher reminders may not produce reliable distillation targets.

This raises a practical question: Can we internalize scope-specific corrective information during training so that a coding agent can operate without reminders at inference time?

We address this with On-Policy Reminder Distillation (OPRD), which combines Multi-Scope Reminder supervision with outcome-based routing on rollouts from a reminder-free student. For failed trajectories, we construct reminders from task, trajectory, and execution/validation records. A Global Reminder converts final-test diagnostics into trajectory-level guidance. A Turn-local Reminder is anchored to an observation and applies only to the next decision. This combines trajectory-level feedback with local correction without propagating local feedback to unrelated decisions. For reliable supervision, our two-stage cold start uses Coding SFT to establish coding capabilities and Instruction-Following (IF) SFT to improve responsiveness to constraints, feedback, and reminders. Both models are initialized from the IF checkpoint. Based on executable verification, OPRD routes successful rollouts to autoregressive self-imitation and failed rollouts to reminder-conditioned distillation without reinforcing erroneous decisions. For failures, the teacher re-evaluates student-generated prefixes under reminders, while the student matches the teacher distribution through Top-100 reverse KL. OPRD internalizes scope-specific corrections, enabling the student to act on corresponding constraints and feedback without reminders at inference time. We evaluate OPRD on SWE-BENCH VERIFIED, SWE-BENCH PRO, and SWE-BENCH MULTILINGUAL (OpenAI 2024; Deng et al. 2025b; Yang et al. 2025). 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, the trained OPRD model reduces the aggregate error-event count across the four categories from 446 to 222, a 50.2% reduction relative to the base model.

Our main contributions are threefold:

• Multi-Scope Reminder supervision for long-horizon coding. We combine a Global Reminder that provides guidance across the trajectory with Turn-local Reminders that target only the next decision, enabling process-level supervision at complementary temporal scopes.

• On-Policy Reminder Distillation with Outcome-Based Routing. We propose OPRD, which learns from verified successful rollouts through autoregressive self-imitation and from failed rollouts through reminder-conditioned reverse KL distillation.

• A two-stage supervised cold start for reliable reminder distillation. Coding SFT followed by IF SFT provides a shared teacher–student initialization that improves responsiveness to constraints, execution feedback, and reminders, thereby providing a stronger starting point for subsequent reminder-conditioned distillation.

References (40)