paperbot · PL 论文追踪

全部论文 待读 收藏

P2 How Do LLMs Read Bug Reports? An Empirical Study of Attention in LLMs for Automated Program Repair

LLM 如何阅读缺陷报告?面向自动程序修复的 LLM 注意力实证研究
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026匹配度 4/10 · 论文研究LLM在自动程序修复中的注意力模式,属于ML+PL的交叉,但与用户核心关注的静态分析、形式化验证、浮点/贝叶斯程序分析等方向不直接匹配;其关于注意力错配的发现可能对理解Coding Agent行为有间接参考,但并非用户研究主线。引用 0 inbox
Ramtin Ehsani, Irene Manotas, Saurabh Pujar, Luca Buratti, Preetha Chatterjee
crossref: 2026-10-09

AI 速览

一句话:首次实证研究 LLM 自动程序修复中的注意力模式,发现注意力错配是修复失败的关键因素。

基于 LLM 的自动程序修复性能仍不稳定:即使上下文相同,模型也可能对某个缺陷生成正确补丁,却在相近缺陷上失败,其成因尚不清楚。本文首次对 LLM 程序修复中的注意力模式开展实证研究,从 SWE-bench Verified 与 Multi-SWE-bench 中选取 319 个真实 Python 与 Java 缺陷,围绕三个问题展开分析:(RQ1) 注意力在缺陷报告各章节间如何分布;(RQ2) 成功与失败修复在各章节内的注意力模式有何差异;(RQ3) 这些模式与开发者认为对修复重要的信息是否一致。结果显示:成功修复的注意力较分散,覆盖缺陷描述、栈轨迹与测试用例等多个诊断要素;失败修复则常过度聚焦于版本信息等元数据。此外,模型注意力与开发者标注的关键章节和短语对齐度越高,修复成功率越高。该工作首次给出注意力错配是 LLM 修复失败重要原因的证据,并为设计更可解释、更可靠的 APR 系统提供可行建议。

问题
LLM 自动程序修复性能不稳定,模型如何对缺陷报告中的多样信息分配注意力、注意力是否影响修复成败,目前缺乏理解。
方法
对 SWE-bench Verified 与 Multi-SWE-bench 中 319 个真实 Python/Java 缺陷,量化注意力在缺陷报告各章节的分布,比较成功与失败修复的注意力模式,并与开发者认为重要的信息做对照分析。
评估
通过三个研究问题的注意力分布与修复成功率的关联分析进行评估,并借助开发者标注的关键章节与短语衡量模型注意力与人类判断的对齐程度。
原文摘要(Abstract)

Large Language Model (LLM)-based Automated Program Repair systems are advancing rapidly, yet their performance remains inconsistent. Even when provided with the same contextual information, an LLM may generate a correct patch for one bug but fail on another closely related bug. Why this happens remains poorly understood, and it is unclear how LLMs prioritize the diverse information in bug reports and whether model attention affects repair success. In this paper, we present the first empirical study of attention patterns in LLM-based program repair, providing interpretable insights into how models process bug reports and where their attention is concentrated during repair. We analyze 319 real-world Python and Java bugs from SWE-bench Verified and Multi-SWE-bench to study (RQ1) how model attention is distributed across bug report sections, (RQ2) how attention patterns within each section differ between successful and unsuccessful repairs, and (RQ3) how these patterns compare to information developers consider important for bug fixing. We find that successful repairs are characterized by diffused attention across multiple diagnostic components such as bug descriptions, stacktraces, and test cases, while failures often exhibit over-localized attention toward metadata such as version information. We further observe that stronger alignment between model attention and developer-identified key sections and phrases is associated with higher repair success. Our results provide the first empirical evidence that attention misallocation is a key factor in LLM-based APR failures, and offer actionable insights for designing more interpretable and reliable future APR systems.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2607-25873,
  title = {How Do LLMs Read Bug Reports? An Empirical Study of Attention in LLMs for Automated Program Repair},
  author = {Ramtin Ehsani and Irene Manotas and Saurabh Pujar and Luca Buratti and Preetha Chatterjee},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3837434}
}