DSVD: Dynamic Self-Verify Decoding for Faithful Generation in Large Language Models

YiQiu Guo, Yuchen Yang, Zhe Chen, Pingjie Wang, Yusheng Liao, Ya Zhang, Yanfeng Wang, Yu Wang · DOI

Large Language Models (LLMs) frequently "hallucinate," confidently asserting factual inaccuracies. While existing research attempts to steer models toward truth or employ post-hoc self-correction, these methods often struggle with efficiency or the "error snowball" effect—where an initial mistake compromises the entire subsequent generation. Researchers from Fudan University and Shanghai AI Laboratory have introduced Dynamic Self-Verify Decoding (DSVD), a framework that enables LLMs to monitor their own truthfulness in real-time and "rewind" to fix mistakes the moment they occur.

Comparison of decoding strategies: Direct Decoding, Backtrack Decoding, and DSVD.

Addressing the Hallucination Gap

The core challenge in LLM reliability lies in the trade-off between accuracy and computational cost. Current solutions typically fall into two categories:

  1. Direct Decoding: These methods attempt to steer internal representations toward "truthful" directions during token production. However, they often fail to utilize the model's capacity to recognize mistakes after they have been committed.
  2. Backtracking/Self-Correction: Methods like "Self-Refine" require the model to review and rewrite entire outputs. This is computationally expensive and prone to error propagation, where a single hallucination leads to a sequence of logically consistent but factually incorrect statements.

DSVD bridges this gap by providing a real-time, efficient mechanism that leverages the model's internal "self-awareness" to catch errors locally before they propagate.

The DSVD Framework

DSVD integrates a two-stage approach directly into the decoding process, characterized by parallel verification and dynamic rollback.

The four-step workflow of Dynamic Self-Verify Decoding (DSVD).

1. Fine-Grained Hallucination Detection

The system employs small Multi-Layer Perceptron (MLP) "probing heads" trained on the LLM's internal hidden states. These heads predict, token-by-token, the probability that the model is hallucinating. By running these heads in parallel with the main language modeling head, DSVD adds minimal latency (approximately 5%) since both components share the same underlying representations.

2. Dynamic Rollback and Revision

A key insight of the research is that models often become "aware" of a mistake a few tokens after it occurs. DSVD uses a sliding window to monitor recent tokens. If the probing heads flag a high probability of hallucination, the system triggers a "rollback" to a previous position (e.g., 10 tokens back).

Once rolled back, the model generates multiple candidate continuations. These candidates are re-ranked using a scoring function where the hallucination scores from the probing heads act as a penalty, steering the model toward a more truthful path.

Key Insights and Results

The effectiveness of DSVD stems from several critical observations:

  • Delayed Awareness: LLMs are significantly better at detecting their own errors a few tokens after the mistake than they are at preventing them preemptively. Probing the hidden states of the response yields much higher detection accuracy (AUROC) than probing the hidden states of the initial prompt.
  • Local Correction Efficiency: Correcting an error at its source via local rollback prevents the "error snowball" effect. This approach is far more efficient than global rewriting; even with multiple rollbacks, the latency increase is roughly 20%, compared to over 400% for iterative self-refinement.

Performance Benchmarks

DSVD was evaluated across Llama-2, Llama-3, and Qwen model families on benchmarks including TruthfulQA, EntityQuestions, and FActScore:

  • Truthfulness: On TruthfulQA, DSVD improved the "TruthInfo" metric for Llama-2-7B-Chat by 16.5%* (from 31.9 to 48.4).
  • Factual Accuracy: On the FActScore biography benchmark, DSVD provided absolute improvements of up to 2.8 points.
  • Compatibility: The method is orthogonal to other techniques. When combined with DoLa (Decoding by Contrasting Layers), it achieved even higher scores, indicating it addresses errors missed by other intervention methods.

Limitations and Future Directions

While DSVD significantly enhances reliability, it is bounded by the model's internal "latent knowledge." If a fact was never present in the training data, the model cannot self-verify it. Additionally, probing heads must be trained specifically for each model to capture its unique hallucination patterns.

Future work may involve integrating DSVD with external knowledge sources, such as Retrieval-Augmented Generation (RAG), to allow the model to verify information beyond its static weights, particularly for real-time or highly specialized queries.

Summary updated

BibTeX
@misc{guo2025dsvd,
  author = {YiQiu Guo and Yuchen Yang and Zhe Chen and Pingjie Wang and Yusheng Liao and Ya Zhang and Yanfeng Wang and Yu Wang},
  title = {{DSVD: Dynamic Self-Verify Decoding for Faithful Generation in Large Language Models}},
  year = {2025},
  eprint = {2503.03149},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.03149},
}
Figure