Abstract
Hallucinations in LLMs present a critical barrier to their reliable usage. Existing research usually categorizes hallucination by their external properties rather than by the LLMs' underlying internal properties. This external focus overlooks that hallucinations may require tailored mitigation strategies based on their underlying mechanism. We propose a framework for categorizing hallucinations along two axes: knowledge and certainty. Since parametric knowledge and certainty may vary across models, our categorization method involves a model-specific dataset construction process that differentiates between those types of hallucinations. Along the knowledge axis, we distinguish between hallucinations caused by a lack of knowledge and those occurring despite the model having the knowledge of the correct response. To validate our framework along the knowledge axis, we apply steering mitigation, which relies on the existence of parametric knowledge to manipulate model activations. This addresses the lack of existing methods to validate knowledge categorization by showing a significant difference between the two hallucination types. We further analyze the distinct knowledge and hallucination patterns between models, showing that different hallucinations do occur despite shared parametric knowledge. Turning to the certainty axis, we identify a particularly concerning subset of hallucinations where models hallucinate with certainty despite having the correct knowledge internally. We introduce a new evaluation metric to measure the effectiveness of mitigation methods on this subset, revealing that while some methods perform well on average, they fail disproportionately on these critical cases. Our findings highlight the importance of considering both knowledge and certainty in hallucination analysis and call for targeted mitigation approaches that consider the hallucination underlying factors.
Introduction
Most research on hallucinations focuses on external properties: Is the answer in the provided text? Is it a "faithfulness" error or a "factuality" error? However, these labels often fail to explain why a model failed. A model might hallucinate because it simply lacks the fact in its parameters (HK-), or it might hallucinate even though the information is buried in its weights (HK+).
The latter is particularly insidious in high-stakes fields like medicine or law. If a model is confident (HC+) but wrong, users are likely to trust it. If it is confident, wrong, and actually knows the truth internally, we have a fundamental breakdown in how the model's internal "beliefs" translate to its output behavior. This paper introduces HACK, a framework to map these internal failures.
The HACK Framework
The HACK framework categorizes hallucinations along two internal dimensions: Knowledge (HK) and Certainty (HC). This creates four distinct quadrants of model behavior:
- Certainty Misalignment (HK+, HC+): The model encodes the correct information but generates a contradictory output with high certainty.
- Hesitation (HK+, HC-): The model encodes the correct information but generates a hallucination with low certainty, suggesting retrieval failure.
- Uninformed Guess (HK-, HC+): The model lacks the knowledge yet generates an incorrect output with high certainty.
- Informed Hedging (HK-, HC-): The model lacks the knowledge and expresses low confidence in its response.
Methodology: Detecting and Inducing Hallucinations
To map the "internal geography" of hallucinations, the authors developed a multi-step approach:
- Knowledge Detection: They determine if a model "knows" a fact by checking if it can produce the correct answer consistently across multiple sampled generations (using 3-shot in-context learning).
- Hallucination Induction: They use "benign" prompt variations—such as asking the model to act as a specific persona or simply telling it to be "truthful"—to see if they can trigger a hallucination for a fact the model clearly knows.
- Validation via Activation Steering: To prove that HK+ (hallucination with knowledge) is different from HK- (hallucination without knowledge), they use activation steering. By shifting the model's internal hidden states toward "truthful" patterns, they found they could "nudge" the model into being correct—but only if the knowledge was already present in the parameters.
Key Insights and Results
The Prevalence of Certainty Misalignment
The study found that Certainty Misalignment (CM) is widespread, occurring in 9% to 43% of all hallucination cases across models like Llama-3.1-8B, Mistral-7B-v0.3, and Gemma-2. CM hallucinations are remarkably consistent across different prompt styles, suggesting they stem from a stable, albeit flawed, internal mechanism rather than random noise.
The Instruction-Tuning Paradox
Interestingly, instruction-tuned models (those trained with RLHF to be more helpful) are often less calibrated than their base counterparts. They tend to be more confident when they hallucinate, even when they possess the correct internal knowledge. This suggests that the pressure to be helpful may override the model's internal factual grounding.
Mitigation Blind Spots
Standard mitigation techniques, such as self-reflection prompting or simple certainty-based filtering, perform well on average but fail disproportionately on CM cases. The authors introduced a CM-Score to evaluate this specific failure mode. They developed a "CM-tuned" linear probe that outperformed general-purpose mitigation methods by 1%–5%, proving that targeted internal monitoring is more effective than external prompting.
Conclusion
The HACK framework reveals that LLMs are often "dishonest," generating answers that contradict their own internal knowledge. While activation steering can act as a "truth serum" for HK+ cases—reducing these hallucinations by up to 22%—fully mitigating high-confidence hallucinations remains an open problem. Future work must address why internal knowledge is sometimes overridden during the decoding process, particularly in instruction-tuned models.
Summary updated