Source-linked AI summary

GraphLocator: Graph-guided Causal Reasoning for Issue Localization

Wei Liu, Chao Peng, Pengfei Gao, Aofan Liu, Wei Zhang, Haiyan Zhao, Zhi Jin

arXiv:2512.22469v1cs.SE

TL;DR

Issue localization is difficult because descriptions may hide root causes or refer to multiple interdependent code entities. GraphLocator constructs a causal issue graph and expands it through iterative reasoning over repository neighbors. Across three real-world datasets, it improves function-level localization and downstream issue-resolving performance.

  • Problem

    Issue localization must map ambiguous natural-language descriptions to code, including cases where symptoms obscure root causes or one issue involves multiple interdependent entities.

    Source: §1 · p. 2
  • Method

    GraphLocator locates symptom vertices on a repository graph and iteratively expands a causal issue graph whose sub-issues are linked to code entities and connected by causal dependencies.

    Source: §1 · p. 3, §2.2 · p. 5
  • Results

    Across three real-world datasets, GraphLocator improves function-level recall by +19.49% and precision by +11.89% on average over embedding- and LLM-based approaches.

    Source: §1 · p. 3
  • Takeaways & Limitations

    The CIG generated by GraphLocator yields a 28.74% increase in performance on the downstream issue-resolving task.

    Source: §1 · pp. 3–4

    Evaluation focuses on open-source Python and Java repositories, limiting the scope of findings for other languages and repository types.

    Source: §6.2 · p. 18

Abstract

from arXiv · show

The issue localization task aims to identify the locations in a software repository that requires modification given a natural language issue description. This task is fundamental yet challenging in automated software engineering due to the semantic gap between issue description and source code implementation. This gap manifests as two mismatches:(1) symptom-to-cause mismatches, where descriptions do not explicitly reveal underlying root causes; (2) one-to-many mismatches, where a single issue corresponds to multiple interdependent code entities. To address these two mismatches, we propose GraphLocator, an approach that mitigates symptom-to-cause mismatches through causal structure discovering and resolves one-to-many mismatches via dynamic issue disentangling. The key artifact is the causal issue graph (CIG), in which vertices represent discovered sub-issues along with their associated code entities, and edges encode the causal dependencies between them. The workflow of GraphLocator consists of two phases: symptom vertices locating and dynamic CIG discovering; it first identifies symptom locations on the repository graph, then dynamically expands the CIG by iteratively reasoning over neighboring vertices. Experiments on three real-world datasets demonstrates the effectiveness of GraphLocator: (1) Compared with baselines, GraphLocator achieves more accurate localization with average improvements of +19.49% in function-level recall and +11.89% in precision. (2) GraphLocator outperforms baselines on both symptom-to-cause and one-to-many mismatch scenarios, achieving recall improvement of +16.44% and +19.18%, precision improvement of +7.78% and +13.23%, respectively. (3) The CIG generated by GraphLocator yields the highest relative improvement, resulting in a 28.74% increase in performance on downstream resolving task.

1 Introduction

Issue localization must bridge ambiguous natural-language reports and structured code, especially when symptoms obscure root causes or one issue spans interdependent entities. GraphLocator uses a causal issue graph to trace dependencies and disentangle sub-issues, improving localization and downstream issue resolution.

1 Introduction

  • Symptom-to-cause mismatches hide root causes behind observable symptoms, while one-to-many mismatches require coordinated changes across interdependent code entities.The former can require tracing implicit multi-hop causal paths; the latter requires identifying the full related set rather than one entry point.Source: §1 · p. 2
  • Embedding-based methods retrieve broadly related code but have low precision, while fixed procedural and unguided agentic workflows struggle with mismatch cases.Procedural workflows may miss cross-hierarchy dependencies, and agentic workflows can favor superficial relevance over causality.Source: §1 · pp. 2–3
  • GraphLocator first locates symptom vertices on the repository graph, then expands the CIG through iterative abductive reasoning over neighboring vertices.CIG vertices represent sub-issues associated with relevant code snippets; edges encode causal dependencies.Source: §1 · p. 3
  • +19.49% average function-level recall and +11.89% precision improvements over embedding- and LLM-based approaches are reported for GraphLocator.The experiments cover three real-world datasets and both Python and Java.Source: §1 · p. 3
  • On symptom-to-cause mismatches, recall improves +16.44% and precision +7.78%; on one-to-many mismatches, recall improves +19.18% and precision +13.23%.The comparison is against embedding- and LLM-based approaches.Source: §1 · p. 3
  • The CIG generated by GraphLocator yields a 28.74% increase in performance on the downstream issue-resolving task.Source: §1 · pp. 3–4

