提出可拆解代码修复中文件定位作用的评估框架,验证其能提升修复成功率和效率。
Loc2Repair: A Framework for Evaluating the Impact of File-Level Issue Localization in Repo-Level LLM Repair

- 构建模块化框架,分离文件定位与修复过程,实现可控对比实验。
- 使用真实数据集测试,定位提升修复率至52.4%(黄金标签),平均耗时减少154秒。
- 适用于研究大型语言模型代码修复中的上游环节影响,尤其关注定位环节优化。
仓库级自动化修复常被呈现为单一端到端能力,掩盖了如文件定位不佳、补丁生成错误、迭代调试失败等不同故障模式。本文提出Loc2Repair,一个模块化的评估框架,用于对仓库级修复流程进行受控分析,并将文件级问题定位作为上游变量独立考察。该框架在共享运行时、产物模式和评估环境的基础上,解耦定位与修复,使研究者可在相同条件下组合不同定位模型与修复主干。在SWE-bench Verified上使用三个修复主干进行实验,对比无显式定位的基线修复、由两个定位器预测的定位引导修复,以及由黄金修改文件集引导的修复。结果显示,显式定位显著提升修复成功率:综合表现从基线的44.7%提升至预测定位下的48.9%和49.1%,黄金定位下达52.4%。定位还降低整体平均耗时:在配对分析中,预测定位设置分别减少100.94秒和52.25秒,黄金引导下减少154.45秒,但各模型间仍存在令牌消耗异质性。总体而言,Loc2Repair表明文件级定位是提升修复效果与平均延迟的一致杠杆,而黄金引导失败暴露了超越定位的改进空间。
原文摘要 · Abstract (English)
Repository-grounded automated repair is often reported as a single end-to-end capability, which hides distinct failure modes such as poor file targeting, incorrect patch synthesis, and failed iterative debugging. We present Loc2Repair, a modular evaluation framework for controlled analysis of repository-grounded repair pipelines, and use it to isolate file-level issue localization as an upstream variable. Loc2Repair decouples localization and repair under a shared runtime, artifact schema, and evaluation harness, allowing researchers to combine different localization models and repair backbones under matched conditions. Using three repair backbones on SWE-bench Verified, we compare baseline repair without explicit localization, repair guided by predicted localization from two localizers, and repair guided by gold modified-file sets. Explicit localization consistently improves resolved rate across all backbones: pooled performance increases from 44.7% for baseline repair to 48.9% and 49.1% with predicted localization, and to 52.4% with gold localization. Localization also reduces mean elapsed time overall: in pooled paired analysis, mean elapsed time decreases by 100.94 s and 52.25 s for the two predicted-localization settings, and by 154.45 s with gold guidance, although token effects remain heterogeneous across models. Overall, Loc2Repair shows file-level localization is a consistent repair lever, improving effectiveness and mean latency in pooled analysis, while gold-guided failures expose headroom beyond localization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。