Papers
Topics
Authors
Recent
Search
2000 character limit reached

CausalGaze: Unveiling Hallucinations via Counterfactual Graph Intervention in Large Language Models

Published 13 Apr 2026 in cs.LG | (2604.11087v1)

Abstract: Despite the groundbreaking advancements made by LLMs, hallucination remains a critical bottleneck for their deployment in high-stakes domains. Existing classification-based methods mainly rely on static and passive signals from internal states, which often captures the noise and spurious correlations, while overlooking the underlying causal mechanisms. To address this limitation, we shift the paradigm from passive observation to active intervention by introducing CausalGaze, a novel hallucination detection framework based on structural causal models (SCMs). CausalGaze models LLMs' internal states as dynamic causal graphs and employs counterfactual interventions to disentangle causal reasoning paths from incidental noise, thereby enhancing model interpretability. Extensive experiments across four datasets and three widely used LLMs demonstrate the effectiveness of CausalGaze, especially achieving over 5.2\% improvement in AUROC on the TruthfulQA dataset compared to state-of-the-art baselines.

Summary

  • The paper introduces an active causal intervention framework using gradient-guided counterfactual graph adjustments to improve hallucination detection in LLMs.
  • It refines internal attention structures to suppress non-causal noise, achieving superior robustness and generalization across multiple datasets.
  • Empirical evaluations demonstrate notable AUROC and F1 score improvements over traditional methods on models like Llama2-7B, validating the approach's efficacy.

CausalGaze: Active Causal Intervention for Hallucination Detection in LLMs

Introduction and Motivation

Hallucination—generation of plausible but factually erroneous assertions—remains a primary impediment to deploying LLMs in domains demanding high reliability. Conventional hallucination detection strategies, particularly those focused on classification using static internal features (hidden states or attention maps), have been constrained by their reliance on correlational signals contaminated with noise and spurious associations, lacking rigorous causal interpretability. Graph-based variants integrating hidden states (nodes) and attention (edges) improve representational fidelity but remain vulnerable to indiscriminate propagation of non-causal dependencies, limiting their robustness and generalization.

To address these deficiencies, the presented work proposes a causal paradigm shift: moving from passive observational analysis of internal model representations to active, interventionist approaches using structural causal models (SCMs). This framework, termed CausalGaze, applies gradient-guided counterfactual graph intervention to LLMs’ internal computation, actively identifying and leveraging causal reasoning structures while suppressing noisy and spurious graphical dependencies.

Framework and Methodology

CausalGaze models LLM reasoning for each answer as a dynamic causal graph, where sequence-level hidden states constitute graph nodes and attention relations are encoded as weighted directed edges. Unlike static observation pipelines, CausalGaze intervenes in the attention structure by quantifying the causal sensitivity of each edge via loss gradients, approximating the local individual treatment effect.

Specifically, for each edge (i,j)(i,j) with weight AijA_{ij} in the attention map AA, the framework calculates the gradient ∂LDetector∂Aij\frac{\partial \mathcal{L}_{Detector}}{\partial A_{ij}}, corresponding to the local effect on hallucination detection loss. The elementwise Hadamard product ∣A⊙∇AL∣|A \odot \nabla_A \mathcal{L}| reflects causal sensitivity, allowing the construction of refined, causally-consistent adjacency matrices A~\tilde{A}. A dynamic, learnable gate (CRL) further modulates these edges, explicitly prioritizing structural dependencies aligned with factual provenance and causal contribution.

Figure 1

Figure 1: Overall architecture of CausalGaze, highlighting gradient-guided edge refinement and subsequent causal GNN-based hallucination detection.

This mechanically rooted intervention enables a GNN-based classifier to operate on causal graphs with substantially reduced non-causal noise, sharpening both the detection accuracy and interpretability. Fine-grained causal subgraphs are also constructed by combining saliency scores (via gradient norms of hidden states) with the refined graph, enabling token-level, path-specific interpretability.

Empirical Evaluation