2 Basic Concepts

Section 2 defines RDFS as a repository structure and CIG as an issue-specific causal graph grounded in that structure.

2.1 Repository Dependency Fractal Structure

  • RDFS organizes typed repository entities and relations across granularity layers, using hierarchical membership and dependencies; its graph is built incrementally, adding costly dependency edges on demand.The four layers span directories or packages, files, classes or interfaces or enums, and fields or methods or functions.Source: §2.1 · pp. 4–5

2.2 Causal Issue Graph

  • CIG vertices represent natural-language sub-issues grounded to RDFS entities, while directed edges encode potential causal relations with LLM-estimated probabilities.CIGs represent hypothesized cause–effect relations to guide abductive reasoning, rather than statistically validated causal effects.Source: §2.2 · pp. 5–6
  • In the astropy example, intermediate sub-issues connect symptom-level functions to root causes, and shared or intersecting paths make a graph more general than a tree.The example traces from separability_matrix through intermediate issues to _cstack.Source: Figure 4 · p. 5, §2.2 · p. 6

3 GraphLocator

GraphLocator first locates symptom vertices in a repository graph, then expands a causal issue graph by reasoning over neighboring vertices to identify code entities for modification.

3 GraphLocator

  • GraphLocator takes an issue description and repository, then uses symptom locating followed by dynamic CIG discovery to return code entities requiring modification.The second phase traverses neighboring RDFS vertices to discover and ground sub-issues, addressing symptom-to-cause and one-to-many mismatches.Source: §3 · p. 6

3.1 Phase I: Symptom Vertices Locating

  • SearchAgent locates symptom vertices with layer-aware, wildcard-capable vertex queries and structure-aware edge searches, filtering candidates through semantic reasoning.Vertex searches can use fuzzy matching; edge searches retrieve entities connected by specified relations.Source: §3.1 · pp. 6–7, Table 1 · p. 7

3.2 Phase II: Dynamic CIG Discovering

  • Dynamic CIG discovery expands one sub-issue at a time, prioritizing the node with the highest estimated potential to causally influence other issues.For each expanded sub-issue, GraphLocator gathers unvisited neighboring code vertices and asks the LLM to assess them as plausible causes or intermediaries.Source: §3.2 · p. 8

4 Experimental Setups

The experiments compare GraphLocator with embedding- and LLM-based baselines on Python and Java issue-localization datasets, using multiple granularity levels and complementary metrics.

4 Experimental Setups

  • The evaluation asks how effective GraphLocator is, how it generalizes across mismatch complexity, how its components contribute, and what computational cost it incurs.Source: §4 · p. 8

4.1 Datasets

  • Evaluation used SWE-bench Lite (300 Python issues), LocBench (559 Python issues), and Multi-SWE-bench (128 Java issues), with issue descriptions, repository versions, and fix patches.Source: §4.1 · p. 9

4.2 Evaluation Metrics

  • Localization is evaluated at file, module, and function levels using Success Location, Recall, Precision, and F1-score.Success Location measures whether predicted locations fully cover the ground truth; Recall captures ground-truth locations, Precision penalizes incorrect predictions, and F1 balances Precision and Recall.Source: §4.2 · p. 10

4.3 Methods for Comparison

  • The comparison includes SWERank, Agentless, LocAgent, and CoSIL; SWERank and LocAgent are restricted to the Python datasets.Baselines are selected from embedding- and LLM-based approaches; SWERank and LocAgent are Python-specific, so their evaluation excludes Multi-SWE-bench Java.Source: §4.3 · p. 10

4.4 Implementation Details

  • GraphLocator uses up to five Phase I iterations and 20 Phase II turns; LLM runs use GPT-4o and Claude-3.5 with greedy decoding.Baselines use official repositories and default hyperparameters; Java evaluations adapt Agentless and CoSIL, and experiments run on Debian 10 with 64-core hardware.Source: §4.4 · p. 11

