Introduction
Large Language Models (LLMs) have demonstrated remarkable capabilities in text generation, yet they remain prone to "hallucinations"—the generation of factually incorrect information that appears syntactically sound. A critical observation in this domain is the "snowball effect": once an LLM introduces a factual error, it tends to generate subsequent hallucinations to maintain internal consistency with the initial mistake. This paper proposes an active framework to detect and mitigate these errors during the generation process, rather than relying on post-hoc corrections.
The Hallucination Snowball Effect
Research indicates that hallucinations are rarely isolated incidents. If a model generates a false statement in one sentence, the probability of subsequent sentences containing errors increases significantly. This dependency creates a drift where the model moves further away from factual reality as the document progresses. By intervening at the moment of low confidence, the proposed system prevents this error propagation and keeps the model grounded.
Proposed Framework: Active Detection and Mitigation
The core contribution is a multi-stage pipeline integrated directly into the decoding process. Instead of checking every word, which would be computationally prohibitive, the system focuses on "low-confidence" segments.
The process follows five key steps:
- Concept Identification: The LLM is prompted to extract key entities and phrases from a generated sentence.
- Uncertainty Calculation: The system analyzes the logit output values for these concepts. The "Minimum of Token Probabilities" within a phrase serves as a reliable indicator of potential hallucination.
- Validation: Concepts falling below a confidence threshold trigger a validation check. The system generates a verification question and performs a real-time web search (via Bing API) to gather evidence.
- Repair: If external evidence contradicts the generated text, the model is instructed to rewrite the sentence using the retrieved knowledge.
- Continuation: The corrected sentence is appended to the prompt, ensuring the model remains grounded for the next generation step.
Experimental Results
The framework was evaluated across diverse tasks, including article generation across various domains (Sports, Politics, Music, etc.), multi-hop QA (HotpotQA), and adversarial "False Premise" questions.
Key findings include:
- Significant Error Reduction: In article generation, the hallucination rate for GPT-3.5 (text-davinci-003) dropped from 47.5% to 14.5%.
- High Detection Recall: The logit-based detection achieved approximately 88% recall, successfully identifying the vast majority of factual errors.
- Effective Repair: The mitigation step successfully corrected 57.6% of identified hallucinations.
- Adversarial Robustness: On "False Premise" questions (e.g., "Why does Mars have three moons?"), the system correctly identified and rectified the false premise in 76% of cases, whereas the baseline model failed 100% of the time.
Conclusion and Future Work
This "active" approach demonstrates that validating low-confidence generations in real-time is a powerful strategy for maintaining LLM factuality. While the system introduces additional latency and API costs due to the search and validation steps, it effectively breaks the hallucination snowball effect. Future work may involve parallelizing the validation process or applying the framework to summarization tasks where a source document provides the ground truth instead of a web search.
Summary updated