arxiv-2503-09089 SRC-0313 · paperLocAgent: Graph-Guided LLM Agents for Code Localization
Created: 2025-03-12 · Ingested: 2026-09-19
https://arxiv.org/abs/2503.09089(opens in a new tab)Code localization--identifying precisely where in a codebase changes need to be made--is a fundamental yet challenging task in software maintenance. Existing approaches struggle to efficiently navigate complex codebases when identifying relevant code sections. The challenge lies in bridging natural language problem descriptions with the appropriate code elements, often requiring reasoning across hierarchical structures and multiple dependencies. We introduce LocAgent, a framework that addresses code localization through graph-based representation. By parsing codebases into directed heterogeneo
In brief
Giving a code agent a graph index of a repository -- files, classes, functions linked by contain, import, invoke and inherit edges -- beats directory traversal and embedding retrieval for finding which code an issue requires changing. LocAgent builds that heterogeneous graph plus BM25 sparse entity indexes and exposes 3 tools (SearchEntity, TraverseGraph, RetrieveEntity) to the agent, evaluated on 274 SWE-Bench-Lite examples and a new 560-example Loc-Bench spanning bug reports, feature requests, security and performance issues.
With Claude-3.5 it reaches 94.16 file Acc@5 and 73.36 function Acc@5 on SWE-Bench-Lite, against 90.15 and 68.25 for OpenHands. A fine-tuned Qwen2.5-32B reaches 92.70 file Acc@5 at $0.09 per example versus $0.66 for Claude-3.5, an 86% reduction. Downstream issue resolution rises from 33.58 to 37.59 Pass@10 over an Agentless localizer.
Ablations with the fine-tuned 7B model isolate the components: removing SearchEntity drops function Acc@10 from 71.53 to 53.28, removing TraverseGraph to 66.06, restricting to contain edges only to 66.42, fixing traversal to 1 hop to 66.79. Baselines run with the same backbone models.
Python only, 1 fine-tuned model family, and performance on Loc-Bench drops outside the bug-report category, matching the training mix. Worth adopting if your agent scaffold currently navigates by directory.
Written from the abstract by claude-opus-5 on 2026-10-17, with every figure checked against it. Not a substitute for the paper.
Referenced by
Claims in this catalog that draw on this source, and whether as support or counterpoint.