arXiv:2512.07022cs.SEcs.AI2025-12中稿 · BoatSE 2026被引 1

用大模型重写缺陷描述,提升代码库级漏洞定位准确率。

Reformulate, Retrieve, Localize: Agents for Repository-Level Bug Localization

  • 用大模型提取关键信息并重写查询,降低原始报告噪声影响。
  • 在首文件召回率上比基线提升35%,最高较SWE-agent提高22%。
  • 适合需要自动化定位大规模代码库缺陷的工程团队使用。

缺陷定位仍是大规模软件仓库中一项关键但耗时的挑战。传统基于信息检索的缺陷定位(IRBL)方法依赖未经修改的缺陷描述,常包含噪声信息,导致检索准确率低下。近期大语言模型(LLM)在查询重写方面取得进展,但其对智能体性能的影响尚不明确。本研究探索了基于LLM的智能体如何通过轻量级查询重写与摘要,提升文件级缺陷定位效果。我们采用开源且未微调的LLM,从缺陷报告中提取标识符、代码片段等关键信息,并在检索前重写查询。随后,智能体利用预处理后的查询执行BM25检索,实现规模化自动化定位流程。采用最优查询重写技术后,该智能体在首文件召回率上较基线提升35%,最高较SWE-agent提升22%。

原文摘要 · Abstract (English)

Bug localization remains a critical yet time-consuming challenge in large-scale software repositories. Traditional information retrieval-based bug localization (IRBL) methods rely on unchanged bug descriptions, which often contain noisy information, leading to poor retrieval accuracy. Recent advances in large language models (LLMs) have improved bug localization through query reformulation, yet the effect on agent performance remains unexplored. In this study, we investigate how an LLM-powered agent can improve file-level bug localization via lightweight query reformulation and summarization. We first employ an open-source, non-fine-tuned LLM to extract key information from bug reports, such as identifiers and code snippets, and reformulate queries pre-retrieval. Our agent then orchestrates BM25 retrieval using these preprocessed queries, automating localization workflow at scale. Using the best-performing query reformulation technique, our agent achieves 35% better ranking in first-file retrieval than our BM25 baseline and up to +22% file retrieval performance over SWE-agent.

缺陷定位大模型代码分析

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。