arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.20380cs.LGcs.AIcs.CL
收藏

通过单步奖励的多轮代码生成

Multi-Turn Code Generation Through Single-Step Rewards

Mila- Quebec AI Institute(魁北克AI研究所);Cornell University(康奈尔大学)

Arnav Kumar Jain, Gonzalo Gonzalez-Pumariega, Wayne Chen, Alexander M Rush, Wenting Zhao, Sanjiban Choudhury

AI总结:

针对多轮执行反馈的代码生成问题,提出基于单步奖励的 $μ$Code 方法,通过迭代训练生成器与验证器实现单步可恢复的 MDP,显著超越基线。

摘要:

我们解决从多轮执行反馈中生成代码的问题。现有方法要么在没有反馈的情况下生成代码,要么使用复杂的分层强化学习来优化多轮奖励。我们提出了一种简单且可扩展的方法 $μ$Code,仅使用单步奖励来解决多轮代码生成。我们的关键洞察是,代码生成是一个单步可恢复的 MDP,正确的代码可以在单轮内从任何中间代码状态中恢复。$μ$Code 迭代地训练生成器(基于多轮执行反馈提供代码解决方案)和验证器(对新代码评分)。实验表明,我们的方法相比最先进的基线取得了显著改进。我们分析了奖励模型与策略的设计选择,并展示了 $μ$Code 在利用执行反馈方面的有效性。代码见 https://github.com/portal-cornell/muCode。

英文摘要:

We address the problem of code generation from multi-turn execution feedback. Existing methods either generate code without feedback or use complex, hierarchical reinforcement learning to optimize multi-turn rewards. We propose a simple yet scalable approach, $μ$Code, that solves multi-turn code generation using only single-step rewards. Our key insight is that code generation is a one-step recoverable MDP, where the correct code can be recovered from any intermediate code state in a single turn. $μ$Code iteratively trains both a generator to provide code solutions conditioned on multi-turn execution feedback and a verifier to score the newly generated code. Experimental evaluations show that our approach achieves significant improvements over the state-of-the-art baselines. We provide analysis of the design choices of the reward models and policy, and show the efficacy of $μ$Code at utilizing the execution feedback. Our code is available at https://github.com/portal-cornell/muCode.

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

↑