arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.16299cs.SEcs.AI
收藏

ACE:通过对抗性单元测试生成和偏好优化的自进化LLM编码框架

ACE: Self-Evolving LLM Coding Framework via Adversarial Unit Test Generation and Preference Optimization

School of Data Science Fudan University(数据科学学院 复旦大学)

Yixu Huang, Xinglei Yu, Zhongyu Wei

AI总结:

本文提出ACE框架,通过基于求解器-对抗架构的执行中心监督,实现自进化代码生成,无需真实代码或外部奖励模型,实验表明其在CodeContests、MBPP和LiveCodeBench上均优于现有求解器-验证器基线。

摘要:

大型语言模型(LLMs)在代码生成方面表现出色,但仍然严重依赖大规模标注解决方案和基于验证的监督,这限制了可扩展性和持续自我改进的能力。最近的求解器-验证器框架利用程序执行作为自动监督信号,但其有效性在求解器变得中等强大时会下降:验证器生成的测试越来越多地确认语义正确性,而不是暴露剩余的失败模式。我们提出了ACE,一种基于求解器-对抗架构的自进化代码生成框架,优先通过以执行为中心的监督进行主动失败发现。一个单一的LLM在生成候选程序和生成优化以诱导执行级失败(如运行时错误、异常或非终止)的对抗性单元测试输入之间交替进行。监督仅来源于执行结果:稳健的程序被选为监督微调,而对抗性测试通过Kahneman-Tversky优化使用执行衍生的偏好进行优化。值得注意的是,整个训练循环不需要真实代码或外部奖励模型。在CodeContests、MBPP和LiveCodeBench上的实验表明,ACE在pass@1上持续优于强大的求解器-验证器基线,实现了3-7%的绝对提升,在分布外基准上改进更大,同时保持竞争性或改进的推理效率。

英文摘要:

Large Language Models (LLMs) excel at code generation but remain heavily reliant on large-scale annotated solutions and verification-based supervision, which constrains scalability and hinders sustained self-improvement. Recent solver--verifier frameworks exploit program execution as an automatic supervision signal, but their effectiveness degrades as solvers become moderately strong: verifier-generated tests increasingly confirm semantic correctness rather than exposing the remaining failure modes. We propose \textbf{ACE}, a self-evolving code generation framework based on a solver--adversary architecture that prioritizes active failure discovery through execution-centric supervision. A single LLM alternates between generating candidate programs and producing adversarial unit test inputs optimized to induce execution-level failures, such as runtime errors, exceptions, or non-termination. Supervision is derived solely from execution outcomes: robust programs are selected for supervised fine-tuning, while adversarial tests are optimized via Kahneman--Tversky Optimization using execution-derived preferences. Notably, the entire training loop requires no ground-truth code or external reward models. Experiments on CodeContests, MBPP, and LiveCodeBench demonstrate that ACE consistently outperforms strong solver--verifier baselines, achieving 3--7\% absolute gains in pass@1, with larger improvements on out-of-distribution benchmarks, while maintaining competitive or improved inference efficiency.

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

↑