Table of Contents
Fetching ...

Issue Localization via LLM-Driven Iterative Code Graph Searching

Zhonghao Jiang, Xiaoxue Ren, Meng Yan, Wei Jiang, Yong Li, Zhongxin Liu

TL;DR

This paper tackles the central problem of issue localization for patch generation in real-world code repositories, where existing LLM-based approaches struggle to balance search breadth and depth and to maintain reliable interaction formats. It introduces CoSIL, a training-free framework that uses a two-phase code graph search—broad file-level exploration via a module call graph followed by deep, iterative function-level searching on a function call graph—augmented by a pruning mechanism and reflective alignment. Empirical results on SWE-bench show substantial gains in Top-1 and function-level localization, and when combined with an issue-solving pipeline, CoSIL improves patch resolution rates; ablation confirms each component’s contribution. The work demonstrates strong generalizability across open- and closed-source LLMs and remains cost-efficient, with an open-source replication package to support adoption and further research.

Abstract

Issue solving aims to generate patches to fix reported issues in real-world code repositories according to issue descriptions. Issue localization forms the basis for accurate issue solving. Recently, 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. This paper introduces CoSIL, an LLM-driven, powerful function-level issue localization method without training or indexing. 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\%.

Issue Localization via LLM-Driven Iterative Code Graph Searching

TL;DR

This paper tackles the central problem of issue localization for patch generation in real-world code repositories, where existing LLM-based approaches struggle to balance search breadth and depth and to maintain reliable interaction formats. It introduces CoSIL, a training-free framework that uses a two-phase code graph search—broad file-level exploration via a module call graph followed by deep, iterative function-level searching on a function call graph—augmented by a pruning mechanism and reflective alignment. Empirical results on SWE-bench show substantial gains in Top-1 and function-level localization, and when combined with an issue-solving pipeline, CoSIL improves patch resolution rates; ablation confirms each component’s contribution. The work demonstrates strong generalizability across open- and closed-source LLMs and remains cost-efficient, with an open-source replication package to support adoption and further research.

Abstract

Issue solving aims to generate patches to fix reported issues in real-world code repositories according to issue descriptions. Issue localization forms the basis for accurate issue solving. Recently, 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. This paper introduces CoSIL, an LLM-driven, powerful function-level issue localization method without training or indexing. 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\%.

Paper Structure

This paper contains 28 sections, 12 figures, 10 tables, 2 algorithms.

Figures (12)

  • Figure 1: A motivating example of Django-13315.
  • Figure 2: Overview of CoSIL.
  • Figure 3: Textual representation of call graphs.
  • Figure 4: Patch generated by OrcaLoca+Agentless and CoSIL+Agentless for Django-13315.
  • Figure 5: An example of call graph construction.
  • ...and 7 more figures