通过对抗性测试用例进化,提升代码生成强化学习的验证效果。
EvolveCoder: Evolving Test Cases via Adversarial Verification for Code Reinforcement Learning
- 根据候选代码执行行为动态优化测试用例,增强验证难度与区分度。
- 迭代优化后通过率从43.80降至31.22,验证信号显著增强。
- 适用于追求高可靠代码生成的模型训练与评估场景。
基于可验证奖励的强化学习(RLVR)是提升大语言模型代码生成能力的有前景方法,但现有编码强化学习数据集中的验证信号较弱且静态。本文提出一种条件驱动的对抗性验证框架,基于候选解的执行行为迭代优化测试用例,以提升其难度、区分度并减少冗余。基于此框架,构建了大规模数据集EvolveCoder-22k,经过多轮对抗式测试用例演化。实证分析表明,迭代优化显著增强了验证能力,通过率(pass@1)从43.80降至31.22。在EvolveCoder-22k上进行强化学习,实现稳定优化和持续性能提升,在四个下游基准上平均使Qwen3-4B模型提升4.2分,并优于多个4B规模强基线。结果凸显了对抗性、解条件化验证对高效可扩展代码生成强化学习的关键作用。
原文摘要 · Abstract (English)
Reinforcement learning with verifiable rewards (RLVR) is a promising approach for improving code generation in large language models, but its effectiveness is limited by weak and static verification signals in existing coding RL datasets. In this paper, we propose a solution-conditioned and adversarial verification framework that iteratively refines test cases based on the execution behaviors of candidate solutions, with the goal of increasing difficulty, improving discriminative power, and reducing redundancy. Based on this framework, we introduce EvolveCoder-22k, a large-scale coding reinforcement learning dataset constructed through multiple rounds of adversarial test case evolution. Empirical analysis shows that iterative refinement substantially strengthens verification, with pass@1 decreasing from 43.80 to 31.22. Reinforcement learning on EvolveCoder-22k yields stable optimization and consistent performance gains, improving Qwen3-4B by an average of 4.2 points across four downstream benchmarks and outperforming strong 4B-scale baselines. Our results highlight the importance of adversarial, solution-conditioned verification for effective and scalable reinforcement learning in code generation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。