5.1 RQ1: Effectiveness

GraphLocator outperforms the compared baselines across Python and Java datasets and localization granularities. Its gains are especially notable at function level, where causal reasoning addresses over-expansion and non-causal candidates.

  • GraphLocator’s function-level F1 gains over SWERank reach 15.68–21.32%, although SWERank-Large has higher Success Location and Recall at file and module levels.Source: §5.1 · p. 11
  • GraphLocator improves precision over embedding- and LLM-based approaches, including nearly 4× LocAgent’s function-level precision with Claude-3.5 on the Python datasets.On Multi-SWE-bench Java, GraphLocator improves precision over Agentless and CoSIL by 4.84–29.84%.Source: §5.1 · p. 12
  • GraphLocator’s improvements are more pronounced at function level, where causal graphs narrow candidates to structurally plausible entities and improve precision without losing recall.At coarser levels, baselines can already achieve relatively high recall; function-level localization must distinguish closely related but non-causal entities.Source: §5.1 · pp. 12–13
  • As symptom-to-cause distance or the number of involved functions grows, performance declines, while GraphLocator remains the strongest or most robust method.Source: Figure 6 · p. 13, Figure 7 · p. 13
  • +19.49% function-level recall and +11.89% precision over baselines on Python and Java datasets with Claude-3.5.Source: §5.1 · pp. 11, 13, Table 2 · p. 12

5.2 RQ2: Generalizability

GraphLocator is evaluated across increasing symptom-to-cause distances and numbers of ground-truth functions. It consistently outperforms baselines and balances recall and precision across these complexity levels.

5.2.1 Generalizability on Symptom-to-Cause Distance.

  • Symptom-to-cause distance measures RDFS traversal hops between issue-keyword nodes and ground-truth locations; explicitly mentioned ground-truth functions have distance zero.Instances without extractable keywords or valid node mappings are excluded from the distance calculation.Source: §5.2 · p. 13, §5.2.1 · p. 13
  • At distance 0, GraphLocator achieves 95.59% REC and the highest precision; SL and REC decline as distance increases across methods.The authors report that GraphLocator consistently outperforms baselines; embedding methods have their largest gap at distance 0, while CoSIL’s precision at distances 3 and 4 comes with low recall and SL.Source: §5.2.1 · p. 14

5.2.2 Generalizability on Number of Involved Functions.

  • As ground-truth function counts rise, GraphLocator maintains the best REC–PRE balance; SL and REC decline while PRE and F1 improve across methods.The authors attribute the opposing trends partly to a larger search space that makes recovering all functions harder while increasing the chance that predictions overlap with some correct functions.Source: §5.2.2 · p. 14

5.2 RQ2: Generalizability

  • GraphLocator consistently outperforms baselines as symptom-to-cause distance and the number of ground-truth functions increase, while balancing recall and precision.The authors identify these as the two task-complexity dimensions evaluated.Source: §5.2 · p. 13, §5.2.2 · p. 14

5.3 RQ3: Ablation Study

The ablation study removes symptom-search tools and alters dynamic CIG discovery to assess the contribution of GraphLocator’s components. Removing each component degrades localization performance.

Ablation setup

  • The ablation removes search_vertex and search_edge individually, replaces priority-queue expansion with FIFO, or removes CIG guidance from prompts.Experiments use Claude-3.5 and average results across SWE-bench Lite, LocBench, and Multi-SWE-bench Java.Source: §5.3 · p. 14

Ablation results

  • Removing each GraphLocator component degrades localization; removing search_vertex drops function-level F1 from 30.91% to 14.23%.The study averages results across 987 issues from three datasets using Claude-3.5.Source: §5.3 · p. 15, Table 3 · p. 15
  • CIG guidance helps preserve causal-dependency context, while priority-driven expansion steers reasoning toward promising sub-issues and improves recall.LLM-estimated dependency probabilities may not match true values exactly but remain useful for relative prioritization.Source: §5.3 · p. 15

5.4 RQ4: Cost

