arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.26416cs.CLcs.LGcs.SE
收藏

代码生成中策略与奖励的协同演化:单适配器漂移的机制研究

Co-Evolving Policy and Reward for Code Generation: A Mechanistic Study of Single-Adapter Drift

Jarvis College of Computing and Digital Media(贾维斯计算与数字媒体学院);DePaul University(德保罗大学)

Amarsaikhan Batjargal, Noriko Tomuro

AI总结:

该研究探究SPARK策略-奖励协同演化方法在代码生成中的适用性,对比SPARK式rollout复用与GRPO,发现协同演化的训练增益无法泛化,存在单适配器策略漂移问题,强调未见过的评估与漂移诊断的重要性。

摘要:

带可验证奖励的强化学习(RLVR)特别适用于代码生成,因为生成的程序可通过执行进行客观评估,执行还能提供可复用为额外监督的行为信息。最初针对推理任务提出的协同策略与奖励协同演化框架(SPARK)利用这一思路,复用训练rollout及其评估结果来训练模型,使其不仅能生成解决方案,还能评估并改进这些方案。我们研究这种策略-奖励协同演化方法是否能有效迁移到代码生成,以及基于执行的反思是否能提供额外的自我改进来源。我们使用Qwen2.5-Coder-3B-Instruct,将SPARK式rollout复用与仅执行的分组相对策略优化(GRPO)进行比较。在测试的配置下,我们的结果不支持上述两个假设:尽管协同演化提升了训练性能,但这些增益无法泛化到未见过的问题;在相同训练阶段,rollout复用产生的与参考策略的KL散度约为仅执行GRPO的34倍;训练过程中,随着训练通过率提升,每个GRPO序列的训练token数从185降至86,而未见过的性能要么下降,要么无法维持早期增益。我们将这些模式表征为单适配器策略漂移:共享可训练参数越来越偏离预训练的代码生成行为,且泛化能力未相应提升。结果表明,仅更高的训练奖励并非可泛化代码自我改进的证据,凸显了未见过的评估与漂移诊断的重要性。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