spot_img
HomeResearch & DevelopmentA Structured Approach to Generating Comprehensive Software Repositories

A Structured Approach to Generating Comprehensive Software Repositories

TLDR: This research introduces the Repository Planning Graph (RPG), a structured representation that unifies proposal and implementation planning for software repository generation. Building on RPG, the ZeroRepo framework generates entire codebases in three stages: proposal-level construction, implementation-level refinement, and graph-guided code generation with test validation. Evaluated on the new RepoCraft benchmark, ZeroRepo significantly outperforms existing methods in code scale, functional coverage, and correctness, demonstrating that graph-based planning enables more scalable and coherent repository development.

Generating entire software repositories from scratch using large language models (LLMs) has long been a significant hurdle. While LLMs excel at creating individual functions or files, scaling this capability to complex, multi-file projects with intricate dependencies has remained a fundamental challenge. The core issue lies in the ambiguity and verbosity of natural language, which is often used for planning but struggles to accurately represent complex software structures and maintain coherence over long development cycles.

To tackle this, researchers Jane Luo, Xin Zhang, Steven Liu, Jie Wu, Yiming Huang, Yangyu Huang, Chengyu Yin, Ying Xin, Jianfeng Liu, Yuefeng Zhan, Hao Sun, Qi Chen, Scarlett Li, and Mao Yang from Microsoft, Tsinghua University, and the University of California, San Diego, have introduced a novel solution: the Repository Planning Graph (RPG). This innovative approach provides a persistent, structured representation that unifies both the high-level proposal and detailed implementation planning stages. The RPG encodes capabilities, file structures, data flows, and functions within a single graph, effectively replacing ambiguous natural language with an explicit blueprint for software development. This allows for more reliable long-horizon planning and scalable repository generation.

Building upon the RPG, the team developed ZeroRepo, a graph-driven framework designed for generating complete repositories. ZeroRepo operates in three distinct stages:

Proposal-Level Construction

This initial stage translates high-level user specifications into a coherent functionality graph. It involves grounding functionalities in a large-scale Feature Tree (an ontology of over 1.5 million software capabilities), selecting a repository-aligned subtree through an explore-exploit search strategy, and then refactoring it into a modular functionality graph. This ensures systematic coverage of requirements and a balanced foundation for planning.

Implementation-Level Construction

Once the functional plan is established, this stage enriches the graph with detailed implementation specifics. It involves encoding the repository’s file structure, modeling inter-module data flows and intra-module orderings, and specifying concrete functions and interfaces. This process culminates in the complete Repository Planning Graph, ready to guide code generation.

Also Read:

Graph-Guided Code Generation

In the final stage, ZeroRepo traverses the fully constructed RPG in a topological order, ensuring that all dependencies are implemented before their dependents. It employs a test-driven development (TDD) approach, where tests are derived from task specifications, and corresponding functions or classes are implemented and validated. Only code that passes all tests is committed, allowing for incremental expansion while maintaining stability. The RPG also aids in localization and debugging, helping agents quickly find and edit relevant code sections.

To rigorously evaluate ZeroRepo, the researchers created RepoCraft, a new benchmark comprising six real-world projects with 1,052 tasks. On RepoCraft, ZeroRepo demonstrated remarkable performance. It generated repositories averaging nearly 36,000 lines of code, which is approximately 3.9 times larger than the strongest baseline (Claude Code) and about 64 times larger than other baselines. ZeroRepo achieved an impressive 81.5% functional coverage and a 69.7% pass rate, significantly outperforming Claude Code by 27.3 and 35.8 percentage points, respectively.

Further analysis revealed that the RPG is crucial for modeling complex dependencies, enabling progressively more sophisticated planning through near-linear scaling of functionality and code size. It also enhances LLM understanding of repositories, accelerating agent localization and improving overall development efficiency. The structured nature of the RPG helps maintain consistency and extensibility, overcoming the limitations of natural language-based planning which often leads to fragmented specifications and stagnant growth.

The introduction of the Repository Planning Graph and the ZeroRepo framework marks a significant step forward in the field of large-scale code generation, offering a robust foundation for building complex, coherent, and scalable software repositories. For more details, you can read the full research paper here.

Karthik Mehta
Karthik Mehtahttps://blogs.edgentiq.com
Karthik Mehta is a data journalist known for his data-rich, insightful coverage of AI news and developments. Armed with a degree in Data Science from IIT Bombay and years of newsroom experience, Karthik merges storytelling with metrics to surface deeper narratives in AI-related events. His writing cuts through hype, revealing the real-world impact of Generative AI on industries, policy, and society. You can reach him out at: [email protected]

- Advertisement -

spot_img

Gen AI News and Updates

spot_img

- Advertisement -