SemLoc: Structured Grounding of Free-Form LLM Reasoning for Fault Localization

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Yang, Zhaorui, Zhu, Haichao, Zhang, Qian, Gupta, Rajiv, Kundu, Ashish
Format: Preprint
Publié: 2026
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914433343684608
author Yang, Zhaorui
Zhu, Haichao
Zhang, Qian
Gupta, Rajiv
Kundu, Ashish
author_facet Yang, Zhaorui
Zhu, Haichao
Zhang, Qian
Gupta, Rajiv
Kundu, Ashish
contents Fault localization identifies program locations responsible for observed failures. Existing techniques rank suspicious code using syntactic spectra--signals derived from execution structure such as statement coverage, control-flow divergence, or dependency reachability. These signals collapse for semantic bugs, where failing and passing executions follow identical code paths and differ only in whether semantic intent is satisfied. Recent LLM-based approaches introduce semantic reasoning but produce stochastic, unverifiable outputs that cannot be systematically cross-referenced across tests or distinguish root causes from cascading effects. We present SemLoc, a fault localization framework based on structured semantic grounding. SemLoc converts free-form LLM reasoning into a closed intermediate representation that binds each inferred property to a typed program anchor, enabling runtime checking and attribution to program structure. It executes instrumented programs to construct a semantic violation spectrum--a constraint-by-test matrix--from which suspiciousness scores are derived analogously to coverage-based methods. A counterfactual verification step further prunes over-approximate constraints and isolates primary causal violations. We evaluate SemLoc on SemFault-250, a corpus of 250 Python programs with single semantic faults. SemLoc outperforms five coverage-, reduction-, and LLM-based baselines, achieving Top-1 accuracy of 42.8% and Top-3 of 68%, while reducing inspection to 7.6% of executable lines. Counterfactual verification provides an additional 12% accuracy gain and identifies primary causal semantic constraints.
format Preprint
id arxiv_https___arxiv_org_abs_2603_29109
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle SemLoc: Structured Grounding of Free-Form LLM Reasoning for Fault Localization
Yang, Zhaorui
Zhu, Haichao
Zhang, Qian
Gupta, Rajiv
Kundu, Ashish
Software Engineering
Artificial Intelligence
K.6.3; D.2.5
Fault localization identifies program locations responsible for observed failures. Existing techniques rank suspicious code using syntactic spectra--signals derived from execution structure such as statement coverage, control-flow divergence, or dependency reachability. These signals collapse for semantic bugs, where failing and passing executions follow identical code paths and differ only in whether semantic intent is satisfied. Recent LLM-based approaches introduce semantic reasoning but produce stochastic, unverifiable outputs that cannot be systematically cross-referenced across tests or distinguish root causes from cascading effects. We present SemLoc, a fault localization framework based on structured semantic grounding. SemLoc converts free-form LLM reasoning into a closed intermediate representation that binds each inferred property to a typed program anchor, enabling runtime checking and attribution to program structure. It executes instrumented programs to construct a semantic violation spectrum--a constraint-by-test matrix--from which suspiciousness scores are derived analogously to coverage-based methods. A counterfactual verification step further prunes over-approximate constraints and isolates primary causal violations. We evaluate SemLoc on SemFault-250, a corpus of 250 Python programs with single semantic faults. SemLoc outperforms five coverage-, reduction-, and LLM-based baselines, achieving Top-1 accuracy of 42.8% and Top-3 of 68%, while reducing inspection to 7.6% of executable lines. Counterfactual verification provides an additional 12% accuracy gain and identifies primary causal semantic constraints.
title SemLoc: Structured Grounding of Free-Form LLM Reasoning for Fault Localization
topic Software Engineering
Artificial Intelligence
K.6.3; D.2.5
url https://arxiv.org/abs/2603.29109