Constructing Benchmarks and Interventions for Combating Hallucinations in LLMs

Adi Simhi, Jonathan Herzig, Idan Szpektor, Yonatan BelinkovarXiv 2024 · DOI

Abstract

Large Language Models (LLMs) often hallucinate even when the required knowledge is present in their parameters. This paper introduces the WACK (Wrong Answer despite having Correct Knowledge) framework to isolate these specific failure modes. The authors propose a "whitebox" intervention strategy using dynamic, pre-answer steering vectors. Their findings highlight that intervening in attention mechanisms is significantly more effective than traditional residual stream steering, reducing hallucinations without compromising the model's general language performance.

Introduction: Defining the Hallucination Problem

"Hallucination" is frequently used as a broad term for any incorrect LLM output. However, a critical distinction exists between a model being wrong because it lacks information and being wrong despite possessing the correct knowledge. The latter often occurs when a model is distracted by misleading prompts or conflicting contexts.

To address this, the authors introduce the WACK framework. By isolating cases where a model "knows" the truth but fails to output it, researchers can develop precise surgical interventions. This approach moves beyond general "blackbox" fixes toward internal "whitebox" steering of the model's hidden states.

The WACK framework categorizes model outputs to isolate hallucinations occurring despite the presence of correct underlying knowledge.

Methodology: Detection and Steering

The researchers employ a three-step approach to mitigate WACK-style hallucinations:

  1. Categorization: Using sampling-based methods, they identify questions the model consistently answers correctly in "clean" settings (Type 3 knowledge).
  2. Detection: An SVM classifier is trained on internal hidden states to identify signals of impending hallucinations before the first token of the answer is generated.
  3. Intervention (Steering): Steering vectors are calculated to represent the "direction" of truthfulness in the model's high-dimensional space. These vectors are added to activations during inference to nudge the model toward grounded answers.

A key innovation is Pre-answer steering, which calculates vectors before a hallucination occurs, better reflecting real-world deployment. Additionally, Dynamic Intervention applies these nudges only when the detector signals a high likelihood of error, preserving performance on grounded examples.

Key Insights and Results

The study reveals that the site of intervention is as important as the method itself. While many prior works target the "residual stream," this research finds that intervening in attention blocks and heads is far more effective.

Performance metrics across different intervention sites. Intervening in attention and heads provides significant accuracy gains while maintaining low perplexity compared to the residual stream.

Accuracy vs. Model Integrity

As shown in the experimental results, static interventions in the residual stream often lead to a "skyrocketing" of perplexity, essentially breaking the model's general language capabilities. In contrast, targeting attention mechanisms allows for substantial gains in generation accuracy (up to ~12% in open-book settings) while keeping WikiText perplexity at manageable levels.

The Power of Dynamic Intervention

Static interventions apply the same "nudge" regardless of the input, which can degrade performance on already-correct answers. Dynamic intervention acts as a surgical strike, only activating when necessary. This approach proved robust, especially in instruction-finetuned models like Goat-7B, which showed higher amenability to internal steering than base models.

Conclusion

By distinguishing between ignorance and hallucination, the WACK framework provides a more rigorous benchmark for LLM reliability. The success of dynamic, pre-answer steering in attention blocks suggests that hallucinations are often failures of information "attention" rather than a lack of internal data. Future work will explore these interventions in more diverse architectures and complex prompt formats.

Summary updated

BibTeX
@misc{simhi2024constructing,
  author = {Adi Simhi and Jonathan Herzig and Idan Szpektor and Yonatan Belinkov},
  title = {{Constructing Benchmarks and Interventions for Combating Hallucinations in LLMs}},
  year = {2024},
  eprint = {2404.09971},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.09971},
}
Figure