[Paper Review] EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositories
EvoCodeBench is a real-repo-aligned code generation benchmark with comprehensive annotations and an evolving pipeline, evaluated on 10 LLMs for repository-level code generation.
How to evaluate Large Language Models (LLMs) in code generation is an open question. Existing benchmarks demonstrate poor alignment with real-world code repositories and are insufficient to evaluate the coding abilities of LLMs. This paper proposes a new benchmark - EvoCodeBench to address the preceding problems, which has three primary advances. (1) EvoCodeBench aligns with real-world repositories in multiple dimensions, e.g., code distributions and dependency distributions. (2) EvoCodeBench offers comprehensive annotations (e.g., requirements, reference code, and reference dependencies), and robust evaluation metrics (e.g., Pass@k and Recall@k). (3) EvoCodeBench is an evolving benchmark to avoid data leakage. We build an automatic pipeline to update EvoCodeBench from the latest repositories. We release the first version - EvoCodeBench-2403, containing 275 samples from 25 real-world repositories. Based on EvoCodeBench, we propose repository-level code generation and evaluate 10 popular LLMs (e.g., gpt-4, gpt-3.5, DeepSeek Coder, StarCoder 2, CodeLLaMa, Gemma, and Qwen 1.5). Our experiments reveal the coding abilities of these LLMs in real-world repositories. For example, the highest Pass@1 of gpt-4 only is 20.73% in our experiments. We also analyze failed cases and summarize the shortcomings of existing LLMs in EvoCodeBench. We release EvoCodeBench, all prompts, and LLMs' completions for further community analysis.
Motivation & Objective
- Argue that existing benchmarks poorly align with real-world code repositories.
- Propose EvoCodeBench with real-world distributions, comprehensive annotations, and robust metrics.
- Introduce an evolving benchmark pipeline to mitigate data leakage and keep benchmarks up to date.
- Define repository-level code generation as a realistic evaluation scenario.
- Evaluate popular LLMs to reveal their strengths and limitations in real repositories.
Proposed method
- Construct EvoCodeBench from real-world Python repositories with alignment in code and dependency distributions.
- Annotate samples with requirements, reference code, reference dependencies, and test cases.
- Use Pass@k as a functional correctness metric and Recall@k to assess dependency recall.
- Operate an evolving benchmark pipeline with semi-automatic requirement generation and periodic updates.
- Evaluate a set of 10 LLMs (e.g., GPT-4, GPT-3.5, StarCoder 2, CodeLLaMa, Gemma, Qwen 1.5, DeepSeek Coder) under multiple context settings.
- Define repository-level code generation tasks that simulate writing code within a repository given a requirement and context.
Experimental results
Research questions
- RQ1How does EvoCodeBench align with distributions found in real-world repositories (code and dependencies)?
- RQ2Can repository-level code generation better reflect developers’ coding processes than standalone function benchmarks?
- RQ3What are the performance and failure modes of current LLMs on repository-level code generation?
- RQ4Do contexts from repositories (local files, cross-file dependencies) improve LLM performance in repository-level tasks?
- RQ5How do evaluation metrics like Pass@k and Recall@k reflect LLM capabilities and limitations in real-world repos?
Key findings
- EvoCodeBench-2403 contains 275 samples from 25 real-world repositories and aligns with distributions observed in 500 real-world repos.
- The benchmark provides comprehensive annotations including requirements, reference code, reference dependencies, and repository context with dependency paths.
- 10 popular LLMs show much lower Pass@k scores on EvoCodeBench-2403 than on traditional benchmarks (e.g., GPT-4’s Pass@1 drops from up to 88.4 on HumanEval to 7.27 on EvoCodeBench-2403).
- Contextual information from local files substantially improves performance; for GPT-4, Pass@1 increases by up to ~152% in certain settings.
- Recall@k highlights dependency recall challenges, with cross-file dependencies benefiting from local context but still prone to mismatches or omissions.
- Retrieval-Augmented Generation with similar functions improves Pass@1 and Recall@1, showing value in leveraging repository-level context.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.