Detecting Hallucinations for Large Language Model-based Knowledge Graph Reasoning

Xinyan Zhu, Yaoqi Liu, Yue Gao, Huadong Ma, Cheng Yang, Chuan ShiarXiv 2026

TL;DR

Even when augmented with accurate Knowledge Graphs (KGs), Large Language Models still suffer from a surprisingly high hallucination rate of nearly 30% during reasoning tasks. To combat this, researchers introduced LUCID, a novel framework that detects hallucinations by fusing the LLM's internal attention states with the semantic and structural topology of the KG using a Graph Neural Network.

What Problem Does This Paper Address?

Integrating LLMs with Knowledge Graphs (KG reasoning) is a popular way to solve complex, fact-based question-answering tasks. By retrieving relevant factual "triples" (arguments/edges) from a structured database and inserting them into the prompt, engineers hope to anchor the LLM in reality.

However, LLMs still frequently hallucinate even when the correct information is sitting right there in the context window. Through manual annotation, the authors discovered an average hallucination rate of 29.65% across popular KG reasoning frameworks.

Figure 2: A hallucination example of the LLM-based KG reasoning framework, including the question, the response generated by LLMs, the correct answer, and the retrieved triples (which are visualized as a graph). The nodes and edges that can help LLMs make correct reasoning are circled in blue, while the incorrect final answers are marked in red.

Existing hallucination detectors fall short because they either look only at the LLM's internal token certainties or evaluate surface-level text consistency (RAG-specific methods). Crucially, they completely ignore the structural graph information inherent to KGs, missing out on how the model logically navigates connections between entities.

Methods

The authors propose LUCID (halLUcination deteCtIon for LLM-based knowleDge graph reasoning), the first method tailored specifically to this paradigm.

LUCID works by extracting and fusing three distinct layers of information:

  1. LLM Internal States: It extracts the attention scores of the generated response tokens relative to the node and edge tokens of the retrieved KG subgraph. These are aggregated into attention matrices across all layers and attention heads.
  2. KG Semantics: It uses a lightweight language model (all-MiniLM-L6-v2) to compute the cosine similarity between the user's query and the textual descriptions of the KG relations (edges).
  3. KG Structure: Node features (flattened attention matrices) and edge features (attention matrices concatenated with semantic similarity scores) are mapped directly onto the retrieved KG subgraph structure.

This enriched graph is then fed into a trained Graph Isomorphism Network with edge features (GINE). The GNN aggregates information via message passing to output a final probability score indicating whether the LLM's response is a hallucination.

Figure 3: The architecture of LUCID. The diagram uses one representative node and edge from the graph as an example. The left portion depicts the typical workflow of an LLM-based KG reasoning framework and the relationships between the various layers and heads inside the LLMs, while the right portion shows how the method constructs a KG subgraph by integrating three information components: LLM internal state, KG semantic and structure information. This enriched subgraph is then processed by a GNN model to generate the predicted hallucination probability.

Datasets

To train and evaluate LUCID, the authors constructed a manually annotated benchmark dataset across three distinct Knowledge Base Question Answering (KBQA) datasets, evaluating three reasoning frameworks (Readi, ToG, and StructGPT):

  • ComplexWebQuestions (CWQ): Used to generate the subgraphs and responses for training the GNN.
  • WebQSP: A single/multi-hop QA dataset used for evaluation.
  • GrailQA: A large-scale dataset covering complex scenarios like multi-hop reasoning and aggregate queries.
  • QALD-10: A multilingual benchmark (the authors utilized the English subset) featuring complex cross-domain questions.

Key Insights and Ideas

  • The "Focus" Matters: Hallucinations in KG-augmented LLMs often happen because the model pays attention to nodes that sound semantically plausible but are structurally disconnected from the logical path. LUCID captures this by aligning the LLM's internal attention maps directly with the graph topology.
  • Graph Structure is Mandatory: Ablation studies showed that replacing the GNN with a standard flat Multi-Layer Perceptron (MLP) caused a significant drop in detection accuracy. Processing graph data in a flat manner destroys the topological relationships critical for verifying reasoning chains.
  • Smart Routing Saves Money: Instead of running massive, expensive models (like Qwen3-235B) for every query, developers can use a smaller model (like Qwen2.5-7B) paired with LUCID. If LUCID flags a high probability of hallucination, only then is the query routed to the larger model for refinement.

Key Results

LUCID was tested against 15 baseline detection methods (including SelfCheckGPT, RAGAs, and ReDeEP) and consistently achieved state-of-the-art (SOTA) performance.

Main results of hallucination detection performance under the Readi framework.
  • Superior Detection Accuracy: LUCID outperformed the best general baseline (SelfCheckGPT) by an average of 6.76% and the best RAG-specific baseline (REDEEP-chunk) by 5.48% across the evaluation metrics (ACC, AUC, PCC).
  • High Efficiency: The model maintains an incredibly low average inference time of just 0.04 milliseconds per sample, making it highly viable for real-time production pipelines.
  • 55.4% Cost Reduction: Implementing LUCID in a "Mixed" model routing strategy retained the high accuracy of a 235B parameter model while slashing API token costs by more than half.

Limitations and Future Work

While highly effective, the authors note a few areas for improvement:

  1. Explainability: Future iterations aim to explore fine-grained hallucination attribution, pinpointing exactly which node or edge caused the model to trip up.
  2. Broader Environments: The current framework needs to be tested in more diverse settings, including fully multilingual and cross-domain knowledge graphs, to ensure its robustness against varied linguistic formulations.

Summary updated

BibTeX
@misc{zhu2026detecting,
  author = {Xinyan Zhu and Yaoqi Liu and Yue Gao and Huadong Ma and Cheng Yang and Chuan Shi},
  title = {{Detecting Hallucinations for Large Language Model-based Knowledge Graph Reasoning}},
  year = {2026},
  eprint = {2606.19351},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.19351},
}
Figure