arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2410.21647cs.SEcs.CL
收藏

语言模型能取代程序员进行编程吗?REPOCOD 说“还不能”

Can Language Models Replace Programmers for Coding? REPOCOD Says 'Not Yet'

Purdue University(普渡大学)

Shanchao Liang, Yiran Hu, Nan Jiang, Lin Tan

AI总结:

针对现有基准无法代表真实编程任务的问题,提出 Python 代码生成基准 REPOCOD,包含 980 个来自 11 个项目的完整函数生成任务;评估十个 LLMs 发现最高 pass@1 均低于 30%,证明当前模型尚无法替代程序员,且检索增强生成效果优于依赖上下文。

摘要:

最近,涌现出多个仓库级代码生成基准(如 CoderEval、DevEval、RepoEval、RepoBench 和 LongCodeArena),用于评估大型语言模型(LLMs)在 HumanEval 和 MBPP 等独立基准之外的能力。因此,一个自然的问题是:LLMs 在这些基准测试中的表现是否与其在现实世界编程任务中的表现相似?遗憾的是,无法回答这个问题,因为这些基准由简短的补全、合成示例组成,或仅关注有限规模的仓库,未能代表真实的编程任务。为应对这些挑战,我们创建了 REPOCOD,这是一个 Python 代码生成基准,包含现实世界大型项目中具有真实依赖关系的复杂任务,以及用于评估源代码的合适指标。它包含来自 11 个流行项目的 980 个完整函数生成任务,其中 50.8% 需要仓库级上下文。REPOCOD 为每个实例包含 314 个开发者编写的测试用例以进行更好的评估。我们在 REPOCOD 上评估了十个 LLMs,发现没有一个在 REPOCOD 上的 pass@1 超过 30%,这表明构建能够在现实世界软件开发中帮助开发者的更强 LLMs 的必要性。此外,我们发现检索增强生成比使用目标函数依赖作为上下文取得了更好的结果。

英文摘要:

Recently, a number of repository-level code generation benchmarks-such as CoderEval, DevEval, RepoEval, RepoBench, and LongCodeArena-have emerged to evaluate the capabilities of large language models (LLMs) beyond standalone benchmarks like HumanEval and MBPP. Thus, a natural question is, would LLMs have similar performance in real world coding tasks as their performance in these benchmarks? Unfortunately, one cannot answer this question, since these benchmarks consist of short completions, synthetic examples, or focus on limited scale repositories, failing to represent real-world coding tasks. To address these challenges, we create REPOCOD, a Python code-generation benchmark containing complex tasks with realistic dependencies in real-world large projects and appropriate metrics for evaluating source code. It includes 980 whole-function generation tasks from 11 popular projects, 50.8% of which require repository-level context. REPOCOD includes 314 developer-written test cases per instance for better evaluation. We evaluate ten LLMs on REPOCOD and find that none achieves more than 30% pass@1 on REPOCOD, indicating the necessity of building stronger LLMs that can help developers in real-world software development. In addition, we found that retrieval-augmented generation achieves better results than using target function dependencies as context.

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

↑