Introduction
Large Language Models (LLMs) have demonstrated remarkable proficiency in code generation, often scoring over 80% on standard benchmarks like HumanEval. However, these metrics frequently fail to reflect real-world software engineering performance. Most existing benchmarks focus on "standalone" functions—isolated snippets that rely only on built-in libraries. In contrast, professional development involves "non-standalone" code characterized by complex inter-dependencies across classes, files, and modules. Furthermore, the massive scale of LLM training data raises concerns about "data leakage," where models may simply be recalling solutions to older, static benchmarks.
EvoCodeBench addresses these challenges by providing a repository-level code generation benchmark that evolves over time, ensuring alignment with contemporary coding practices and minimizing the impact of training data cutoffs.
The EvoCodeBench Framework
To maintain a realistic and fresh evaluation environment, EvoCodeBench utilizes an automated pipeline that extracts samples from high-quality, recent Python projects on GitHub. The benchmark is structured to evaluate models on their ability to navigate repository-level context.
The evaluation process involves five key stages:
- Repository Selection: Identifying recent repositories with robust unit test coverage.
- Dependency Mapping: Using static analysis to identify intra-class, intra-file, and cross-file dependencies.
- Test Extraction: Automatically isolating the specific unit tests required to verify a target function.
- Requirement Annotation: Generating high-quality docstrings using GPT-4, followed by manual verification to ensure accuracy.
- Metric Definition: Beyond functional correctness (Pass@k), the benchmark introduces Recall@k to measure how effectively a model identifies and utilizes the necessary repository dependencies.
Dataset Alignment and Composition
The initial iteration, EvoCodeBench-2403, consists of 275 samples from 25 real-world repositories. Unlike HumanEval or MBPP, which are 100% standalone, EvoCodeBench is designed to match the actual distribution of code found in the wild. An analysis of over 1 million functions from 500 repositories revealed that approximately 73% of real-world code is non-standalone; EvoCodeBench mirrors this ratio, providing a significantly more rigorous testbed than its predecessors.
Experimental Results and Analysis
The evaluation of 10 prominent LLMs reveals a stark performance gap when moving from toy problems to repository-level tasks.
The Performance Crash
Top-tier models experience a significant decline in efficacy. GPT-4-turbo-1106, a leader on traditional benchmarks, achieves only a 20.73% Pass@1 on EvoCodeBench in the Local File Infilling setting. This suggests that current LLMs struggle when faced with the architectural complexity of real-world projects.
The Context Gap
Contextual awareness is critical for success. Models generating code without repository context often "hallucinate" APIs. Providing local file context can improve performance by over 150%, yet even with this information, models frequently fail to resolve cross-file dependencies. Interestingly, open-source models like DeepSeek Coder 33B show high competitive parity, actually exceeding GPT-4 in Recall@1 (71.46% vs 68.24%), indicating a superior ability to identify necessary external references.
Instruction Tuning Trade-offs
Analysis suggests that instruction-tuned models (like the GPT family) tend to be more "conservative," prioritizing functional correctness within the immediate scope. In contrast, standard language models are often more "aggressive" in attempting to integrate surrounding repository context, leading to higher dependency recall but occasionally lower functional accuracy.
Conclusion
EvoCodeBench highlights a critical need for LLM evaluation to move beyond standalone functions. The benchmark reveals that while models are proficient at logic, they struggle with the dependency management inherent in real-world software engineering. Future iterations will expand to include more programming languages and explore how Retrieval-Augmented Generation (RAG) and tool-augmented workflows can bridge the current context gap.
Summary updated