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

HumanEvo:一个用于更真实评估仓库级代码生成的演化感知基准

HumanEvo: An Evolution-aware Benchmark for More Realistic Evaluation of Repository-level Code Generation

Dewu Zheng, Yanlin Wang, Ensheng Shi, Ruikai Zhang, Yuchi Ma, Hongyu Zhang, Zibin Zheng

AI总结:

本文提出演化感知仓库级代码生成基准 HumanEvo,结合自动化执行评估与依赖层级分类,揭示传统设置对 LLM 性能高估达 10.0%–61.1%。

摘要:

为了评估大型语言模型(LLM)在复杂真实软件开发场景中的仓库级代码生成能力,许多评估方法已经被开发出来。这些方法通常利用项目最新版本中的上下代码来帮助 LLM 准确生成所需函数。然而,此类评估方法没有考虑软件项目随时间的动态演化,我们将其称为忽略演化的设置。这进而导致对 LLM 性能的评估不准确。本文中,我们开展了一项实证研究,以深入理解 LLM 在反映软件开发演化本质的设置下的代码生成性能。为此,我们首先构建了一个演化感知的仓库级代码生成数据集,即 HumanEvo,并配备了一个基于执行的自动化评估工具。其次,我们根据依赖级别对 HumanEvo 进行人工分类,以更全面地分析模型在生成具有不同依赖级别的函数时的性能。第三,我们在 HumanEvo 上使用七个具有代表性且多样化的 LLM 进行了大量实验,以验证所提出基准的有效性。通过实验研究,我们获得了若干重要发现。例如,我们发现以往忽略演化的评估方法会导致 LLM 的性能虚高;与演化感知评估方法相比,在不同的上下文获取方法下,性能高估幅度为 10.0% 至 61.1%。基于这些发现,我们为更真实地评估 LLM 的代码生成能力给出了可操作建议。我们还构建了一个共享的演化感知代码生成工具箱,以促进未来研究。

英文摘要:

To evaluate the repository-level code generation capabilities of Large Language Models (LLMs) in complex real-world software development scenarios, many evaluation methods have been developed. These methods typically leverage contextual code from the latest version of a project to assist LLMs in accurately generating the desired function. However, such evaluation methods fail to consider the dynamic evolution of software projects over time, which we refer to as evolution-ignored settings. This in turn results in inaccurate evaluation of LLMs' performance. In this paper, we conduct an empirical study to deeply understand LLMs' code generation performance within settings that reflect the evolution nature of software development. To achieve this, we first construct an evolution-aware repository-level code generation dataset, namely HumanEvo, equipped with an automated execution-based evaluation tool. Second, we manually categorize HumanEvo according to dependency levels to more comprehensively analyze the model's performance in generating functions with different dependency levels. Third, we conduct extensive experiments on HumanEvo with seven representative and diverse LLMs to verify the effectiveness of the proposed benchmark. We obtain several important findings through our experimental study. For example, we find that previous evolution-ignored evaluation methods result in inflated performance of LLMs, with performance overestimations ranging from 10.0% to 61.1% under different context acquisition methods, compared to the evolution-aware evaluation approach. Based on the findings, we give actionable suggestions for more realistic evaluation of LLMs on code generation. We also build a shared evolution-aware code generation toolbox to facilitate future research.

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

↑