CausalGaze is evaluated across four datasets (TruthfulQA, TriviaQA, SciQ, HaluEval) and three open-source LLMs (Llama2-7B, Qwen2-7B, Mistral-7B), benchmarking against representative approaches: consistency-based (SelfCheckGPT, EigenScore), logit/entropy-based (Perplexity, LN-Entropy, Semantic Entropy), and classification-based (ICR-Probe, HaluGNN, etc.).

Quantitative Results

Numerical results demonstrate that CausalGaze outperforms all tested baselines:

  • On TruthfulQA, CausalGaze attains 5.2% AUROC improvement over HaluGNN (a strong graph-based competitor) on Llama2-7B and exhibits similar advantages across other datasets and models.
  • Classification-based methods leveraging internal representations generally dominate, but CausalGaze’s active causal intervention consistently yields higher robustness and superior generalization, particularly on cross-domain benchmarks.

Notably, HaluGNN, while benefiting from the graph representation, is hampered by noisy edge inclusion; CausalGaze’s interventions markedly attenuate these artefacts, directly reflecting in improved F1 scores and AUROC metrics.

Figure 2

Figure 2: Cross-dataset generalization; CausalGaze notably outperforms HaluGNN, demonstrating superior robustness to domain shift.

Model Analysis and Ablation Studies

  • Projection Layer: Introducing lower-dimensional projections (optimal at 128 dimensions) for node features boosts detection accuracy, suggesting that high-dimensional raw features contain redundant or noisy information.
  • Layerwise Analysis: Optimal hallucination detection signal arises from mid-to-late model layers (e.g., Layer 20 in Llama2-7B), consistent with the distribution of factual and contextual knowledge in transformer architectures.

Figure 3

Figure 3: Detection performance of CausalGaze using causal graphs from different layers—mid-to-late layers provide the best results.

  • Gradient Guidance: Ablation confirms a significant degradation (~2-4% F1) when the model lacks gradient-based causal guidance, reverting to purely statistical correlation, or when substituting random perturbations, validating the causal effect hypothesis.
  • Computation Overhead: While CausalGaze moderately increases model parameters and inference time (still sub-ms latency), the tradeoff is justified by substantial gains in both performance and interpretability.

Interpretability

CausalGaze presents token-level attributions and path-level causal dependencies for both hallucinated and factual answers. Interventional causal graphs visually prune non-informative nodes and spurious edges, exposing the minimal substructures critical for hallucination/factuality attribution.

Figure 4

Figure 4

Figure 4: Token-level interpretability comparison—top causal nodes and edges differ sharply between hallucinated and factual responses, in alignment with ground-truth label structure.

Theoretical and Practical Implications

CausalGaze pioneers the application of active, gradient-based structural intervention in the context of LLM hallucination detection, moving firmly beyond post hoc explanation to direct causal probing. This approach elevates both theoretical rigor (via SCMs and local ITE approximations) and practical utility in high-stakes settings (e.g., factuality-critical dialogue, scientific QA, medical reasoning).

From the theoretical perspective, this work demonstrates that internal representations contaminated by high-cardinality, non-causal dependencies can be effectively disentangled via targeted, differentiable interventions—offering a template for extending causal discovery to other LLM analysis tasks. Practically, by maintaining sub-millisecond inference latency and targeting open-source models, CausalGaze is positioned as a real-time, deployable safety and interpretability scaffold for LLM-based applications.

Nevertheless, limitations include current restrictions to white-box access and modeling only single-layer causal subgraphs (potential information loss across layer hierarchies). Future directions include designing layer-compositional causal interventions, improving resource efficiency, and exploring integration with knowledge-retrieval and verification systems.

Conclusion

CausalGaze offers a causally grounded, interventionist framework for hallucination detection in LLMs, demonstrating significant improvements in detection accuracy, robustness, and interpretability over competing baselines. The framework’s explicit interventions reconcile the need for fine-grained attribution with practical efficiency, establishing a foundation for future research on causally aware, trustworthy LLM deployment.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.