paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Large Language Models for Test-Free Fault Localization

用于无测试故障定位的大型语言模型
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 4/10 · 论文将LLM用于无测试的故障定位,属于程序调试与软件工程方向,与用户核心关注的静态分析、形式化验证、浮点/贝叶斯程序分析交叉较少;且主要贡献是基于LLM微调适配器,并非将LLM作为工具改进静态分析,也未涉及Agentic程序或工业落地案例。引用 121 inbox
Aidan Z. H. Yang, Claire Le Goues, Ruben Martins, Vincent Hellendoorn
crossref: 2026-09-12

AI 速览

一句话:提出 LLMAO:首个无需测试覆盖、基于 LLM 的代码行级故障定位方法,性能优于 MLFL 基线。

故障定位是调试的关键步骤,但现有方法通常依赖输入测试,并需要大量程序分析、插桩或数据预处理;面向自动程序修复的深度学习也受限于小数据集。本文提出 LLMAO,一种基于大型语言模型的代码行级故障定位方法。为克服 LLM 从左到右建模的限制,作者在 LLM 表示之上微调少量双向适配器层,并在 Defects4J 等人工整理的小规模缺陷程序语料上微调 350M、6B 和 16B 参数模型,无需测试覆盖信息。实验表明,LLMAO 相比最先进的机器学习故障定位基线在 Top-1 上提升 2.3%--54.4%,Top-5 提升 14.4%--35.6%,性能随模型规模一致扩展,并能将安全漏洞定位到代码行级别。

问题
现有故障定位技术通常需要输入测试,并依赖大量程序分析、插桩或预处理;深度学习自动程序修复又难以从小数据集学习,在真实程序上效果有限。本文研究能否利用代码大模型在少样本下进行代码行级故障定位。
方法
在 LLM 表示上微调少量双向适配器层以克服其从左到右局限,并在 Defects4J 等人工整理的缺陷程序语料上微调 350M、6B、16B 参数模型,无需测试覆盖信息。
评估
在人工整理的缺陷程序语料上评估,与最先进的机器学习故障定位基线比较 Top-1 和 Top-5 指标,并考察性能随 LLM 规模扩展的情况及安全漏洞定位能力。
原文摘要(Abstract)

Fault Localization (FL) aims to automatically localize buggy lines of code, a key first step in many manual and automatic debugging tasks. Previous FL techniques assume the provision of input tests, and often require extensive program analysis, program instrumentation, or data preprocessing. Prior work on deep learning for APR struggles to learn from small datasets and produces limited results on real-world programs. Inspired by the ability of large language models (LLMs) of code to adapt to new tasks based on very few examples, we investigate the applicability of LLMs to line level fault localization. Specifically, we propose to overcome the left-to-right nature of LLMs by fine-tuning a small set of bidirectional adapter layers on top of the representations learned by LLMs to produce LLMAO, the first language model based fault localization approach that locates buggy lines of code without any test coverage information. We fine-tune LLMs with 350 million, 6 billion, and 16 billion parameters on small, manually curated corpora of buggy programs such as the Defects4J corpus. We observe that our technique achieves substantially more confidence in fault localization when built on the larger models, with bug localization performance scaling consistently with the LLM size. Our empirical evaluation shows that LLMAO improves the Top-1 results over the state-of-the-art machine learning fault localization (MLFL) baselines by 2.3%--54.4%, and Top-5 results by 14.4%-35.6%. LLMAO is also the first FL technique trained using a language model architecture that can detect security vulnerabilities down to the code line level.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11316,
  title = {Large Language Models for Test-Free Fault Localization},
  author = {Aidan Z. H. Yang and Claire Le Goues and Ruben Martins and Vincent Hellendoorn},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3623342}
}