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

基于LLM的程序修复中的事实选择问题

The Fact Selection Problem in LLM-Based Program Repair

Nikhil Parasaram, Huijie Yan, Boyu Yang, Zineb Flahy, Abriele Qudsi, Damian Ziaber, Earl Barr, Sergey Mechtaev

AI总结:

针对LLM程序修复中事实数量非单调有效的问题,本文定义事实选择问题并提出统计模型Maniple,针对特定bug选择事实,在157个bug测试集上修复88个,较最佳配置提升17%。

摘要:

最近的研究表明,将与bug相关的事实(如堆栈跟踪和GitHub issues)纳入提示中可以增强大型语言模型(LLMs)的bug修复能力。考虑到这些模型的上下文窗口不断增加,一个关键问题出现了:应在提示中包含什么以及多少事实,以最大化正确修复bug的机会?为了回答这个问题,我们进行了一项大规模研究,使用了超过19K个提示,包含七种不同事实的各种组合,以修复BugsInPy基准中开源Python项目的314个bug。我们的发现表明,每种事实都是有益的,从简单的语法细节(如代码上下文)到以前在LLM上下文中未探索过的语义信息(如angelic values)。具体而言,每种事实都有助于修复一些bug,如果没有它,这些bug将保持未解决或仅以低成功率修复。重要的是,我们发现程序修复提示的有效性在使用的事实数量上是非单调的;使用过多事实会导致结果不佳。这些见解促使我们定义了事实选择问题:确定要在提示中包含的最佳事实集合,以最大化LLM在给定任务实例上的性能。我们发现,对于bug修复,没有一套通用的事实集合。因此,我们开发了一个名为Maniple的基本统计模型,该模型选择特定于给定bug的事实以包含在提示中。该模型显著超越了最佳通用事实集的性能。为了强调事实选择问题的重要性,我们将Maniple与最先进的零样本、非对话式基于LLM的bug修复方法进行了基准测试。在我们包含157个bug的测试数据集上,Maniple修复了88个bug,比最佳配置高出17%。

英文摘要:

Recent research has shown that incorporating bug-related facts, such as stack traces and GitHub issues, into prompts enhances the bug-fixing capabilities of large language models (LLMs). Considering the ever-increasing context window of these models, a critical question arises: what and how many facts should be included in prompts to maximise the chance of correctly fixing bugs? To answer this question, we conducted a large-scale study, employing over 19K prompts featuring various combinations of seven diverse facts to rectify 314 bugs from open-source Python projects within the BugsInPy benchmark. Our findings revealed that each fact, ranging from simple syntactic details like code context to semantic information previously unexplored in the context of LLMs such as angelic values, is beneficial. Specifically, each fact aids in fixing some bugs that would remain unresolved or only be fixed with a low success rate without it. Importantly, we discovered that the effectiveness of program repair prompts is non-monotonic over the number of used facts; using too many facts leads to subpar outcomes. These insights led us to define the fact selection problem: determining the optimal set of facts for inclusion in a prompt to maximise LLM's performance on a given task instance. We found that there is no one-size-fits-all set of facts for bug repair. Therefore, we developed a basic statistical model, named Maniple, which selects facts specific to a given bug to include in the prompt. This model significantly surpasses the performance of the best generic fact set. To underscore the significance of the fact selection problem, we benchmarked Maniple against the state-of-the-art zero-shot, non-conversational LLM-based bug repair methods. On our testing dataset of 157 bugs, Maniple repairs 88 bugs, 17% above the best configuration.

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

↑