arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.00599cs.CLcs.AIcs.SE
收藏

EvoCodeBench:一个与现实世界代码仓库对齐的演进式代码生成基准

EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositories

School of Computer Science, Peking University(北京大学计算机学院)

Jia Li, Ge Li, Xuanming Zhang, Yihong Dong, Zhi Jin

AI总结:

本文提出EvoCodeBench基准,通过多维度对齐真实仓库、全面标注与演进更新机制,评估LLMs的仓库级代码生成能力,并实验揭示现有模型表现不足。

摘要:

如何评估大语言模型(LLMs)在代码生成中的表现是一个开放性问题。现有基准与现实世界代码仓库的对齐程度较差,不足以评估LLMs的编码能力。本文提出一个新的基准——EvoCodeBench,以解决上述问题,该基准具有三个主要进展。(1)EvoCodeBench在多个维度上与现实世界仓库对齐,例如代码分布和依赖分布。(2)EvoCodeBench提供全面的标注(例如需求、参考代码和参考依赖)以及稳健的评估指标(例如Pass@k和Recall@k)。(3)EvoCodeBench是一个演进式基准,以避免数据泄漏。我们构建了一个自动化流水线,从最新的仓库中更新EvoCodeBench。我们发布了第一个版本——EvoCodeBench-2403,包含来自25个现实世界仓库的275个样本。基于EvoCodeBench,我们提出了仓库级代码生成,并评估了10个流行的大语言模型(例如gpt-4、gpt-3.5、DeepSeek Coder、StarCoder 2、CodeLLaMa、Gemma和Qwen 1.5)。我们的实验揭示了这些LLMs在现实世界仓库中的编码能力。例如,在我们的实验中,gpt-4的最高Pass@1仅为20.73%。我们还分析了失败案例,并总结了现有LLMs在EvoCodeBench中的不足。我们发布了EvoCodeBench、所有提示以及LLMs的补全结果,供社区进一步分析。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