Abstract
Despite their impressive ability to generate high-quality and fluent text, generative large language models (LLMs) also produce hallucinations: statements that are misaligned with established world knowledge or provided input context. However, measuring hallucination can be challenging, as having humans verify model generations on-the-fly is both expensive and time-consuming. In this work, we release HALoGEN, a comprehensive hallucination benchmark consisting of: (1) 10,923 prompts for generative models spanning nine domains including programming, scientific attribution, and summarization, and (2) automatic high-precision verifiers for each use case that decompose LLM generations into atomic units, and verify each unit against a high-quality knowledge source. We use this framework to evaluate ~150,000 generations from 14 language models, finding that even the best-performing models are riddled with hallucinations (sometimes up to 86% of generated atomic facts depending on the domain). We further define a novel error classification for LLM hallucinations based on whether they likely stem from incorrect recollection of training data (Type A errors), or incorrect knowledge in training data (Type B errors), or are fabrication (Type C errors). We hope our framework provides a foundation to enable the principled study of why generative models hallucinate, and advances the development of trustworthy large language models.
Introduction
Large Language Models (LLMs) have transformed natural language processing, yet they remain prone to "hallucinations"—the generation of fluent but factually incorrect or ungrounded text. Addressing this issue is hampered by two primary obstacles. First, measurement is difficult; human verification is too slow and costly for large-scale evaluation across diverse domains. Second, the underlying causes of hallucinations remain poorly understood: it is often unclear if a model fails because it never encountered a fact, learned an incorrect version, or simply failed to retrieve it.
The HALoGEN Framework
To address these challenges, we introduce HALoGEN, an automated, high-precision evaluation pipeline designed to categorize hallucinations at scale. The framework operates in three distinct stages:
- Decomposition: An engine breaks down complex model responses into "atomic units," such as specific library names in code or individual citations in a scientific response.
- Automatic Verification: Each atomic unit is cross-referenced against a domain-specific "source of truth." For instance, code imports are checked against the PyPI index, while citations are verified via Semantic Scholar.
- Error Classification: Hallucinations are categorized into three types based on their likely origin: Type A (failed retrieval of correct training data), Type B (incorrect knowledge learned from training data), and Type C (pure fabrication).
The HALoGEN Benchmark
The HALoGEN benchmark comprises 10,923 prompts across nine diverse scenarios, categorized into response-based and refusal-based tasks. Response-based tasks include code generation, summarization, and biographies. Refusal-based tasks challenge models to identify false premises or non-existent historical events.
Key Insights and Results
Our evaluation of 14 leading LLMs, including GPT-4, Llama-3, and Mistral, revealed several critical insights:
- Domain Specificity: Hallucination performance is not uniform across tasks. A model's accuracy in summarization does not reliably predict its performance in code generation, suggesting that "hallucination" is a collection of distinct failure modes rather than a single issue.
- The "Type B" Code Trap: In programming tasks, up to 72% of hallucinated packages were found in pretraining data. Models often suggest deprecated libraries or local imports they encountered during training rather than fabricating random strings.
- Intrinsic vs. Extrinsic Errors: In summarization, 83% of errors are "intrinsic," where the model misprocesses information provided in the prompt, while only 17% involve external "extrinsic" fabrications.
- The Refusal Gap: Models frequently fail to abstain when appropriate. When prompted about impossible historical meetings, many models generate detailed descriptions of the fictional encounter instead of refusing the prompt.
Overall, GPT-4 and GPT-3.5 lead in factuality, with Llama-3-70B emerging as the strongest open-source contender. However, even GPT-4 exhibited hallucination rates as high as 86% in specific complex domains. Generally, larger models hallucinate less on response-based tasks, though this trend is less consistent in refusal-based scenarios.
Conclusion and Future Work
HALoGEN provides a scalable foundation for the principled study of LLM hallucinations. While our automated verifiers show high agreement with human annotators (83-92%), limitations remain, such as the difficulty of attributing errors in closed-source models. Future research should leverage this framework to build causal models of how specific training data points influence hallucination behaviors, ultimately leading to more trustworthy AI systems.
Summary updated