paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automated Program Repair in the Era of Large Pre-trained Language Models

大预训练语言模型时代的自动程序修复
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 4/10 · 论文研究LLM直接用于自动程序修复(APR),属于LLM+软件工程的邻近方向,但与用户核心关注的静态分析、形式化验证、浮点/贝叶斯程序分析及Agentic程序分析无直接交集。其目标主要是评估LLM在APR任务上的能力,而非将LLM作为工具改进静态分析。引用 402 inbox
Chunqiu Steven Xia, Yuxiang Wei, Lingming Zhang
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:首次系统研究直接使用9个最新LLM进行自动程序修复,在3种语言5个数据集上大幅超越现有APR技术。

自动程序修复(APR)旨在自动修补软件缺陷,但传统与学习型方法依赖修复数据集构造模板或直接预测补丁,补丁多样性有限,难以处理复杂缺陷。本文首次系统研究直接使用大预训练语言模型(LLM)进行APR:选取9个最新模型(125M–20B,涵盖生成式与infilling),设计三种修复设置(整函数生成、前后缀填充、单行修复),在3种语言5个数据集上考察修复数、速度与编译率,并与最新APR工具比较。直接用SOTA LLM在各数据集上均大幅超越现有APR技术,且存在规模效应;infilling中缺陷行后的suffix能带来更多、编译率更高的补丁;LLM还可按自然度进行补丁排序与正确性检查;增大采样或融入模板信息能进一步提升。

问题
现有传统与学习型APR技术依赖修复数据集(构造模板或直接预测补丁),导致补丁多样性有限,难以修复复杂缺陷。
方法
直接使用9个最新LLM(125M–20B,含生成式与infilling),设计三种修复设置:生成整个补丁函数、按前后缀填充代码块、输出单行修复,并与最新APR工具对比。
评估
在3种语言、5个数据集上按修复缺陷数、生成速度与编译率评估各LLM;还比较其补丁排序与正确性检查能力,并考察增大采样规模和融入修复模板信息的增益。
原文摘要(Abstract)

Automated Program Repair (APR) aims to help developers automatically patch software bugs. However, current state-of-the-art traditional and learning-based APR techniques face the problem of limited patch variety, failing to fix complicated bugs. This is mainly due to the reliance on bug-fixing datasets to craft fix templates (traditional) or directly predict potential patches (learning-based). Large Pre-Trained Language Models (LLMs), trained using billions of text/code tokens, can potentially help avoid this issue. Very recently, researchers have directly leveraged LLMs for APR without relying on any bug-fixing datasets. Meanwhile, such existing work either failed to include state-of-the-art LLMs or was not evaluated on realistic datasets. Thus, the true power of modern LLMs on the important APR problem is yet to be revealed. In this work, we perform the first extensive study on directly applying LLMs for APR. We select 9 recent state-of-the-art LLMs, including both generative and infilling models, ranging from 125M to 20B in size. We designed 3 different repair settings to evaluate the different ways we can use LLMs to generate patches: 1) generate the entire patch function, 2) fill in a chunk of code given the prefix and suffix 3) output a single line fix. We apply the LLMs under these repair settings on 5 datasets across 3 different languages and compare different LLMs in the number of bugs fixed, generation speed and compilation rate. We also compare the LLMs against recent state-of-the-art APR tools. Our study demonstrates that directly applying state-of-the-art LLMs can already substantially outperform all existing APR techniques on all our datasets. Among the studied LLMs, the scaling effect exists for APR where larger models tend to achieve better performance. Also, we show for the first time that suffix code after the buggy line (adopted in infilling-style APR) is important in not only generating more fixes but more patches with higher compilation rate. Besides patch generation, the LLMs consider correct patches to be more natural than other ones, and can even be leveraged for effective patch ranking or patch correctness checking. Lastly, we show that LLM-based APR can be further substantially boosted via: 1) increasing the sample size, and 2) incorporating fix template information.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{XiaWZ23,
  title = {Automated Program Repair in the Era of Large Pre-trained Language Models},
  author = {Chunqiu Steven Xia and Yuxiang Wei and Lingming Zhang},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00129}
}