Large Language Models (LLMs) frequently generate logically inconsistent sentences within the same context—a clear indicator of hallucination. This paper introduces a novel, prompting-based framework to automatically trigger, detect, and mitigate these self-contradictions, significantly improving model reliability for black-box systems without relying on external knowledge bases.
The Problem: Self-Contradiction as a Hallucination Proxy
Hallucinations remain a major hurdle for LLM deployment. While many researchers focus on verifying facts against external sources like Wikipedia (e.g., via Retrieval-Augmented Generation or RAG), this paper tackles a more fundamental issue: internal consistency.
When a model generates two logically inconsistent sentences in the same response (e.g., stating a person was born in two different years), it is a "smoking gun" for non-factuality. Crucially, the authors found that a significant portion of these errors—over 35% for ChatGPT—cannot be verified using online text. This makes internal consistency checks a vital and complementary tool to traditional retrieval-based methods.
A Three-Step Framework: Trigger, Detect, Mitigate
The authors propose a pipeline that operates entirely on "black-box" models accessible only via API:
- Triggering: To test a model's certainty about a generated fact, an Information Extraction (IE) tool identifies a (subject, relation) pair in a sentence. The system then prompts the model to generate a new sentence for that same pair, given the preceding context.
- Detection: An "analyzer LM" (aLM) uses zero-shot Chain-of-Thought prompting to compare the original and triggered sentences. It reasons through whether they describe the same subject and if they are logically inconsistent.
- Mitigation: If a contradiction is detected, the aLM is prompted to iteratively revise the text. This surgically removes the conflicting information while maintaining the text's overall fluency and informativeness.
Evaluation Datasets
To rigorously test their approach, the researchers introduced MainTestSet, a benchmark of 360 encyclopedic descriptions covering 30 diverse entities across history, science, and pop culture. These were generated by four distinct models: GPT-4, ChatGPT, Llama2-70B-Chat, and Vicuna-13B. They also utilized a larger secondary set for scalability testing and the standard PopQA dataset to demonstrate the framework's applicability to shorter question-answering tasks.
Key Findings and Performance
The study reveals that self-contradictions are prevalent across all tested models, including state-of-the-art proprietary systems.
- Prevalence: Even advanced models like GPT-4 exhibit a self-contradiction trigger rate of roughly 15.7%, while ChatGPT sits at 17.7%.
- Detection Accuracy: The proposed detection framework is highly effective. Using a stronger model like GPT-4 to analyze responses yielded an F1 score of 86.5% for detection. When ChatGPT was used as the analyzer, it still achieved a robust F1 score of 83.7%.
- Successful Mitigation: The mitigation step successfully removed up to 89.5% of detected contradictions while retaining nearly 100% of the original informative facts, proving that iterative refinement works without destroying the utility of the response.
Limitations and Future Directions
While highly effective, the framework currently focuses on detecting contradictions between sentences at the same relative position in the text. Expanding this to detect "long-range" contradictions across lengthy documents remains an open challenge. Additionally, the system's success relies heavily on the reasoning power of the analyzer LM; smaller open-source models still struggle with the complex logic required for high-recall detection.
Ultimately, while this serves as a powerful post-processing tool (available publicly at chatprotect.ai), a promising future direction is integrating these self-correction signals directly into the model's training loop to prevent hallucinations from being generated in the first place.
Summary updated