DevEval:一个与真实世界代码仓库对齐的手动标注代码生成基准
DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositories
AI总结:
针对现有基准与真实代码仓库对齐度差的问题,提出手动标注的代码生成基准DevEval,包含1874个样本,并评估8个主流LLM,揭示了其在真实场景中的编码能力与不足。
摘要:
如何评估大型语言模型(LLMs)的编码能力仍是一个悬而未决的问题。我们发现现有的基准与真实世界的代码仓库对齐度差,不足以评估LLMs的编码能力。为了填补这一知识空白,我们提出了一个名为DevEval的新基准,它具有三项优势。(1) DevEval在多个维度(例如代码分布和依赖分布)上与真实世界的仓库对齐。(2) DevEval由13位开发者标注,包含全面的标注(例如需求、原始仓库、参考代码和参考依赖)。(3) DevEval包含来自117个仓库的1,874个测试样本,覆盖10个热门领域(例如互联网、数据库)。基于DevEval,我们提出了仓库级代码生成,并在DevEval上评估了8个流行的LLMs(例如gpt-4、gpt-3.5、StarCoder 2、DeepSeek Coder、CodeLLaMa)。我们的实验揭示了这些LLMs在真实世界代码仓库中的编码能力。例如,在我们的实验中,gpt-4-turbo的最高Pass@1仅为53.04%。我们还分析了LLMs的失败案例并总结了其不足之处。我们希望DevEval能促进LLMs在真实代码仓库中的发展。DevEval、提示词和LLMs的预测结果已发布。
英文摘要:
How to evaluate the coding abilities of Large Language Models (LLMs) remains an open question. We find that existing benchmarks are poorly aligned with real-world code repositories and are insufficient to evaluate the coding abilities of LLMs. To address the knowledge gap, we propose a new benchmark named DevEval, which has three advances. (1) DevEval aligns with real-world repositories in multiple dimensions, e.g., code distributions and dependency distributions. (2) DevEval is annotated by 13 developers and contains comprehensive annotations (e.g., requirements, original repositories, reference code, and reference dependencies). (3) DevEval comprises 1,874 testing samples from 117 repositories, covering 10 popular domains (e.g., Internet, Database). Based on DevEval, we propose repository-level code generation and evaluate 8 popular LLMs on DevEval (e.g., gpt-4, gpt-3.5, StarCoder 2, DeepSeek Coder, CodeLLaMa). Our experiments reveal these LLMs' coding abilities in real-world code repositories. For example, in our experiments, the highest Pass@1 of gpt-4-turbo is only 53.04%. We also analyze LLMs' failed cases and summarize their shortcomings. We hope DevEval can facilitate the development of LLMs in real code repositories. DevEval, prompts, and LLMs' predictions have been released.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。