通过混合策略提升代码修复中的召回率与效率
PatchRecall: Patch-Driven Retrieval for Automated Program Repair
- 结合代码库匹配与历史问题检索,融合双重思路
- 在SWE-Bench上实现更高召回率,文件数量基本不变
- 适合自动化代码修复研究者与工程实践者参考
在自动化程序修复(APR)中,从大型代码库中准确检索相关文件至关重要。高召回率确保关键文件被包含,但盲目增加检索数量会引入噪声并降低效率。为此,我们提出PatchRecall,一种平衡召回率与简洁性的混合检索方法。该方法结合两种互补策略:(1) 代码库检索,将当前问题描述与代码库匹配以发现潜在相关文件;(2) 历史检索,利用相似历史问题识别已被修改的文件作为候选目标。两种策略的候选文件合并后重新排序,生成最终检索集。在SWE-Bench上的实验表明,PatchRecall在不显著增加检索文件数的前提下实现了更高的召回率,从而提升了APR的有效性。
原文摘要 · Abstract (English)
Retrieving the correct set of files from a large codebase is a crucial step in Automated Program Repair (APR). High recall is necessary to ensure that the relevant files are included, but simply increasing the number of retrieved files introduces noise and degrades efficiency. To address this tradeoff, we propose PatchRecall, a hybrid retrieval approach that balances recall with conciseness. Our method combines two complementary strategies: (1) codebase retrieval, where the current issue description is matched against the codebase to surface potentially relevant files, and (2) history-based retrieval, where similar past issues are leveraged to identify edited files as candidate targets. Candidate files from both strategies are merged and reranked to produce the final retrieval set. Experiments on SWE-Bench demonstrate that PatchRecall achieves higher recall without significantly increasing retrieved file count, enabling more effective APR.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。