title: LocAgent: Graph-Guided LLM Agents for Code Localization
summary: 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 heterogeneous
  graphs, LocAgent creates a lightweight representation that captures code
  structures (files, classes, functions) and their dependencies (imports,
  invocations, inheritance), enabling LLM agents to effectively search and locate
  relevant entities through powerful multi-hop reasoning. Experimental results on
  real-world benchmarks demonstrate that our approach significantly enhances
  accuracy in code localization. Notably, our method with the fine-tuned
  Qwen-2.5-Coder-Instruct-32B model achieves comparable results to SOTA
  proprietary models at greatly reduced cost (approximately 86% reduction),
  reaching up to 92.7% accuracy on file-level localization while improving
  downstream GitHub issue resolution success rates by 12% for multiple attempts
  (Pass@10). Our code is available at https://github.com/gersteinlab/LocAgent.
paper_authors._id: 67d2328a34eb54912d6fbb83
paper_authors.name: Zhaoling Chen
paper_authors._id: 67d2328a34eb54912d6fbb84
paper_authors.name: Xiangru Tang
paper_authors.status: extracted_pending
paper_authors.statusLastChangedAt: 2025-03-13T01:19:07.804Z
paper_authors._id: 63357c608adfa81faf2ac180
paper_authors.avatarUrl: /avatars/ae0314c644f882251baf59b9134fd36f.svg
paper_authors.fullname: Xiangru Tang
paper_authors.type: user
paper_authors.user: RTT1
paper_authors._id: 67d2328a34eb54912d6fbb85
paper_authors.name: Gangda Deng
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2025-03-13T08:24:25.045Z
paper_authors._id: 62c54062f7c810d3cd4043cc
paper_authors.avatarUrl: /avatars/bc0be3082fe1a6eec7687f57cfe84d55.svg
paper_authors.fullname: Gangda Deng
paper_authors.type: user
paper_authors.user: Hydrapse
paper_authors._id: 67d2328a34eb54912d6fbb86
paper_authors.name: Fang Wu
paper_authors._id: 67d2328a34eb54912d6fbb87
paper_authors.name: Jialong Wu
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2025-04-09T16:55:16.408Z
paper_authors._id: 644a4fbc2166258fccc664bc
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/noauth/8k3b44MbhQiWuo6i8BnYl.jpeg
paper_authors.fullname: Jialong Wu
paper_authors.type: user
paper_authors.user: callanwu
paper_authors._id: 67d2328a34eb54912d6fbb88
paper_authors.name: Zhiwei Jiang
paper_authors._id: 67d2328a34eb54912d6fbb89
paper_authors.name: Viktor Prasanna
paper_authors._id: 67d2328a34eb54912d6fbb8a
paper_authors.name: Arman Cohan
paper_authors._id: 67d2328a34eb54912d6fbb8b
paper_authors.name: Xingyao Wang
paper_title: LocAgent: Graph-Guided LLM Agents for Code Localization
paper_summary: 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 heterogeneous
  graphs, LocAgent creates a lightweight representation that captures code
  structures (files, classes, functions) and their dependencies (imports,
  invocations, inheritance), enabling LLM agents to effectively search and locate
  relevant entities through powerful multi-hop reasoning. Experimental results on
  real-world benchmarks demonstrate that our approach significantly enhances
  accuracy in code localization. Notably, our method with the fine-tuned
  Qwen-2.5-Coder-Instruct-32B model achieves comparable results to SOTA
  proprietary models at greatly reduced cost (approximately 86% reduction),
  reaching up to 92.7% accuracy on file-level localization while improving
  downstream GitHub issue resolution success rates by 12% for multiple attempts
  (Pass@10). Our code is available at https://github.com/gersteinlab/LocAgent.