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.


翻译:自动程序修复旨在为输入的错误程序自动生成补丁。传统APR工具通常通过模板、启发式规则和形式化规范聚焦于特定缺陷类型和修复方法。然而,这些技术在可处理的缺陷类型和补丁多样性方面存在局限。为此,研究者设计了多种基于学习的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时代塑性手术假说的光明前景。

0
下载
关闭预览

相关内容

这个新版本的工具会议系列恢复了从1989年到2012年的50个会议的传统。工具最初是“面向对象语言和系统的技术”,后来发展到包括软件技术的所有创新方面。今天许多最重要的软件概念都是在这里首次引入的。2019年TOOLS 50+1在俄罗斯喀山附近举行,以同样的创新精神、对所有与软件相关的事物的热情、科学稳健性和行业适用性的结合以及欢迎该领域所有趋势和社区的开放态度,延续了该系列。 官网链接:http://tools2019.innopolis.ru/
基于预训练语言模型的文本生成
专知会员服务
29+阅读 · 2022年1月28日
知识增强预训练语言模型:全面综述
专知会员服务
97+阅读 · 2021年10月19日
【知识图谱@EMNLP2020】Knowledge Graphs in NLP @ EMNLP 2020
专知会员服务
43+阅读 · 2020年11月22日
【斯坦福大学】Gradient Surgery for Multi-Task Learning
专知会员服务
47+阅读 · 2020年1月23日
「知识增强预训练语言模型」最新研究综述
专知
18+阅读 · 2022年11月18日
NAACL 2022 | 基于Prompt的文本生成迁移学习
PaperWeekly
1+阅读 · 2022年8月31日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
【论文】图上的表示学习综述
机器学习研究会
15+阅读 · 2017年9月24日
国家自然科学基金
0+阅读 · 2016年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
0+阅读 · 2023年5月5日
A Survey of Large Language Models
Arxiv
501+阅读 · 2023年3月31日
VIP会员
最新内容
无人机已改变战场,但并未解决指挥问题
专知会员服务
5+阅读 · 8月14日
驱动军事决策变革的顶尖人工智能指挥系统
专知会员服务
11+阅读 · 8月11日
非对称防御中的自组织临界性:俄乌战争
专知会员服务
10+阅读 · 8月10日
《战争中的大语言模型监管》
专知会员服务
17+阅读 · 8月10日
相关资讯
相关基金
国家自然科学基金
0+阅读 · 2016年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员