PatchHolmes:通过列表式选择的智能体补丁检索
研究论文 · 2026/10/01
PatchHolmes 是一个两阶段补丁检索系统,第一阶段使用混合检索器,第二阶段采用智能体检查循环。与逐点评分方法不同,第二阶段智能体以列表方式读取前100个候选提交,通过四种预算工具选择性读取3到10个提交,最终提交一个最佳提交。在 GitHubAD 上,PatchHolmes 的 Recall@1 比逐点二分类器 Favia 高25.34%,比检索与思维链基线 IRCoT 高31.40%,且每个 CVE 仅需一次智能体对话(Favia 需十次)。在候选集相同的情况下,智能体比直接取检索器最高候选的 Recall@1 提升27.32%。同一智能体未经修改迁移到 PatchFinder_top10,将 Recall@1 从 PatchFinder 自身最高候选的24.28%提升至39.86%。在 Qwen 系列内更换 LLM 主干对 Recall@1 影响小于1%,而另一个模型系列(gpt-oss)仍远高于无智能体基线,表明增益来自列表式智能体循环。整个系统在冻结的开源权重模型上运行于本地 Git 仓库,无需微调或外部搜索 API。
该工作提出了一种高效的列表式智能体补丁检索方法,在多个基准上显著提升召回率,且无需微调或外部 API,对漏洞管理自动化具有重要实践意义。
Patch retrieval, the task of finding the commit that fixes a known vulnerability, is the foundation of vulnerability management workflows, yet 60% to 63% of CVEs in the major advisory databases lack a patch link. We present PatchHolmes, a two-phase patch retrieval system that pairs a hybrid first-stage retriever with an agentic second-stage inspection loop. Unlike pointwise prior work that scores each candidate independently, the Phase 2 agent reads the top-100 listwise: it sees the full candidate list at once and selectively reads 3 to 10 commits through four budgeted tools before submitting a single best commit. On GitHubAD, PatchHolmes beats the pointwise binary classifier Favia by 25.34% Recall@1 and the retrieve-and-CoT baseline IRCoT by 31.40%, at one agent conversation per CVE versus Favia's ten; with the candidate set held identical, the agent adds 27.32% Recall@1 over taking the retriever's top candidate, and the same agent, transferred unchanged to PatchFinder_top10, lifts Recall@1 from PatchFinder's own top-1 pick (24.28%) to 39.86%. Swapping the LLM backbone within the Qwen family changes Recall@1 by under 1%, and a second model family (gpt-oss) stays far above the no-agent floor, so the gain comes from the listwise agent loop; the entire system runs on a frozen open-weight model over a local Git repository, without fine-tuning or external search APIs.