Toward Executable Repository-Level Code Generation via Environment Alignment
Ruwei Pan, Junlei Shen, Linhao Wu, Yueheng Zhu, Zixiong Yang, Yakun Zhang, Lu Zhang, Hongyu Zhang

TL;DR
This paper introduces EnvGraph, a novel framework for repository-level code generation that aligns environment conditions to ensure executable, installable, and valid multi-file repositories using large language models.
Contribution
EnvGraph formulates repository executability as an environment alignment problem, jointly modeling dependency satisfaction and internal reference resolution for improved code generation.
Findings
EnvGraph outperforms baseline methods in functional correctness.
It achieves 5.72-5.87% higher functional correctness.
It improves non-functional quality by 4.58-8.66%.
Abstract
Large language models (LLMs) have achieved strong performance on code generation, but existing methods still struggle with repository-level code generation under executable validation. Under this evaluation setting, success is determined not by the plausibility of isolated code fragments, but by whether a generated multi-file repository can be successfully installed, have its dependencies and internal references resolved, be launched, and be validated in a real execution environment. To address this challenge, we propose EnvGraph, a framework for repository-level code generation that formulates repository executability as an environment alignment problem. EnvGraph jointly models two coupled conditions for successful repository execution, namely external dependency satisfaction and repository-internal reference resolution. It maintains a dual-layer environment representation, uses…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