GraphLocator’s lazy graph construction reduces graph-building time relative to LocAgent for repositories with more than 20 functions. It also uses fewer LLM interaction tokens than LocAgent, with acceptable overall cost.

5.4 RQ4: Cost

  • GraphLocator’s graph construction is split between an inter-layer skeleton built before agent processing and intra-layer dependencies loaded during processing.The authors do not compare graph-construction time with CoSIL because its graph is dynamically built through LLM prompting rather than static analysis.Source: §5.4.1 · p. 15

5.4.1 Graph Construction Time Efficiency.

  • GraphLocator achieves higher average graph-construction time efficiency than LocAgent when repositories contain more than 20 functions.Lazy loading brings in only useful dependencies; for 10k functions, intra-layer skeleton construction takes under 20 seconds, while inter-layer static analysis of a single function ranges from 0.5 to 5 seconds.Source: §5.4.1 · pp. 15–16

5.4.2 Token Consumption.

  • Under GPT-4o, GraphLocator uses 99.44k input tokens versus LocAgent’s 211.23k, reducing token usage by 52.9% and cost by 43.5%.Under Claude-3.5, GraphLocator reduces input tokens by 32.3% and cost by 22.9% relative to LocAgent.Source: §5.4.2 · p. 16

6 Discussion

Integrating GraphLocator generally increases downstream resolved rates, and encoding CIG structure provides additional context. The discussion also notes limits tied to ground-truth labels, model leakage risk, and evaluation scope.

6.1 Impact on Downstream Issue Resolving

  • On SWE-bench Lite, GraphLocator with structure raises Trae Agent’s resolved rate from 25.00% to 30.67%.Across both evaluated frameworks, integrating GraphLocator consistently increases resolved rates; Mermaid-serialized CIG structure also consistently enhances them.Source: §6.1 · p. 17, Table 5 · p. 17
  • Higher resolved rates do not eliminate patch-generation challenges: accurate localization alone is not enough to produce correct fixes.The evaluation uses a single-sample setting on SWE-bench Lite and Multi-SWE-bench Java, excluding LocBench because it lacks unit-test information for correctness validation.Source: §6.1 · pp. 16–17

6.2 Threats to Validity

  • Ground-truth locations come from human-written fix patches, reflecting commonly accepted fixes while alternative valid solutions may exist.The authors also identify baseline implementation and potential LLM data leakage as internal-validity threats.Source: §6.2 · pp. 17–18
  • Findings are limited to open-source repositories in Python and Java, and the evaluated repository selection is not exhaustive.The study includes 164 LocBench repositories, 12 SWE-bench Lite repositories, and 9 Multi-SWE-bench Java repositories.Source: §6.2 · p. 18

7 Related Work

Prior issue-localization methods use semantic matching, structured LLM workflows, or repository graphs, but often miss repository dependencies and explicit causality. The paper situates GraphLocator's causal discovery against broader LLM causal-reasoning capabilities and limits.

7 Related Work

  • Embedding-based methods rank code entities by semantic similarity but overlook repository structure and dependencies, limiting their ability to trace root causes or interdependent changes.They also require indexing infrastructure with storage and maintenance overhead.Source: §7 · p. 18
  • Graph-based agentic localization improves structural awareness, yet existing approaches still rely on superficial relevance and lack explicit causal modeling of interdependent code entities.Earlier workflows also include fixed procedural hierarchies and autonomous agentic exploration.Source: §7 · p. 18
  • Traditional causal frameworks target tabular data, while LLM-based causal reasoning offers opportunities for text and code but remains limited in counterfactual reasoning.GraphLocator leverages LLM causal discovery to infer latent structures from code snippets and identify interdependent sub-issues.Source: §7 · pp. 18–19

8 Conclusion

GraphLocator uses a causal issue graph to represent causal relationships among sub-issues and code entities, with iterative abductive reasoning and dynamic disentangling. Experiments on three real-world Python and Java datasets show improved localization and mismatch-scenario performance over existing baselines.

8 Conclusion

  • Across three real-world Python and Java datasets, GraphLocator consistently outperforms existing baselines in function-level recall and precision and in both mismatch scenarios.The authors describe the approach as a promising direction for more accurate and interpretable automated issue localization.Source: §8 · p. 19
Loading 2512.22469v1…