Introduction
Large Language Models (LLMs) frequently generate "fact-conflicting hallucinations" (FCH)—content that is confidently stated but factually incorrect. Current evaluation methods for FCH face two primary hurdles: the static nature of manually curated benchmarks like TruthfulQA, which quickly become outdated as world knowledge evolves, and the "Right Answer, Wrong Reason" problem, where a model provides a correct final judgment based on flawed internal logic.
To address these gaps, we present HalluVault (also referred to as Drowzee), an automated framework that leverages logic programming to transform static facts into complex reasoning puzzles. By evaluating the semantic structure of an LLM's justification against ground-truth logical derivations, HalluVault identifies hallucinations that traditional string-matching benchmarks overlook, revealing deep-seated reasoning flaws in even the most advanced models.
The HalluVault Framework
HalluVault combines logic programming (Prolog) with metamorphic testing through a four-stage workflow designed to expose logical inconsistencies:
- Factual Extraction: The system crawls Wikipedia and Wikidata to extract factual "triples" (e.g., Haruki Murakami, won_award, Gunzo Prize). The resulting knowledge base contains over 54,000 entities and 1.6 million factual triples.
- Logical Mutation: This is the core innovation. Using five reasoning rules—Negation, Symmetric, Inverse, Transitive, and Composite—HalluVault derives new, complex facts from the base triples. For example, if A is bigger than B, and B is bigger than C, it derives the new fact that A is bigger than C.
- Hallucination-Revealing Prompts: It generates Q&A pairs requiring the LLM to provide both a judgment and a step-by-step justification. This forces the model to expose its internal reasoning process.
- Semantic-Aware Oracles: Instead of simple keyword matching, HalluVault uses NLP to extract the logical structure of the LLM’s reasoning and compares it to a ground-truth logic graph using Jaccard Similarity. If the reasoning graph diverges significantly from the truth, it is flagged as a hallucination.
Categorizing Hallucinations
A key insight from HalluVault is the distinction between Erroneous Knowledge Hallucinations (where the model simply lacks the fact) and Erroneous Inference Hallucinations (where the model knows the facts but fails to connect them logically).
Research indicates that inference errors are a more frequent cause of hallucinations than a simple lack of knowledge. Models often possess the necessary information but fail during multi-step logical processing. The study found that Transitive Reasoning (e.g., if A → B and B → C, then A → C) triggered the most hallucinations across all tested models. Furthermore, LLMs exhibit "temporal blindness," struggling to correctly sequence events in time even when they know the individual dates involved.
Experimental Results
Testing across six major models, including GPT-4, ChatGPT (GPT-3.5), Llama2, and Mistral, revealed significant vulnerabilities:
- Hallucination Rates: Rates were surprisingly high, ranging from 24.7% for GPT-4 to 59.8% for Mistral-7B.
- Detection Accuracy: HalluVault achieved 100% accuracy in detecting hallucinations in a quantitative subset, significantly outperforming FActScore (97%) and TruthfulQA (89%).
- Domain Sensitivity: Models performed worst in "Nature" and "Math" domains, likely due to the lower density of specialized interrelationships in training data compared to general history or culture.
- Mitigation Challenges: Experiments with "Model Editing" (ROME and MEMIT) showed that while effective for fixing a small number of facts, attempting to edit more than 1,000 facts caused model degradation, suggesting that "patching" is not a scalable solution for logical flaws.
Conclusion
HalluVault demonstrates that current LLMs struggle immensely with multi-step logical inference, even when they possess the underlying factual knowledge. The framework's ability to detect "hidden" hallucinations through semantic reasoning graphs provides a more robust test oracle than traditional benchmarks. Future work must focus on improving the core logical reasoning capabilities of LLMs rather than just expanding their static knowledge bases.
Summary updated