LocAgent: Graph-Guided LLM Agents for Code Localization
Zhaoling Chen, Robert Tang, Gangda Deng, Fang Wu, Jialong Wu, Zhiwei Jiang, Viktor K. Prasanna, Arman Cohan, Xingyao Wang
Abstract
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 .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 98d95094-e12c-405f-989d-f2f766642edaCited by top-tier papers17
- SWERank: Software Issue Localization with Code RankingRevanth Gangi Reddy, Tarun Suresh, JaeHyeok Doo, Ye Liu et al.ICLR 2026 · 28 citations
- Improving Code Localization with Repository MemoryBoshi Wang, Weijian Xu, Yunsheng Li, Xuemei Gao et al.ICLR 2026 · 20 citations
- Issue Localization via LLM-Driven Iterative Code Graph SearchingZhonghao Jiang, Xiaoxue Ren, Meng Yan, Wei Jiang et al.ASE 2025 · 6 citations
- Taming System Complexity: Demystifying Software Engineering Agents in Diagnosing Linux Kernel FaultsZhenhao Zhou, Zhuochen Huang, Yike He, Chong Wang et al.ACL 2026 · 5 citations
- RFCAudit: AI Agent for Auditing Protocol Implementations Against RFC SpecificationsMingwei Zheng, Chengpeng Wang, Xuwei Liu, Jinyao Guo et al.ASE 2025 · 5 citations
Builds on14
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat et al.ICML 2020 · 2,937 citations
- SWE-agent: Agent-Computer Interfaces Enable Automated Software EngineeringJohn Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret et al.NeurIPS 2024 · 2,059 citations
- Self-Consistency Improves Chain of Thought Reasoning in Language ModelsXuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V. Le et al.ICLR 2023 · 681 citations
Related papers
- OrcaLoca: An LLM Agent Framework for Software Issue LocalizationZhongming Yu, Hejia Zhang, Yujie Zhao, Hanxian Huang et al.ICML 2025
- An LLM-Based Agent-Oriented Approach for Automated Code Design Issue LocalizationFraol Batole, David O'Brien, Tien N. Nguyen, Robert Dyer et al.ICSE 2025 · 7 citations
- CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding ChallengesKechi Zhang, Jia Li, Ge Li, Xianjie Shi et al.ACL 2024
- Enhancing Issue Localization Agent with Tool-Interactive TrainingZexiong Ma, Chao Peng, Qunhong Zeng, Pengfei Gao et al.ICSE 2026
- How Much Static Structure Do Code Agents Need? A Study of Deterministic AnchoringZhihao Lin, Mingyi Zhou, Yizhuo Yang, Li LiISSTA 2026
