mlsanityData to 7 Oct 2026

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

arXiv 2603.29109 ↗First posted 31 Mar 2026cs.SE cs.AIcited by 0

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

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.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 10 of its 38 references that are in the map. First posted on arXiv 31 Mar 2026.

Builds on

10 of 38 references.

References · 10

  1. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  2. 2023A Quantitative and Qualitative Evaluation of LLM-Based Explainable Fault Localizationcited by 50
  3. 2024AgentFL: Scaling LLM-based Fault Localization to Project-Level Contextcited by 47
  4. 2024BugsInPy: A Database of Existing Bugs in Python Programs to Enable Controlled Testing and Debugging Studiescited by 35
  5. 2022DeepStability: A Study of Unstable Numerical Methods and Their Solutions in Deep Learningcited by 11
  6. 2016Spectrum-based Software Fault Localization: A Survey of Techniques, Advances, and Challengescited by 9
  7. 2024FlexFL: Flexible and Effective Fault Localization with Open-Source Large Language Modelscited by 8
  8. 2025Simple Fault Localization using Execution Tracescited by 2
  9. 2026Procedural Refinement by LLM-driven Algorithmic Debugging for ARC-AGI-2cited by 2
  10. 2025Leveraging counterfactual concepts for debugging and improving CNN model performancecited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Demystifying Faulty Code with LLM: Step-by-Step Reasoning for Explainable Fault Localization
  2. 2025Assessing the Impact of Code Changes on the Fault Localizability of Large Language Models
  3. 2026ConFL: Explainable Concurrent Fault Localization via Hierarchy-Guided LLM Reasoning
  4. 2025Enhancing LLM-based Fault Localization with a Functionality-Aware Retrieval-Augmented Generation Framework ↗
  5. 2026An Execution-Verified Multi-Language Benchmark for Code Semantic Reasoning
  6. 2025Exploring the Potential and Limitations of Large Language Models for Novice Program Fault Localization ↗
  7. 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation
  8. 2026RGFL: Reasoning Guided Fault Localization for Automated Program Repair Using Large Language Models