Detecting Hallucinations in Retrieval-Augmented Generation via Semantic-level Internal Reasoning Graph

Jianpeng Hu, Yanzeng Li, Jialun Zhong, Lei Zou, Wenfa Qi

TL;DR

While Retrieval-Augmented Generation (RAG) reduces factual errors in large language models, models still frequently suffer from "faithfulness hallucinations"—generating text that contradicts the provided context. This paper introduces SIRG (Semantic-level Internal Reasoning Graph), a novel framework that tracks an LLM's internal reasoning pathways at the semantic level to accurately diagnose and catch these hallucinations using a lightweight discriminator.

What Problem Does This Paper Address?

RAG systems are widely used to ground LLM outputs in real-world documents. However, even with the right context right in front of them, LLMs still experience faithfulness hallucinations, where the generated response ignores or contradicts the retrieved context.

Detecting these errors is tricky. Black-box methods (like asking another LLM to validate the response) are computationally expensive and can amplify the model's inherent biases. On the other hand, white-box methods look inside the model's internal states or token-level attributions, but they suffer from extreme noise. A lot of generated tokens are just structural "linking tokens" (e.g., “the”, “which”) rather than "substantive tokens" carrying actual information. Mixing these up makes it incredibly difficult for a hallucination detector to learn what the model is actually focusing on.

Methods

The authors propose SIRG, a framework that elevates internal model attribution from noisy individual tokens to clean semantic concepts.

Overview of the SIRG framework

The pipeline consists of four main stages:

  1. Token-level Attribution: The framework uses Layer-wise Relevance Propagation (LRP) to calculate how much each input token contributes to every generated token based on internal gradients.
  2. Semantic Segmentation & Entity Filtering: Instead of analyzing raw tokens, the text is split into semantic fragments. Crucially, the authors use entity extraction tools (like SpaCy) to isolate core substantive words (nouns, verbs, negations) and filter out structural filler words.
  3. Graph Construction: A directed Internal Reasoning Graph is built. Nodes represent the semantic fragments of both the context and the response. Edges represent the aggregated attribution scores between them.
  4. Hallucination Discrimination: For each response fragment, its incoming reasoning edges are linearized into a text prompt. This prompt is fed into a fine-tuned, lightweight Pre-trained Language Model (specifically AlignScore, based on RoBERTa) to determine if that specific fragment is a hallucination. A flexible threshold ($\alpha$) aggregates these fragment scores to make a final judgment on the entire response.
Example of a semantic-level internal reasoning graph

Datasets

The authors evaluated SIRG on two primary benchmarks:

  • RAGTruth: A manually annotated dataset designed for analyzing hallucinations in RAG tasks. The authors tested outputs generated by Llama-7B and Llama-13B.
  • Dolly-15k: A dataset covering multiple NLP scenarios. The authors filtered for closed-domain question-answering tasks and evaluated outputs from Qwen2.5-3B and Qwen2.5-7B.

Key Insights and Ideas

  • The Substantive-to-Linking Shift: The core "aha moment" of the paper is that hallucinations happen when an LLM mistakenly treats a substantive concept as a linking token. Instead of drawing deep connections to the long-distance context, the model falls back on surface-level entity popularity and local token fluency.
  • Self-Referential Attribution: When a model hallucinates, its internal reasoning graph reveals that it pays more attention to its own previously generated tokens than to the user-provided context documents.
  • Noise Reduction via Aggregation: Moving from token-level LRP to entity-filtered semantic fragments dramatically clarifies the attribution signal, making it possible for a small 124M-parameter model (AlignScore) to outperform massive LLMs at detection tasks.

Key Results

SIRG consistently outperformed state-of-the-art baselines—including prompt-based LLMs, SelfCheckGPT, and token-level LRP methods—across both datasets.

  • On RAGTruth (Llama-13B): SIRG achieved an F1-score of 81.84%, significantly outperforming the previous best token-level LRP baseline (LRP4RAG) at 75.86%.
  • On Dolly-15k (Qwen2.5-7B): SIRG reached an F1-score of 89.71%, compared to 80.80% for the closest baseline.
Impact of the alpha threshold on performance

Furthermore, by adjusting the threshold parameter $\alpha$, engineers can dynamically tune the system to prioritize either strict hallucination filtering or higher pass rates for correct samples depending on the application's needs.

Limitations and Future Work

Despite its strong performance, SIRG has a few notable limitations:

  • Computational Complexity: Calculating internal model gradients via LRP for every single token generation is computationally heavy, leading to high latency during graph construction.
  • Naive Graph Linearization: Flattening the graph structure into a text prompt for the PLM ignores multi-hop dependencies and complex error propagation pathways within the graph.

Future Directions: The authors plan to optimize the LRP process specifically for semantic fragments to reduce computation time. They also aim to explore Graph Neural Networks (GNNs) to better exploit the topological structure of the internal reasoning graphs.

Summary updated

BibTeX
@inproceedings{hu2026detecting,
  author = {Jianpeng Hu and Yanzeng Li and Jialun Zhong and Lei Zou and Wenfa Qi},
  title = {{Detecting Hallucinations in Retrieval-Augmented Generation via Semantic-level Internal Reasoning Graph}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.1385},
}
Figure