arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.05481cs.SEcs.AI
收藏

关于基于LLM的程序修复中故障定位上下文的作用

On the Role of Fault Localization Context for LLM-Based Program Repair

York University(约克大学)

Melika Sepidband, Hung Viet Pham, Hadi Hemmati

AI总结:

研究探讨了LLM基于程序修复中故障定位上下文的影响,发现文件级上下文对修复性能提升显著,而元素级和行级上下文效果不一,LLM检索优于传统方法。

摘要:

故障定位(FL)是基于大语言模型(LLM)的自动程序修复(APR)的关键组成部分,但其影响仍不明确。本文通过500个SWE-bench验证实例,使用GPT-5-mini评估61种配置,发现更多上下文并不总能提升修复性能。文件级定位是主导因素,带来15-17倍的性能提升。扩展文件上下文常伴随性能提升,成功修复多见于包含约6-10个相关文件的配置。元素级上下文扩展提供依赖文件上下文质量的条件性收益,而行级上下文扩展常因噪声放大导致性能下降。LLM检索通常优于结构启发法,且使用更少文件和令牌。总体而言,最有效的FL上下文策略通常结合高抽象层次的语义理解与精确行级定位。这些发现挑战了增加定位上下文能统一提升APR的假设,并为设计LLM基于FL策略提供了实践指导。

英文摘要:

Fault Localization (FL) is a key component of Large Language Model (LLM)-based Automated Program Repair (APR), yet its impact remains underexplored. In particular, it is unclear how much localization is needed, whether additional context beyond the predicted buggy location is beneficial, and how such context should be retrieved. We conduct a large-scale empirical study on 500 SWE-bench Verified instances using GPT-5-mini, evaluating 61 configurations that vary file-level, element-level, and line-level context. Our results show that more context does not consistently improve repair performance. File-level localization is the dominant factor, yielding a 15-17x improvement over a no-file baseline. Expanding file context is often associated with improved performance, with successful repairs most commonly observed in configurations with approximately 6-10 relevant files. Element-level context expansion provides conditional gains that depend strongly on the file context quality, while line-level context expansion frequently degrades performance due to noise amplification. LLM-based retrieval generally outperforms structural heuristics while using fewer files and tokens. Overall, the most effective FL context strategy typically combines a broad semantic understanding at higher abstraction levels with precise line-level localization. These findings challenge our assumption that increasing the localization context uniformly improves APR, and provide practical guidance for designing LLM-based FL strategies.

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

↑