Next Article in Journal
Three-Level MIFT: A Novel Multi-Source Information Fusion Waterway Tracking Framework
Previous Article in Journal
Real-Time Estimation of Ionospheric Power Spectral Density for Enhanced BDS PPP/PPP-AR Performance
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

LLMLoc: A Structure-Aware Retrieval System for Zero-Shot Bug Localization

1
Department of Computer Applied Mathematics, Hankyong National University, Anseong 17579, Republic of Korea
2
Department of Computer Applied Mathematics (Computer System Institute), Hankyong National University, Anseong 17579, Republic of Korea
*
Author to whom correspondence should be addressed.
Electronics 2025, 14(21), 4343; https://doi.org/10.3390/electronics14214343
Submission received: 11 October 2025 / Revised: 3 November 2025 / Accepted: 3 November 2025 / Published: 5 November 2025

Abstract

Bug localization is a critical task in large-scale software maintenance, as it reduces exploration costs and enhances system reliability. However, existing approaches face limitations due to semantic mismatches between bug reports and source code, insufficient use of structural information, and instability in candidate rankings. To address these challenges, this paper proposes LLMLoc, a system that integrates traditional statistical methods with semantic retrieval, centered on a Structure-Aware Semantic Retrieval (SASR) framework. Experiments on all 835 bugs from the Defects4J dataset show that LLMLoc achieves relative improvements of 3.4 percentage points in Mean Average Precision (MAP) and 29.8 percent in Mean Reciprocal Rank (MRR) compared with state-of-the-art LLM-based methods. These results show that combining structural cues with semantic representations provides more effective retrieval than relying on LLM inference alone. Furthermore, by stabilizing Top-K candidate sets, LLMLoc reduces ranking instability and delivers practical benefits even in real-world maintenance environments with insufficient testing resources.
Keywords: bug localization; large language model; structure-aware retrieval; semantic + structural fusion; Defects4J bug localization; large language model; structure-aware retrieval; semantic + structural fusion; Defects4J

Share and Cite

MDPI and ACS Style

Nam, G.; Yang, G. LLMLoc: A Structure-Aware Retrieval System for Zero-Shot Bug Localization. Electronics 2025, 14, 4343. https://doi.org/10.3390/electronics14214343

AMA Style

Nam G, Yang G. LLMLoc: A Structure-Aware Retrieval System for Zero-Shot Bug Localization. Electronics. 2025; 14(21):4343. https://doi.org/10.3390/electronics14214343

Chicago/Turabian Style

Nam, Gyumin, and Geunseok Yang. 2025. "LLMLoc: A Structure-Aware Retrieval System for Zero-Shot Bug Localization" Electronics 14, no. 21: 4343. https://doi.org/10.3390/electronics14214343

APA Style

Nam, G., & Yang, G. (2025). LLMLoc: A Structure-Aware Retrieval System for Zero-Shot Bug Localization. Electronics, 14(21), 4343. https://doi.org/10.3390/electronics14214343

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop