TDGNet: Hallucination Detection in Diffusion Language Models via Temporal Dynamic Graphs

Arshia Hemmat, Philip Torr, Yongqiang Chen, Junchi YuarXiv 2026

TL;DR

Diffusion language models (D-LLMs) generate text through iterative parallel denoising rather than left-to-right token prediction, rendering traditional hallucination detectors ineffective. TDGNet solves this by modeling the entire generation trajectory as an evolving, token-level dynamic graph. By tracking how token interactions change over time, TDGNet achieves state-of-the-art hallucination detection and token-level localization with minimal computational overhead.

What Problem Does This Paper Address?

Autoregressive large language models (AR-LLMs) generate text sequentially, token by token. Consequently, most hallucination detectors are built to analyze single-pass token probabilities or compare multiple generated outputs for consistency.

Recently, Diffusion Language Models (D-LLMs) like LLaDA and Dream have emerged as powerful alternatives. D-LLMs start with a completely masked sequence and iteratively denoise the entire text in parallel using bidirectional attention. This introduces unique generation dynamics: a model might start with a noisy, incorrect phrase but self-correct later, or it might start on the right track and experience "semantic drift" into a hallucination near the final steps.

Traditional AR detectors fail here because:

  1. Probabilistic Intractability: Computing exact single-pass likelihoods in diffusion models is computationally prohibitive.
  2. Temporal Oscillation: Hallucinations in D-LLMs are dynamic events distributed across the denoising trajectory, not static errors easily caught by inspecting only the final output snapshot.
Figure 1. Why Temporal Modeling is Essential. We visualize four diffusion dynamics that confound static baselines: Self-Correction (early noise resolves into fact); Correctness Decay and Semantic Drift (where factual or plausible states degrade into hallucinations); and Persistent Error (where errors lock in early). TDGNet aggregates structural signals across the trajectory sequences to distinguish these evolving patterns, avoiding the pitfalls of single-snapshot detectors.

Methods

The authors introduce TDGNet (Temporal Dynamic Graph Network), which frames hallucination detection as a learning problem over evolving token-level attention graphs.

The framework operates in three main stages:

  1. Dynamic Graph Construction: At strategic keyframes of the denoising trajectory ($t = T \rightarrow 0$), TDGNet extracts the model's bidirectional attention maps. Tokens serve as fixed nodes, and edges are formed by sparsifying the attention matrix using a threshold ($\tau$) to filter out uniform noise. Node features are initialized from the model's internal hidden states.
  2. Spatial Aggregation: At each timestep, a Message Passing Neural Network (MPNN) aggregates local structural context, mapping out how tokens relate to their attention-induced neighborhoods.
  3. Temporal Memory Update & Readout: A Gated Recurrent Unit (GRU) maintains a persistent memory state for each token, tracking how these spatial relationships evolve across timesteps. Finally, a temporal attention mechanism pools the trajectory history, dynamically prioritizing the denoising phases where structural anomalies are most pronounced.

TDGNet features dual readout heads, allowing it to perform both response-level classification (is the whole answer a hallucination?) and token-level node classification (which specific words are hallucinated?).

Figure 2. Overview of the TDGNet framework. The model extracts attention maps across diffusion denoising steps to construct a temporal dynamic graph, which is then processed by a Temporal Graph Network to predict hallucination probability.

Datasets

The authors evaluated TDGNet across five diverse QA benchmarks:

  • Math: Multi-step numerical and algebraic word problems.
  • CommonsenseQA (CSQA): Multiple-choice everyday reasoning.
  • HotpotQA: Multi-hop reasoning requiring evidence aggregation across multiple documents.
  • TriviaQA & Natural Questions (NQ): Open-domain factoid QA benchmarks. Due to their short, precise answers, these two datasets were specifically used for fine-grained token-level localization experiments.

Key Insights and Ideas

  • Factuality is a Trajectory Property: In D-LLMs, factuality signals are weak at any single denoising step. Instead, evidence accumulates across the denoising history.
  • Attention Graphs Reveal Hidden Pathology: Relational structures (who attends to whom) expose underlying model behavior that surface-level text hides. For instance, a persistent error manifests as a rigid, self-reinforcing attention loop that fails to ground itself in the prompt.
  • The Failure of Static Snapshots: While mid-trajectory snapshots contain stronger signals than the final output, static graph methods still fail because they cannot capture the direction of token drift. Temporal modeling is strictly necessary to differentiate a temporary process instability from a fatal hallucination.
Figure 3. Temporal Consistency Analysis. We compare the inherent validity signal in the data (Blue, ”Branching Fate”) against the accuracy of static snapshots (Orange, CHARM). Key Insight: While the data contains strong early signals (> 81% consistency), static models fail to capture them (dropping to 49.1% accuracy). This gap mathematically motivates TDGNet: the signal exists in the trajectory, but requires temporal modeling to extract.

Key Results

  • State-of-the-Art Detection: Tested on LLaDA-8B and Dream-7B, TDGNet consistently outperformed all output-based, latent-based, and static-graph baselines. It achieved up to an 8.5% AUROC improvement over the strong latent baseline TSV on LLaDA-8B.
  • Precise Token Localization: On the token-level task, TDGNet outperformed the static graph baseline CHARM by 2.1% on TriviaQA, proving that the temporal memory mechanism refines the structural boundaries of errors.
  • High Efficiency: Unlike consistency-based methods (e.g., Semantic Entropy) which require generating multiple independent text samples ($S=5$), TDGNet operates on a single denoising trajectory. This allows it to achieve a ~4.8× speedup (442 seconds vs. 2101 seconds for 100 queries) while maintaining robust performance.

Limitations and Future Work

  • Model Instabilities: The authors noted that older or less stable D-LLMs (like Dream-7B) suffer from structural degradation and mode collapse in zero-shot settings. They had to implement a temperature-scaled curation strategy to separate syntactic fluency failures from actual factual hallucinations.
  • Future Directions: Currently, TDGNet acts as a passive, post-hoc detector. The authors suggest that a promising next step is integrating this temporal graph framework directly into the D-LLM generation loop to actively guide and mitigate hallucinations in real time.

Summary updated

BibTeX
@misc{hemmat2026tdgnet,
  author = {Arshia Hemmat and Philip Torr and Yongqiang Chen and Junchi Yu},
  title = {{TDGNet: Hallucination Detection in Diffusion Language Models via Temporal Dynamic Graphs}},
  year = {2026},
  eprint = {2602.08048},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.08048},
}
Figure