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

通过大型语言模型重新审视整形手术假说

Revisiting the Plastic Surgery Hypothesis via Large Language Models

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Chunqiu Steven Xia, Yifeng Ding, Lingming Zhang

AI总结:

本文提出 FitRepair,通过领域特定微调和提示将整形手术假说融入基于 LLM 的自动化程序修复,在 Defects4j 1.2/2.0 上分别修复 89/44 个缺陷,显著优于最佳基线。

摘要:

自动化程序修复(APR)致力于为输入的有缺陷程序自动生成补丁。传统 APR 工具通常通过模板、启发式方法和形式化规范,聚焦于特定的缺陷类型和修复方式。然而,这些技术在能够处理的缺陷类型以及可产生的补丁多样性方面存在局限。因此,研究人员设计了多种基于学习的 APR 工具,近期工作则聚焦于直接将大型语言模型(LLM)用于 APR。尽管基于 LLM 的 APR 工具能够在许多修复数据集上取得最先进性能,但用于直接修复的 LLM 并未充分感知项目特定信息,例如独特的变量名或方法名。整形手术假说是 APR 中一个广为人知的洞见,它指出修复缺陷所需的代码成分通常已经存在于同一项目中。传统 APR 工具在很大程度上利用了整形手术假说,通过设计人工的或基于启发式的方法来挖掘这些现有代码成分。然而,随着近期 APR 研究开始聚焦于基于 LLM 的方法,整形手术假说在很大程度上被忽视。本文提出如下问题:在 LLM 时代,整形手术假说有多大用处?有趣的是,基于 LLM 的 APR 提供了一个独特机会,可以通过微调和提示实现整形手术假说的完全自动化。为此,我们提出 FitRepair,它将直接使用 LLM 与两种领域特定微调策略和一种提示策略相结合,以实现更强大的 APR。我们在被广泛研究的 Defects4j 1.2 和 2.0 数据集上的实验表明,FitRepair 分别修复了 89 个和 44 个缺陷(分别比表现最好的基线显著多出 15 个和 8 个),展示了整形手术假说在 LLM 时代的广阔前景。

英文摘要:

Automated Program Repair (APR) aspires to automatically generate patches for an input buggy program. Traditional APR tools typically focus on specific bug types and fixes through the use of templates, heuristics, and formal specifications. However, these techniques are limited in terms of the bug types and patch variety they can produce. As such, researchers have designed various learning-based APR tools with recent work focused on directly using Large Language Models (LLMs) for APR. While LLM-based APR tools are able to achieve state-of-the-art performance on many repair datasets, the LLMs used for direct repair are not fully aware of the project-specific information such as unique variable or method names. The plastic surgery hypothesis is a well-known insight for APR, which states that the code ingredients to fix the bug usually already exist within the same project. Traditional APR tools have largely leveraged the plastic surgery hypothesis by designing manual or heuristic-based approaches to exploit such existing code ingredients. However, as recent APR research starts focusing on LLM-based approaches, the plastic surgery hypothesis has been largely ignored. In this paper, we ask the following question: How useful is the plastic surgery hypothesis in the era of LLMs? Interestingly, LLM-based APR presents a unique opportunity to fully automate the plastic surgery hypothesis via fine-tuning and prompting. To this end, we propose FitRepair, which combines the direct usage of LLMs with two domain-specific fine-tuning strategies and one prompting strategy for more powerful APR. Our experiments on the widely studied Defects4j 1.2 and 2.0 datasets show that FitRepair fixes 89 and 44 bugs (substantially outperforming the best-performing baseline by 15 and 8), respectively, demonstrating a promising future of the plastic surgery hypothesis in the era of LLMs.

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

↑