arXiv:2605.07122 · 中英对照阅读
RepoZero:大型语言模型(LLM)能否从零生成代码仓库?
RepoZero: Can LLMs Generate a Code Repository from Scratch?
中文速览
从零生成一整个软件仓库很难评估:过去的测试常靠人或模型打分,结果不够客观,也难以复现。作者提出 RepoZero,让 AI 只根据接口说明,用另一种编程语言重做现有开源项目,再把生成的程序实际运行,与原项目的输出逐项对比;同时用隔离环境和隐藏测试防止投机,并设计 ACE 流程,让 AI 反复生成测试、根据错误改进代码。实验显示,即使表现最好的模型和编程智能体,通过率也只有约 30%–55%,说明它们离独立完成真实软件开发还有明显差距。这个基准提供了可自动验证、可持续扩充的评测方式,也指出让 AI 学会用测试检查和修正自己的代码,是提升编程能力的重要方向。
摘要
大型语言模型(LLM)在代码生成方面近期取得了显著进展,但其从零构建完整软件仓库的能力仍缺乏充分认识。一个根本瓶颈在于缺少可验证且可扩展的评测方法:现有基准要么聚焦于基于补丁的编辑,要么依赖人工或基于LLM的判断,这会引入偏差并限制结果的可复现性。在本研究中,我们提出RepoZero,这是首个能够对从零进行的仓库级生成开展全自动、基于执行的验证的基准。我们的核心思路是将生成重新表述为仓库复现:仅给定API规范,智能体必须重新实现整个仓库,使其行为与原始实现相匹配。这一设计能够通过输出等价性进行严格的黑盒验证,同时天然支持通过复用现有开源仓库进行大规模构建。为进一步减轻数据泄漏和取巧解法带来的影响,我们引入了跨语言约束和沙箱评测协议。基于这一基准,我们提出智能体代码—测试演进(ACE)框架,通过迭代式测试生成和错误驱动的迭代优化,实现仓库级合成的有效测试时扩展。我们在多个先进的大型语言模型和智能体框架上开展了广泛实验,结果表明,即使是能力最强的LLM智能体,其通过率也仅为30%—55%,凸显了当前能力与现实世界软件开发需求之间的显著差距。我们的结果表明,RepoZero是一个具有挑战性、可扩展且可靠的端到端代码生成测试平台,并指出通过测试生成实现自我验证是推动基于LLM的编程智能体发展的关键方向。代码已发布于https://github.com/JesseZZZZZ/RepoZero。
Large Language Models (LLMs) have recently shown remarkable progress in code generation, yet their ability to construct complete software repositories from scratch remains poorly understood. A fundamental bottleneck is the lack of verifiable and scalable evaluation: existing benchmarks either focus on patch-based editing or rely on human or LLM-based judgments, which introduce bias and limit reproducibility. In this work, we present RepoZero, the first benchmark that enables fully automated, execution-based verification of repository-level generation from scratch. Our key idea is to reformulate generation as repository reproduction: given only API specifications, an agent must re-implement an entire repository such that its behavior matches the original implementation. This design allows for strict black-box validation via output equivalence, while naturally supporting large-scale construction by reusing existing open-source repositories. To further mitigate data leakage and shortcut solutions, we introduce cross-language constraints and a sandboxed evaluation protocol. Building on this benchmark, we propose an Agentic Code-Test Evolution (ACE) framework that performs iterative test generation and error-driven refinement, enabling effective test-time scaling for repository-level synthesis. Extensive experiments across multiple state-of-the-art LLMs and agent frameworks reveal that even the strongest LLM agents achieve only limited pass rates (30% - 55%), exposing a substantial gap between current capabilities and real-world software development requirements. Our results establish RepoZero as a challenging, scalable, and reliable testbed for end-to-end code generation, and highlight self-verification via test generation as a critical direction for advancing LLM-based coding agents. Code is available at https://github.com/JesseZZZZZ/RepoZero.
术语表
- Large Language Models (LLMs)
- 大型语言模型(LLM)
- RepoZero
- RepoZero
- repository-level generation
- 仓库级生成
- repository reproduction
- 仓库复现
- from-scratch generation
- 从零生成
- execution-based verification
- 基于执行的验证
- black-box validation
- 黑盒验证
- output equivalence
- 输出等价性
- data leakage
- 数据泄漏
- cross-language constraints
- 跨语言约束
- sandboxed evaluation protocol
- 沙箱评测协议
- Agentic Code-Test Evolution (ACE)
- 智能体代码—测试演进(ACE)
- test-time scaling
- 测试时扩展
- error-driven refinement
- 错误驱动的迭代优化
- coding agents
- 编程智能体
- patch-based verification
- 基于补丁的验证
- SWE-bench
- SWE-bench
- Multi-SWE-bench
- Multi-SWE-bench
- FEA-bench
- FEA-bench
- CodeS
- CodeS
- EvoCodeBench
- EvoCodeBench
- NL2RepoBench
- NL2RepoBench
- human-in-the-loop
- 人在回路
- LLM-as-a-judge
- 以LLM为评审
- ground truth
- 真实标注
- oracle
- 预言机
- majority voting
- 多数投票
- Lines of Code (LOC)
- 代码行数(LOC)
- white-box testing
- 白盒测试
- black-box testing
- 黑盒测试