환경 정렬을 통한 실행 가능한 레포지토리 수준 코드 생성 연구
Toward Executable Repository-Level Code Generation via Environment Alignment
대규모 언어 모델(LLM)은 코드 생성 분야에서 뛰어난 성능을 보이고 있지만, 기존 방법은 여전히 실행 가능한 검증 환경 하에서 레포지토리 수준의 코드 생성에 어려움을 겪고 있습니다. 이러한 평가 환경에서 성공은 개별 코드 조각의 타당성 여부가 아니라, 생성된 다중 파일 레포지토리가 실제 실행 환경에서 성공적으로 설치되고, 의존성과 내부 참조가 해결되며, 실행되고, 검증되는지에 따라 결정됩니다. 이러한 문제점을 해결하기 위해, 우리는 레포지토리 수준의 코드 생성을 위한 프레임워크인 EnvGraph을 제안합니다. EnvGraph은 레포지토리의 실행 가능성을 환경 정렬 문제로 정의합니다. EnvGraph은 외부 의존성 만족과 레포지토리 내부 참조 해결이라는 성공적인 레포지토리 실행을 위한 두 가지 상호 관련된 조건을 동시에 모델링합니다. 또한, EnvGraph은 이중 계층의 환경 표현을 사용하고, 실행 증거를 기반으로 실행 증거 기반의 추론을 수행하며, 반복적인 정렬 루프 내에서 통일된 목표 수정 메커니즘을 통해 레포지토리 생성을 안내합니다. 우리는 EnvGraph을 세 가지 대표적인 기반 LLM을 사용하여 레포지토리 수준의 코드 생성에 적용하고, 대표적인 환경 인식 및 레포지토리 수준의 기준 모델과 비교했습니다. 실험 결과는 EnvGraph이 이러한 레포지토리 수준의 벤치마크에서 일관되게 가장 뛰어난 성능을 달성함을 보여줍니다. 특히, EnvGraph은 가장 강력한 EnvGraph이 아닌 기준 모델보다 기능적 정확성에서 5.72~5.87%p, 비기능적 품질에서 4.58~8.66%p의 절대적인 성능 향상을 보였습니다.
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 execution evidence to perform execution-evidence-based attribution, and guides repository generation through a unified targeted revision mechanism within an iterative alignment loop. We evaluate EnvGraph on repository-level code generation with three representative backbone LLMs and compare it against representative environment-aware and repository-level baselines. Experimental results show that EnvGraph consistently achieves the best performance on these repository-level benchmarks. In particular, it outperforms the strongest non-EnvGraph baseline by an absolute margin of 5.72--5.87 percentage points in Functional Correctness and 4.58--8.66 percentage points in Non-Functional Quality.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.