一句话:提出免训练免索引的 COSIL,用两阶段代码图搜索实现函数级 Issue 定位。
Issue 解决需要根据 issue 描述在真实代码仓库中生成修复补丁,而 Issue 定位是其前提。现有基于大语言模型(LLM)的定位方法要么只在描述提及的文件中搜索,要么直接在整仓库中搜索,难以兼顾搜索空间的广度与深度,无法高效收敛到目标;同时 LLM 可自由探索整个仓库,搜索方向难以控制,且常因无法正确生成与环境交互所需的格式而导致搜索失败。本文提出 COSIL,一种无需训练与索引、由 LLM 驱动的函数级 Issue 定位方法。它采用两阶段代码图搜索策略:先在文件级利用动态构建的模块调用图进行广度探索,再将模块调用图扩展为函数调用图并在函数级执行迭代搜索以实现深度分析;设计剪枝器过滤无关方向与上下文以精确控制搜索方向;并引入反思机制,通过在短上下文中发起独立查询来增强 LLM 的格式化能力,避免长上下文中的交互格式错误。实验表明,使用 Qwen2.5-Coder-32B 时,COSIL 在 SWE-bench Lite 与 SWE-bench Verified 上的 Top-1 定位准确率分别达 43.3% 与 44.6%,平均超过现有最优方法 96.04%;将其集成到 Agentless 后,Issue 解决率提升 2.98%–30.5%。
Issue solving aims to generate patches to fix re-ported issues in real-world code repositories according to issue descriptions. Issue localization forms the basis for accurate issue solving. Recently, large language model (LLM) based issue localization methods have demonstrated state-of-the-art performance. However, these methods either search from files mentioned in issue descriptions or in the whole repository and struggle to balance the breadth and depth of the search space to converge on the target efficiently. Moreover, they allow LLM to explore whole repositories freely, making it challenging to control the search direction to prevent the LLM from searching for incorrect targets. Meanwhile, because LLMs may not correctly produce the required interaction formats with the environment, they suffer from search failures.This paper introduces COSIL, an LLM-driven, powerful function-level issue localization method without training or indexing. To balance search breadth and depth, COSIL employs a two-phase code graph search strategy. It first conducts broad exploration at the file level using dynamically constructed module call graphs, and then performs in-depth analysis at the function level by expanding the module call graph into a function call graph and executing iterative searches. To precisely control the search direction, COSIL designs a pruner to filter unrelated directions and irrelevant contexts. To avoid incorrect interaction formats in long contexts, COSIL introduces a reflection mechanism that uses additional independent queries in short contexts to enhance formatted abilities. Experiment results demonstrate that COSIL achieves a Top-1 localization accuracy of 43.3% and 44.6% on SWE-bench Lite and SWE-bench Verified, respectively, with Qwen2.5-Coder-32B, average outperforming the state-of-the-art methods by 96.04%. When COSIL is integrated into an issue-solving method, Agentless, the issue resolution rate improves by 2.98%–30.5%.
DOI 原文 ·
@inproceedings{paperbot9439,
title = {Issue Localization via LLM-Driven Iterative Code Graph Searching},
author = {Zhonghao Jiang and Xiaoxue Ren and Meng Yan and Wei Jiang and Yong Li and Zhongxin Liu},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00249}
}