Manuscript Offprint

arXiv:2611.06328

EvoCodeAgent: Project-Level Code Generation via Architecture-Code Co-Evolution and Experience-Guided Repair

Qianhui Zhao, Li Zhang, Fang Liu

Qianhui Zhao, Li Zhang, Fang Liu ∗^{*}

School of Computer Science and Engineering,

State Key Laboratory of Complex & Critical Software Environment,

Beihang University

{zhaoqianhui, fangliu}@buaa.edu.cn

Abstract—Project-level code generation aims to automatically synthesize complete software repositories from high-level requirements, producing coherent multi-file systems with well-structured modules and consistent cross-file dependencies. Despite the strong capabilities of large language models (LLMs) in specification understanding and code synthesis, existing approaches still exhibit several critical limitations. First, many methods rely on static architectural designs that cannot adapt during iterative generation, leading to a growing misalignment between architecture and implementation. Second, they lack mechanisms to accumulate and reuse experience across iterations, resulting in recurring errors and reduced efficiency. Third, they often depend on standalone LLM-based evaluation of intermediate artifacts, which suffer from limited transparency and potential unreliability under long-context reasoning. To address these challenges, we propose EVOCODEAGENT, a state-centric framework for project-level code generation. EVOCODEAGENT maintains an evolving architectural state initialized from structured project specifications and continuously reconciles predicted relations from architecture and skeletons with realized relations extracted from generated code. It further uses tool-grounded verification evidence to support reliable state updates and abstracts reusable repair experiences from previous revision attempts to guide subsequent generation. Extensive experiments on project-level benchmarks of different scales, including DevBench and CodeProjectEval, demonstrate that EVOCODEAGENT consistently outperforms baseline approaches. Under the GPT-5 setting, it achieves unit test pass rates of 60.48% and 27.73%, respectively, yielding up to a 53.5% improvement over the strongest baseline.

Index Terms—Project-Level Code Generation, Multi-Agent Framework, Large Language Models

I. INTRODUCTION

Project-level code generation aims to automatically synthesize an entire project from high-level requirement descriptions, including its file organization and executable implementations [1, 2, 3]. In real-world software engineering, developers typically build complete software repositories consisting of multiple files, modules, and interdependent components rather than isolated code snippets. As software development increasingly relies on automated assistance to improve productivity and reduce engineering effort [4, 5, 6, 7, 8, 9], enabling large language models (LLMs) to generate project-scale systems has become an important research goal. Compared with traditional code generation tasks that focus on producing individual functions or small code fragments based on localized contexts [10, 11, 12, 13, 14], project-level code generation requires LLMs to construct coherent multi-file systems with well-organized modules and consistent cross-file dependencies. Consequently, it represents a substantially more challenging yet practically important problem in automated software engineering.

Recent research has made progress in project-level code generation. As state-of-the-art LLMs such as Claude [15], DeepSeek [16, 17, 18], Gemini [19, 20], and GPT [21, 22] demonstrate strong capabilities in understanding natural language specifications and generating high-quality code, LLM-based approaches [2, 23, 24, 25, 26, 27, 28, 29] have become the main force in this task. Despite these encouraging results, existing approaches still face several important limitations:

Static architectural representations cannot capture architectural evolution throughout the implementation process. Many existing approaches [2, 23, 24, 26] directly generate code from requirement descriptions without explicitly introducing an architectural design stage, which may suffer from the semantic gap between natural language requirements and executable code. To mitigate this issue, some recent methods [25, 27] incorporate structured intermediate representations as architectural guidance. However, these representations are typically constructed at an early planning stage and are mainly used as fixed blueprints during subsequent generation. Such a design is inherently limited, as architectural specifications produced before implementation may be incomplete or inaccurate due to ambiguous requirements and missing low-level details. As generation proceeds, skeletons may introduce new imports, implementations may revise interfaces, and execution feedback may reveal missing or inconsistent components. These implementation-derived facts naturally require the architectural representation to be revisited and updated. Without continuously reconciling predicted architectural relations with realized implementation relations, later generation steps may rely on outdated dependencies or incomplete interfaces, leading to architecture-code drift.

Iterative feedback lacks reusable experience abstrac-tion. Project-level code generation typically involves multiple rounds of iterative refinement, during which LLMs may repeatedly encounter similar issues, such as missing dependencies, inconsistent interfaces, import failures, or incomplete implementations. However, existing approaches [25] mainly use feedback, local diffs, or recent revision histories as contextual memory for the current iteration. Although such information can support local fixes, it is often tightly coupled with specific files, error traces, and code contexts. As a result, when similar issues reappear in later stages or different files, LLMs may struggle to transfer prior repair knowledge and may repeatedly make the same mistakes. Without mechanisms to abstract concrete refinement trajectories into context-independent repair scenarios and strategies, iterative feedback may not effectively guide subsequent generations beyond the immediate local fix.

⑧ Standalone LLM-based judgments provide limited reliability for intermediate artifact validation. Multi-stage code generation frameworks typically produce a series of intermediate artifacts that should be validated before proceeding to subsequent steps. In many existing approaches [23, 24, 25, 29], this validation is predominantly handled by LLM-based judges in a standalone manner, without sufficient support from external tools or structured verification mechanisms. In practice, these evaluations often require LLMs to assess large-scale natural language descriptions or code artifacts under complex long-context settings. Due to inherent limitations in long-context reasoning, such as context dilution and attention degradation, LLMs may fail to consistently incorporate all relevant information [30, 31], leading to unstable or inconsistent judgments. Moreover, standalone judgments usually provide limited verifiable evidence about which files, interfaces, dependencies, or requirements are missing or inconsistent. This lack of actionable evidence makes the results difficult to verify and limits their usefulness for state updates and targeted repair.

To address these limitations, we propose EVOCODEAGENT, a state-centric project-level code generation framework. Instead of treating artifact as a static intermediate representation, EVOCODEAGENT maintains an evolving project state throughout generation. The state is initialized from project requirements and continuously updated throughout generation using verification feedback, allowing architecture to guide code generation while enabling generated artifacts to refine architectural decisions. In addition, EVOCODEAGENT grounds intermediate evaluation with specialized verification tools, producing explicit evidence for state reconciliation and repair. Finally, it abstracts reusable repair experiences from refinement trajectories, allowing recurring error patterns to be addressed with accumulated knowledge rather than rediscovered from scratch. Experimental results demonstrate that EVOCODEAGENT achieves state-of-the-art performance on project-level code generation tasks. Under the GPT-5 setting, EVOCODEAGENT attains a unit test pass rate of 60.48% on the small-scale DevBench benchmark and 27.73% on the larger-scale CodeProjectEval benchmark, yielding up to a 53.5% relative improvement over the strongest baseline.

Our contributions can be summarized as follows:

  • We identify key limitations in existing project-level code generation frameworks, including static architecture-code misalignment, limited reuse of iterative repair experience, and unreliable standalone LLM-based evaluation.

  • We propose EVOCODEAGENT, a state-centric project-level code generation framework. It maintains an evolving project state to support architecture-code co-evolution, tool-grounded verification, and experience-guided repair.

  • We conduct extensive experiments on project-level benchmarks of different scales, including DevBench and CodeProjectEval. Results show that EVOCODEAGENT consistently and significantly outperforms strong baselines under various experimental settings. Our code can be found at https://github.com/whisperzqh/EvoCodeAgent.git.

References (42)