NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Towards Realistic Project-Level Code Generation via Multi-Agent Collaboration and Semantic Architecture Modeling

Qianhui Zhao, Li Zhang, Fang Liu, Junhang Cheng, Chengru Wu, Junchen Ai, Qiaoyuanhe Meng, Xiaoli Lian, Shubin Song, Yuanping GuoarXiv 2025 · DOI

Abstract

Generating an entire software repository from a single prompt is significantly more complex than writing isolated functions. This paper introduces ProjectGen, a multi-agent framework that bridges the gap between high-level requirements and executable code using a novel Semantic Software Architecture Tree (SSAT). Alongside a more realistic benchmark, CodeProjectEval, the authors demonstrate that iterative, architecturally-aware generation can outperform existing state-of-the-art methods by up to tenfold.

Introduction: The Semantic Gap in Code Generation

While Large Language Models (LLMs) excel at generating isolated code snippets, project-level code generation—creating a complete, multi-file repository from complex requirements—remains a major challenge. The transition from a human-written requirement document to a machine-interpretable file structure involves managing hierarchical dependencies across dozens of files. An error in an early architectural decision often cascades, leading to total project failure.

Comparison between function-level and project-level code generation tasks.

The ProjectGen Framework

ProjectGen decomposes the generation process into three sequential phases, each managed by specialized agents:

  1. Architecture Design: An ArchAgent transforms requirements into a Semantic Software Architecture Tree (SSAT). The SSAT is a structured representation that maps out modules, files, classes, and functions, including their responsibilities and parameters.
  2. Skeleton Generation: A SkeletonAgent uses the SSAT to create the "bones" of the project—file hierarchies and function signatures—ensuring the project is syntactically valid and imports are correctly mapped.
  3. Code Filling: A CodeAgent iteratively fills in the logic for each function, using topological sorting to ensure files are generated in an order that respects their dependencies.

Crucially, each stage includes a Judge Agent that provides feedback and scores. If a stage fails to meet a quality threshold, the system uses a memory-based context management system to reflect on the feedback and refine its output.

Benchmarking with CodeProjectEval

Existing benchmarks often lack the complexity of real-world software. To address this, the researchers developed CodeProjectEval, derived from 18 real-world Python repositories.

A comparison of CodeProjectEval against existing project-level datasets highlights its superior scale and complexity.

CodeProjectEval averages 12.7 files and ~2,388 lines of code per task, making it significantly more complex than previous benchmarks. It includes full documentation (PRDs, UML diagrams) and an average of 186 unit tests per task to ensure functional correctness.

Key Results and Insights

ProjectGen achieved state-of-the-art performance across the board. On the DevBench benchmark, it achieved a 57% improvement over baselines like MetaGPT. On the more challenging CodeProjectEval, it demonstrated a tenfold improvement over baseline approaches, which struggled to generate even basic runnable structures for larger projects. Notably, the framework's effectiveness persists across different base models; even when using DeepSeek-V3, ProjectGen significantly outperformed other frameworks, proving that the multi-agent process and SSAT structure are as critical as the underlying model's capabilities.

The success of ProjectGen highlights that moving directly from text to code is too "lossy." The SSAT acts as a bidirectional bridge, helping the LLM maintain a "global view" of the project's architecture while working on local implementation details. Furthermore, iterative refinement via "Judges" at every step is mandatory to catch architectural errors before they are baked into thousands of lines of code.

Limitations and Future Work

Despite this progress, generating projects exceeding 1,000 lines of code remains difficult. The most common failure point is ImportErrors, where the model loses track of definitions across large directory trees. Future work will focus on human-in-the-loop interactions, extending the framework to other languages like Java or C++, and enabling the model to update existing project architectures.

Summary updated

BibTeX
@misc{zhao2025towards,
  author = {Qianhui Zhao and Li Zhang and Fang Liu and Junhang Cheng and Chengru Wu and Junchen Ai and Qiaoyuanhe Meng and Lichen Zhang and Xiaoli Lian and Shubin Song and Yuanping Guo},
  title = {{Towards Realistic Project-Level Code Generation via Multi-Agent Collaboration and Semantic Architecture Modeling}},
  year = {2025},
  eprint = {2511.03404},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.03404},
}
Figure