ZeroCoder:无需真实监督,大语言模型能否提升代码生成?
ZeroCoder: Can LLMs Improve Code Generation Without Ground-Truth Supervision?
AI总结:
ZeroCoder通过协同进化代码与测试生成,无需真实监督提升代码生成。该方法利用自动生成的代码-测试交互反馈,通过动态调整选择器优先级,提升测试生成质量与代码生成性能。
摘要:
代码生成在软件工程中至关重要,强化学习与可验证奖励(RLVR)是一种通过执行反馈来提升其性能的强大范式。然而,大多数RLVR流水线依赖于人工整理的测试用例,使进展受限于稀缺且昂贵的监督。现有工作尝试使用自动生成的测试用例来确定奖励,但缺乏具有判别性的测试用例限制了效果,因为模型在测试生成上的表现次优。我们旨在通过代码与测试生成的协同进化来提升代码生成,使它们的相互作用产生逐步更具信息量的监督。为此,我们提出了ZeroCoder,一个完全无标签的协同进化框架,利用自动生成的代码-测试交互的执行反馈共同训练一个Coder和一个Tester。对于每个问题,ZeroCoder执行采样解决方案与采样测试用例的交互以形成通过矩阵,通过可插拔的选择算法识别出可能正确的解决方案和一致的测试用例,并推导出角色特定的奖励。为了确保奖励质量,ZeroCoder通过基于排名的预过滤器过滤低信息实例,并通过课程平衡有效性与突变驱动的判别性来训练Tester。我们进一步识别了选择器漂移,即在协同进化过程中固定选择规则的逐步误校准,并引入了DyB4,一个贝叶斯选择器,它使用尽可能少的10个带标签实例动态重新校准其先验。在三个模型和六个基准测试中,ZeroCoder一致地提升了代码生成和测试生成。在完全无标签的设置中,它在Qwen2.5-Coder-7B-Instruct基础上将代码生成提升了高达14.5%。使用DyB4,提升达到21.6%,测试生成提升24.3%,接近oracle监督性能。
英文摘要:
Code generation is important in software engineering, and Reinforcement Learning with Verifiable Rewards (RLVR) is a powerful paradigm to improve it through execution-based feedback. However, most RLVR pipelines rely on human-curated tests, making progress bottlenecked by scarce and costly supervision. Existing work tried to use self-generated tests to ground rewards, but the lack of discriminative tests constrains the effect due to the sub-optimal performance of the model on test generation. We aim to improve code generation without ground-truth supervision by co-evolving code and test generation, so that their interactions yield progressively more informative supervision. To this end, we present ZeroCoder, a fully label-free co-evolutionary framework that jointly trains a Coder and a Tester using execution feedback from self-generated code-test interactions. For each problem, ZeroCoder executes sampled solutions against sampled tests to form a passing matrix, identifies a consensus subset of likely-correct solutions and consistent tests via a pluggable selection algorithm, and derives role-specific rewards. To ensure reward quality, ZeroCoder filters low-information instances via rank-based pre-filtering and trains the Tester with a curriculum balancing validity and mutation-driven discriminativeness. We further identify selector drift, the progressive miscalibration of fixed selection rules during co-evolution, and introduce DyB4, a Bayesian selector that uses as few as 10 labeled instances to recalibrate its priors dynamically. Across three models and six benchmarks, ZeroCoder consistently improves code generation and test generation. In the fully label-free setting, it improves code generation by up to 14.5% over the base model on Qwen2.5-Coder-7B-Instruct. With DyB4, the gain reaches 21.6%, while test generation improves by 24.3%, approaching oracle-supervised performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。