Co-Evolving Policy and Reward for Code Generation: A Mechanistic Study of Single-Adapter Drift
Abstract
Reinforcement learning with verifiable rewards (RLVR) is particularly well suited to code generation because generated programs can be objectively evaluated through execution. Execution also provides behavioral information that can be reused as additional supervision. The Synergistic Policy and Reward Co-Evolving Framework (SPARK), originally proposed for reasoning tasks, exploits this idea by recycling training rollouts and their evaluation results to train a model not only to generate solutions but also to evaluate and improve them. We investigate whether this policy-reward co-evolution approach transfers effectively to code generation and whether execution-grounded reflection provides an additional source of self-improvement. We compare SPARK-style rollout recycling with execution-only Group Relative Policy Optimization (GRPO) using Qwen2.5-Coder-3B-Instruct. Our results do not support either hypothesis under the configuration tested. Although co-evolution improves training performance, these gains do not generalize to held-out problems. Compared at the same stage of training, rollout recycling produces roughly 34x greater KL divergence from the reference policy than execution-only GRPO. Over training, trained tokens per GRPO sequence fall from 185 to 86 as training pass rate increases, while held-out performance declines or fails to sustain early gains. We characterize these patterns as single-adapter policy drift: the shared trainable parameters increasingly depart from pretrained code-generation behavior without corresponding gains in generalization. The results show that higher training reward alone is not evidence of generalizable code self-improvement and highlight the importance of held-out evaluation and drift diagnostics.
Create a lesson
Metadata
- Categories
- cs.CL, cs.LG, cs.SE
- Comments
- Accepted at IEEE ICTAI 2026
Related papers
HarnessRL: Co-Evolving Policies with a Just-in-Time Training Harness for Open-Ended RL
Shared title terminologycs.CLXiaoqiang Wang, Ting-En Lin, Yuchuan Wu et al.
Capable Teacher, Myopic Scorer: Reward-Free Teacher Repair for Agentic On-Policy Distillation
Shared title terminologycs.CLShu Zhao, Tan Yu
Self-Decomposing Diffusion for Code Generation
Shared title terminologycs.CLLize Shao, Zichen Xie, Zhizhen Chen et al.
Judging the Justification: Decision Certificate Supervision for Generative Reward Models
Shared title terminologycs.CLGuiquan Sun, Bing Bai, Martin Renqiang Min et al.
scOPD: Routed On-Policy Self-Distillation for LLM-Based Single-Cell Annotation
Shared title terminologycs.CLZhiyin Yu, Yuchen Mou, Songtao Huang et al.
Mitigating Reward Hacking in Preference Reward Models with Evolving Penalties
Shared title terminologycs.CLAfonso Baldo, António Farinhas, Marcos Treviso et al.