arXiv:2412.01769cs.SEcs.AI2024-12ICLR被引 43

让AI从零开始写完整库,测试其理解与迭代能力。

Commit0: Library Generation from Scratch

  • 用自然语言规范+交互式测试,要求生成可运行的完整代码库。
  • 现有模型仅能通过部分测试,无法独立完成全库实现。
  • 交互反馈显著提升通过率,适合评估AI编程进化能力。

为超越专家级软件开发能力的评测目标,我们提出Commit0,一个挑战AI智能体从零编写完整代码库的基准。智能体需根据API规格文档和一系列交互式单元测试,生成符合要求的实现,并通过运行测试验证。该基准推动评测从静态单次生成转向需处理长文本说明、多阶段反馈及复杂依赖关系的动态过程。系统提供交互环境,实时反馈静态分析与执行结果。实验表明,当前模型虽能通过部分测试,但均无法完整复现整个库;且交互反馈显著提升通过测试的数量,验证了该基准对促进模型迭代的有效性。

原文摘要 · Abstract (English)

With the goal of benchmarking generative systems beyond expert software development ability, we introduce Commit0, a benchmark that challenges AI agents to write libraries from scratch. Agents are provided with a specification document outlining the library's API as well as a suite of interactive unit tests, with the goal of producing an implementation of this API accordingly. The implementation is validated through running these unit tests. As a benchmark, Commit0 is designed to move beyond static one-shot code generation towards agents that must process long-form natural language specifications, adapt to multi-stage feedback, and generate code with complex dependencies. Commit0 also offers an interactive environment where models receive static analysis and execution feedback on the code they generate. Our experiments demonstrate that while current agents can pass some unit tests, none can yet fully reproduce full libraries. Results also show that interactive feedback is quite useful for models to generate code that passes more unit tests, validating the benchmarks that facilitate its use.

代码生成基准测试AI编程

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。