RSSAmplifier

Michael Brenndoerfer | Data & AI, Private Equity, Technology · Mar 18, 2026

Hallucination Types in Language Models

0
Sign in to vote or save

Michael Brenndoerfer · mbrenndoerfer.com

Explains how language models hallucinate: intrinsic and extrinsic hallucination, factual errors, fabrication, and inconsistency with NLI-based detection.

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Hallucination TypesLink Copied

Language models can produce text that sounds completely authoritative while being factually wrong. A model asked to summarize a document might flip a date, invent a statistic, or describe an event that never happened, all in the same confident, fluent tone it uses when it is correct. This phenomenon, called hallucination, is one of the central reliability challenges in deploying language models for real-world tasks.

The word "hallucination" comes from psychology, where it describes perceiving something that is not there. In language models, the analogy holds: the model generates text that has no basis in fact or source material, yet the output looks and sounds like valid information. Unlike a person who might hedge ("I think it was around 1965..."), a language model often delivers fabricated content with the same certainty as verified facts.

In this chapter, you will learn the precise taxonomy of hallucination types, understand why these distinctions matter for detection and mitigation, and build intuition for how researchers measure hallucination in practice. We will explore intrinsic and extrinsic hallucination, factual errors, fabrication, and inconsistency, working through concrete examples throughout. The next chapters will cover how to detect these hallucinations (Hallucination Detection) and why they occur in the first place (Hallucination Causes).

What Is Hallucination in Language Models?Link Copied

Hallucination refers to generated content that is unfaithful to a provided source, factually incorrect, or entirely fabricated. The term covers a wide range of failure modes, from subtle factual inaccuracies to wholesale invention of events, people, or citations that do not exist.

The Faithfulness-Fluency GapLink Copied

Language models are trained to produce fluent, coherent text. During pretraining, they learn patterns from vast quantities of text and optimize for next-token prediction. This objective rewards text that looks like good writing, not text that is factually grounded. A model that generates "The Eiffel Tower was built in 1889" and "The Eiffel Tower was built in 1901" produces both with essentially equivalent fluency from the model's perspective. The training loss does not directly penalize factual errors.

This creates a fundamental tension: the skills that make language models useful (fluency, coherence, breadth of knowledge) are separate from the skills needed to be reliably correct. Fluency is easier to learn at scale than factual accuracy, and the model's confidence, reflected in the way it generates text, does not track its correctness. The model has no internal alarm that fires when it transitions from retrieving a well-attested fact to generating a plausible-sounding pattern.

The problem compounds in certain conditions. When the correct answer is rare in training data, the model has less evidence to draw on and is more likely to substitute a common-but-wrong variant. When the model needs to generalize beyond what it has seen, it falls back on pattern-matching rather than factual recall. When it is asked to synthesize information across multiple sources, small inconsistencies in the training data can lead to conflation errors where facts from different entities get combined into a single, plausible-but-wrong claim. In each of these settings, the model's tendency to produce plausible-sounding text overrides whatever factual knowledge it has acquired, and the result is a hallucination that is difficult to distinguish from correct output.

To understand the scale of the problem, consider what research has found across deployment contexts. Studies of medical question-answering systems found hallucination rates as high as 30-40% on detailed clinical questions. Legal summarization tools produced factual errors in descriptions of case outcomes in over a quarter of tested documents. Coding assistants generated plausible-looking but non-functional code that referenced APIs or methods that didn't exist. In each domain, the errors were not random noise but structured, plausible fabrications that fit the expected format of correct output.

Just as we saw with bias in prior sections, where models absorb and reproduce statistical patterns from training data in ways that can cause harm, hallucination arises from the same underlying mechanism. The model learns what text looks like without always learning what is true. Bias and hallucination are, in a sense, two faces of the same problem: statistical learning without grounded understanding. A model can learn to produce text that statistically resembles factual writing without ever having a representation of truth as distinct from plausible-sounding patterns.

Why Classification MattersLink Copied

Before treating hallucination as a single monolithic problem, it is worth asking: why classify it into types at all? The answer is that different hallucination types require fundamentally different detection strategies, different mitigation approaches, and different evaluation frameworks.

Intrinsic hallucinations, which contradict a source document, can be caught by comparing output to source using natural language inference. Extrinsic hallucinations, which add ungrounded content, require external knowledge to detect. Fabrications require verification against knowledge bases or retrieval systems. Inconsistencies can be caught with self-consistency checks that require no external knowledge at all. Without a taxonomy, you cannot choose the right tool for the problem you are facing.

The taxonomy also clarifies what "fixing" hallucination means in different contexts. A summarization system might be optimized specifically to eliminate intrinsic hallucinations while accepting some extrinsic ones, if the task only requires staying within the source document. A knowledge-intensive QA system might tolerate inconsistency but must minimize fabrication. A conversational assistant might prioritize reducing cross-turn inconsistency. The right definition of success depends on the task, and the taxonomy provides the vocabulary for specifying it.

A Note on CausesLink Copied

This chapter focuses on the types of hallucination rather than their causes. The Hallucination Causes chapter will examine why hallucinations occur, covering training data issues, exposure bias, knowledge gaps, and generation pressure. Here, you will learn to recognize and classify hallucinations by their form and relationship to source material.

Intrinsic vs Extrinsic HallucinationLink Copied

The foundational distinction in hallucination research separates hallucinations based on their relationship to a provided source document. This taxonomy, widely used in summarization and question-answering research, asks a single question: does the generated content contradict the source, or does it go beyond it?

Intrinsic HallucinationLink Copied

Intrinsic hallucination occurs when generated text directly contradicts information in the provided source. The model changes, inverts, or misrepresents facts that are explicitly stated in the input.

Consider a news article that states: "The company reported revenue of $4.2 billion, a 12% increase from the prior year." An intrinsic hallucination in a summary might read: "The company reported revenue of $4.2 billion, down 12% from the prior year." The contradiction is detectable purely from the source text: the direction of change was flipped.

Intrinsic hallucinations are particularly problematic because they can be identified without external knowledge. A model that contradicts its own input has failed at the most basic task of faithfulness. They commonly appear in:

  • Summarization: Flipping numerical values, changing who did what, altering the direction of changes (increase vs decrease, positive vs negative)
  • Translation: Changing named entities or quantities in a way not supported by the source
  • Document question-answering: Answering a question with information that contradicts the passage
  • RAG-based systems: Generating claims that conflict with retrieved context

The mechanics behind intrinsic hallucinations often involve what researchers call "copy failure." The model has seen the source text, understands the general structure of the claim it needs to make, but fails to faithfully copy the specific values or directions from the source. Instead, it generates the most statistically likely value for that slot, which may differ from what the source says. A model that sees "revenue... 12%... compared to prior year" may correctly identify these as the relevant elements but incorrectly fill in the direction of change if "down" is marginally more likely in its training distribution than "up" for sentences with similar structure.

The detectability of intrinsic hallucinations makes them a natural target for automated faithfulness evaluation. If you have the source document, you can check whether the output entails or contradicts it. Natural language inference (NLI) models are well-suited for this task, and we will build on this idea in the code section.

Extrinsic HallucinationLink Copied

Extrinsic hallucination occurs when generated text introduces information that is neither present in nor inferable from the source document. Unlike intrinsic hallucination, the new information does not necessarily contradict the source. It simply goes beyond it.

Using the same example, an extrinsic hallucination might read: "The company reported revenue of $4.2 billion, a 12% increase from the prior year. CEO Jane Smith attributed the growth to expanding markets in Southeast Asia." If the source article does not mention Jane Smith or Southeast Asia, this is an extrinsic hallucination even if the facts happen to be true.

This is a subtle but important point. Extrinsic hallucinations are not always factually wrong. A model with relevant world knowledge might add accurate details. But in tasks where faithfulness to a source matters (summarization, RAG-based QA, document analysis), adding ungrounded information undermines trust in the system. The user reading the summary cannot distinguish information from the document from information the model added from elsewhere. This inability to distinguish grounded claims from ungrounded ones is the core problem: even when the extrinsic content is accurate, it poisons the reader's ability to know what the document said.

The frequency of extrinsic hallucinations often increases as source documents become longer or more complex. When a model is asked to summarize a document that does not clearly address a particular aspect of a topic, it may fill the gap with plausible-sounding claims from its parametric knowledge rather than acknowledging the gap or restricting itself to what the document says. This "completion instinct" is a natural consequence of training on next-token prediction: the model is always trying to produce a coherent, complete-seeming continuation, even when the honest answer is that the source doesn't cover the topic.

Why This Distinction MattersLink Copied

The intrinsic/extrinsic distinction has direct implications for how you detect and mitigate hallucinations.

Intrinsic hallucination detection can rely solely on the source and output. If the output contradicts the source, it is intrinsically hallucinated. This makes it amenable to automated NLI-based evaluation: decompose both source and output into sentences, run each pair through an NLI classifier, and flag any output sentences that receive high contradiction scores. The approach is fast, automated, and requires no external resources beyond the NLI model.

Extrinsic hallucination detection requires external knowledge to verify the added content. Did the model add true information from world knowledge, or did it fabricate something? This is a harder problem. You need either access to an external fact base, a retrieval system that can verify claims, or a second model capable of distinguishing "plausible claim about this entity" from "verified claim about this entity." This is precisely the direction that hallucination detection research has moved toward, and we will examine these approaches in the Hallucination Detection chapter.

For closed-book tasks (no source document provided), this taxonomy does not apply directly, since there is no source to compare against. Instead, you evaluate against ground truth knowledge, which leads to the broader category of factual errors.

Factual ErrorsLink Copied

Factual errors are hallucinations that occur in open-domain generation, where the model makes incorrect claims about the world without any source document to contradict. These do not need a reference document to identify: they are wrong with respect to established facts.

Factual errors are perhaps the most common hallucination type users encounter in everyday use of language models. When someone asks a model to explain a historical event, describe a scientific concept, or provide information about a public figure, the model draws on parametric knowledge acquired during pretraining. This knowledge is incomplete, unevenly distributed, and susceptible to the same statistical conflation mechanisms that produce other hallucination types. The result is a broad category of factual errors that spans wrong attributes, incorrect numbers, outdated information, and misrepresented relationships.

Wrong Entity FactsLink Copied

The most common factual errors involve incorrect attributes assigned to real entities: people, places, organizations, or events. Common patterns include:

  • Wrong dates: "Albert Einstein was born in 1871" (he was born in 1879)
  • Wrong places: Attributing an event to the wrong city or country
  • Wrong roles or titles: Misattributing a title or position that was held by someone else
  • Wrong relationships: "Darwin published On the Origin of Species in collaboration with Alfred Wallace" (he published it independently)

These errors are often plausible: the incorrect fact shares a structure with the correct one (a year, a place name, a title). This plausibility is what makes them dangerous. A reader without prior knowledge of the fact may have no way to identify the error. The model confidently states something that fits the template of the correct answer while substituting a wrong value, and there is no surface signal to alert the reader that the specific value is wrong.

The root cause in many cases is conflation: the model has learned many similar facts about many similar entities and blends them incorrectly. A model that has seen thousands of scientist birth years might confuse the specific year attached to a specific name, producing an error that fits the template perfectly while getting the value wrong. This is analogous to the false-memory phenomenon in human cognition, where a person confidently remembers something that did not happen because it fits a plausible narrative they have constructed. The model's "memory" is the statistical associations learned during training, and those associations do not always preserve the exact values attached to each entity.

The density of an entity's representation in training data also matters. A model trained predominantly on English-language web data will have seen far more information about certain entities than others. Well-documented historical figures with thousands of Wikipedia revisions, book entries, and news articles are less likely to produce entity errors than lesser-known figures who appear in only a handful of training documents. The model's factual reliability is, in a sense, proportional to the richness of evidence it saw during training.

Numerical ErrorsLink Copied

Numerical facts are particularly prone to hallucination. Models encounter many numbers during training but often fail to correctly encode and retrieve specific values. Common patterns include:

  • Wrong statistics: Citing a percentage, count, or rate that is off by a significant margin
  • Wrong magnitudes: Off by a factor of 10 or 100, especially with large numbers
  • Wrong directions: A decrease stated as an increase, or vice versa
  • Calculation errors: Wrong arithmetic in chain-of-thought reasoning, where intermediate steps compound errors

Numerical errors are especially problematic in high-stakes domains: medical dosages, financial figures, scientific measurements. A model that confidently cites the wrong clinical trial result or the wrong drug interaction threshold could cause real harm. A model that misstates a company's revenue by an order of magnitude could mislead financial analysis. The stakes are high precisely because numbers are precise, and a wrong number is not approximately right but definitively wrong.

Part of why numbers are particularly hard for language models comes down to representation. Unlike words, which appear in varied contexts that help disambiguate their meanings, specific numbers often appear in only a small number of contexts in training data. The number 1879 (Einstein's birth year) and 1871 (a plausible-but-wrong alternative) may both appear in training text, associated with similar surrounding language. The model learns that "Einstein was born in [year]" is a valid pattern, but without a mechanism to reliably retrieve the correct year, it may produce whichever year was most statistically associated in its training data.

Additionally, numbers are often tokenized as sequences of digit tokens, which means the model treats them as a sequence of symbols rather than as a numeric value. This makes arithmetic especially brittle: the model has no internal representation of magnitude or ordering that a programmer would take for granted. When a model performs chain-of-thought arithmetic and produces an intermediate value, subsequent steps inherit any error in that value, and the final answer may be confidently wrong even when each reasoning step looks individually plausible.

Research on numerical hallucinations has also found a systematic bias toward round numbers and common statistical values. Models are more likely to confuse 47% with 50%, or to report that a study used 100 participants when it used 94, because round numbers are more common in training text. This is not random noise but a structured distortion that reflects the statistics of the training corpus.

Outdated InformationLink Copied

Language models have a training data cutoff: they know nothing about events that occurred after their training data was collected. This creates a category of errors that are technically factual (the model is reporting what was true at training time) but misleading because they are no longer current:

  • Describing a company's current CEO when leadership has changed
  • Citing a model's performance benchmarks that have since been surpassed
  • Describing a law, regulation, or policy that has since been amended
  • Referring to a product's current price, availability, or feature set that has changed

This is sometimes called a knowledge cutoff error rather than a hallucination proper, but the practical effect is the same: the user receives false information presented as current. The distinction matters for mitigation: knowledge cutoff errors can often be addressed with retrieval augmentation (fetching current information), while hallucinations that stem from incorrect stored knowledge require different approaches.

The knowledge cutoff problem is compounded by a subtler issue: models may not accurately know their own training cutoff. A model trained on data through October of one year may have seen far less content about events in the months immediately before that cutoff than about earlier periods, simply because it takes time for events to generate substantial written commentary. This means that a model's effective knowledge degrades gradually before the nominal cutoff rather than ending sharply on a specific date.

Relationship ErrorsLink Copied

Beyond individual attribute errors, models sometimes make mistakes about the relationships between entities:

  • Reversing the direction of causality ("A because of B" vs "B because of A")
  • Confusing which entity performed an action
  • Getting the sequence of events wrong
  • Misattributing quotes or ideas to the wrong person

These errors often arise from the same conflation mechanism as wrong entity facts. The model has the right type of fact but attaches it to the wrong entity or reverses the direction.

A concrete example: "Alan Turing broke the Enigma code at Bletchley Park, a discovery that led to the development of the stored-program computer." A relationship hallucination might correctly link Turing to Bletchley Park but incorrectly claim that Enigma's decryption directly caused the stored-program computer, a conceptual leap that misrepresents the historical relationship between those developments. The individual facts are grounded; the relationship between them is not.

Relationship errors can be especially pernicious in reasoning chains. A model explaining a causal sequence might correctly identify the actors and events but describe them in the wrong order or reverse which entity caused which effect. In domains like medicine or law, where the direction of a relationship is precisely what matters, these errors can completely invert the meaning of an otherwise factually grounded statement. A claim like "drug A reduces the risk of condition B" and "condition B reduces the risk if drug A is administered" differ only in the relationship structure, yet have opposite clinical implications.

The frequency of relationship errors increases with the complexity of the knowledge graph being implicitly modeled. Simple, widely-documented relationships (A invented B, C led to D) are less prone to reversal than complex, multi-step causal chains or relationships that involve nuance about the degree of causation. When a model is asked to describe how multiple factors interact, it is drawing on a more sparsely-supported part of its parametric knowledge, and the risk of relationship errors grows accordingly.

FabricationLink Copied

Fabrication is the most dramatic form of hallucination: the model does not just get a fact wrong, it invents something that does not exist at all.

Fabrication is qualitatively different from factual errors in ways that matter for both evaluation and mitigation. A factual error involves a real entity with a wrong attribute; a fabrication invents the entity itself, or creates an entirely fictional event, citation, or statistic. The distinction is important because detecting a factual error requires knowing the correct value, while detecting a fabrication requires knowing that the thing being described does not exist. These are different computational problems, and they motivate different verification strategies.

Citation and Reference FabricationLink Copied

One of the most well-documented hallucination failure modes is citation fabrication. When asked to provide references or sources, language models frequently generate plausible-looking but entirely fictional academic citations:

  • Papers with real author names but invented titles, journals, and years
  • DOI numbers that follow the correct format but point to nothing
  • URLs that look legitimate but lead to nonexistent pages
  • Quotes attributed to real people that they never said

This is particularly insidious in academic and professional contexts. A fabricated citation has all the surface features of a real one: correct author name formatting, journal name capitalization, proper DOI structure. A busy reader might not think to verify it. A student who includes the citation in their own work passes on the fabrication. A professional who cites it in a report creates a paper trail built on nothing.

The problem is systematic, not occasional. Studies have found that language models can hallucinate citations at rates exceeding 50% when asked to provide references for specific claims. This figure is sobering: when you ask a language model to "cite three papers supporting this claim," there is a better-than-even chance that at least one of those citations does not exist. The model has learned what a citation looks like from its training data and generates convincing-looking references without any mechanism to verify that they exist.

The reason citation fabrication is so common relates to the structure of the task. Providing a citation involves producing a specific, formatted string: an author name in a particular style, a title that sounds plausible for the claimed topic, a journal that publishes in the relevant field, and a year that is plausible given the timeline of the field. The model can produce each of these components correctly without the components combining into a citation that points to a real paper. It is generating a plausible structure, not a verified reference.

Entity FabricationLink Copied

Beyond citations, models sometimes invent entire entities:

  • Fake companies: "Founded in 2015, NovaTech Analytics specializes in supply chain optimization..." (no such company exists)
  • Fake people: Attributing expertise or quotes to professionals who do not exist
  • Fake events: Describing conferences, studies, or announcements that never happened
  • Fake statistics: Citing survey results or research findings with completely fabricated numbers

These fabrications are particularly dangerous when they are embedded in otherwise accurate content. A response that is 95% correct with a single fabricated statistic is more dangerous than a response that is obviously wrong throughout, because the fabrication inherits credibility from the surrounding accurate content. A user reading a well-organized, clearly written response is unlikely to scrutinize any single claim, especially when all the surrounding claims appear to be accurate. The fabrication rides along on the credibility of the correct content.

Entity fabrication is also harder to catch than factual errors precisely because the fabricated entity does not exist. A fact-check tool that looks up "NovaTech Analytics" will find no information, which could mean the entity is obscure rather than fabricated. The absence of evidence is not, in itself, conclusive evidence of fabrication, which makes automated detection of entity fabrication a significantly harder problem than detecting wrong values for known entities.

Plausible-but-False ContentLink Copied

The common thread across fabrication types is plausibility. Models do not generate random nonsense. They generate content that:

  • Fits the statistical patterns of the surrounding text
  • Matches the expected format and register for the context
  • Uses real names, places, and concepts as anchors
  • Fills in gaps with the most likely-seeming content

This is, in a sense, what language models are optimized to do: generate the most likely continuation. When that continuation happens to be a fact the model has correctly stored, the result is accurate. When it is a pattern that gets filled with plausible-sounding but incorrect content, the result is a convincing hallucination. The model has no internal signal distinguishing these two cases.

The plausibility of fabricated content explains why hallucination is such a difficult problem to solve at the level of model training. A model trained to avoid producing implausible text will, if anything, become better at producing plausible fabrications, not worse. The goal of fluency and the goal of factual accuracy are not aligned, and training improvements that improve one can worsen the other. This fundamental tension motivates the external verification approaches we will examine in the Hallucination Detection chapter.

There is also a systematic pattern to what gets fabricated. Models are more likely to fabricate in areas where training data was sparse, where the topic requires highly specific factual knowledge, or where the model is being asked to produce structured outputs (tables, lists, citations) that require many specific values to be correct simultaneously. Understanding these patterns helps system designers anticipate where fabrication risks are highest and apply targeted mitigation strategies.

InconsistencyLink Copied

Inconsistency is a hallucination type that does not require checking against external sources: the model contradicts itself within a single response or across a conversation.

Inconsistency deserves recognition as a distinct hallucination type because it is detectable from the output alone, without any external knowledge, and it arises from a different mechanism than the other types we have discussed. While factual errors and fabrication stem from incorrect parametric knowledge or generative patterns, inconsistency reflects the model's lack of a persistent global state during generation. The model generates each token based on local context, without maintaining a structured representation of the claims it has already made. When different parts of a long response draw on the same underlying knowledge, small variations in how the context presents that knowledge can lead to contradictory outputs.

Intra-Document InconsistencyLink Copied

A model can contradict itself within a single long response. It might describe a character as a surgeon in one paragraph and "a specialist in internal medicine" in another, or state that a project was completed in 2022 early in a response and 2023 later. These inconsistencies arise partly because language models generate text left to right, without a global state tracking what they have already said. Each token is generated based on local context, which may not perfectly propagate constraints established earlier in the document.

Intra-document inconsistency is more likely in:

  • Long-form generation (essays, reports, stories)
  • Complex multi-step reasoning where intermediate conclusions constrain later ones
  • Responses that cover multiple sub-topics with overlapping facts

The length of modern context windows has helped somewhat: longer context allows the model to "see" earlier statements when generating later ones. But even with large context windows, the model's attention is not uniformly distributed, and constraints set early in a long document can be effectively forgotten by the time later sections are generated. Attention patterns in transformers tend to focus on the most recent tokens and on certain salient anchor tokens earlier in the sequence, but they do not guarantee that every constraint established at position is propagated to every token generated at position .

The problem is especially acute in structured outputs like reports or analyses, where early sections set up factual claims that later sections build on. If an early section introduces a number, name, or claim, and the model later contradicts it while building an argument, the result is internally inconsistent reasoning that may lead to wrong conclusions even if individual steps look plausible.

One useful way to think about intra-document inconsistency is as a manifestation of the model's lack of a working memory in the traditional sense. Human writers maintain a mental model of what they have said and check new claims against it. Language models have no such mechanism. The best approximation is that the context window itself is working memory, and when earlier content falls outside the attention's effective focus, it is as if the model has forgotten it.

Cross-Turn InconsistencyLink Copied

In conversational settings, models can contradict information provided by the user or stated by themselves in an earlier turn. A user who says "I live in Berlin" in turn 1 might receive a response in turn 5 that assumes they live in a different city. Or a model that claims "I cannot access real-time information" in one turn might confidently describe a recent news event in the next.

Cross-turn inconsistency is a particular challenge for long conversations, where earlier context may be compressed or lost. It is also related to the well-documented tendency of models toward sycophancy: a model might initially state one position and then reverse it when the user pushes back, even if the original position was correct. In such cases the inconsistency is not random but systematically biased toward agreeing with the user.

The sycophancy-inconsistency connection is worth examining more carefully. A model trained with human feedback may learn that responses that agree with the user receive better ratings. Over many training examples, this can produce a systematic tendency to reverse factually correct claims when challenged, not because the model has found new evidence but because agreement generates higher reward. The resulting cross-turn inconsistency is not a failure of factual knowledge but a failure of calibration: the model's stated beliefs shift with social pressure rather than evidence. This has been documented in evaluations where evaluators push back on correct model responses and observe that the model frequently capitulates, restating the user's incorrect position as if it had always believed it.

Cross-turn inconsistency can also arise from context window limitations in long conversations. When a conversation exceeds the context window, earlier turns must be summarized or discarded. Information stated in discarded turns is unavailable to the model when generating later responses, leading to inconsistencies that are not the result of sycophancy but of context loss.

Instruction-Response InconsistencyLink Copied

A subtler form of inconsistency occurs when the model does not follow through on what it claims it will do. A model might say "I will organize this into three sections: Background, Current State, and Future Outlook" and then proceed to generate content with completely different sections. Or it might promise to cite its sources and then provide none.

This is not always detectable without reading the response carefully, but it undermines user trust and task completion. It is related to the broader challenge of instruction following: models do not have a commitment mechanism that enforces consistency between a stated plan and subsequent output. If a model says "I will answer in exactly three bullet points" and then produces five, or says "I will avoid making claims I am uncertain about" and then proceeds with confident assertions, it has produced instruction-response inconsistency even if every individual claim is factually accurate.

Instruction-response inconsistency is a particular problem in multi-step or structured tasks where the model announces a plan at the start. The plan represents the model's prediction of what a good response looks like from the beginning of the response, before any content has been generated. But the actual generation process is driven by different forces, including the emerging content itself, and the announced plan may not survive contact with the actual generation dynamics. This gap between stated intentions and generated content is a frustration for users who are trying to direct model behavior through explicit plans and commitments.

Closed-Domain vs Open-Domain HallucinationsLink Copied

The hallucination taxonomy also maps onto the task domain, which shapes how you evaluate and mitigate it.

Closed-domain tasks provide a source document and ask the model to work within it: document summarization, retrieval-augmented QA, document classification with rationale. In these settings, hallucinations are primarily evaluated against the source document, using the intrinsic/extrinsic framework. The key question is: did the model stay within the bounds of what the document says?

Open-domain tasks involve general knowledge generation without a specific source: answering factual questions, writing explanations, giving recommendations. Here there is no source document to check against, so hallucinations are evaluated against world knowledge. Factual errors and fabrication are the primary concern.

This distinction has direct implications for evaluation strategy. Closed-domain hallucinations can often be caught with automated NLI-based metrics (comparing output to source). Open-domain hallucinations require either human judgment or access to external knowledge bases for automated verification.

In practice, many real-world systems occupy a middle ground. Retrieval-augmented generation (RAG) systems fetch relevant documents at query time and ask the model to answer using that retrieved context, making the task superficially closed-domain. But the model still relies on its parametric knowledge for synthesis, for interpreting what the retrieved documents mean, and for filling in gaps when the retrieved context is incomplete. This creates a hybrid evaluation challenge: you need to catch intrinsic hallucinations (the model contradicting retrieved context), extrinsic hallucinations (the model adding information not in retrieved context), and factual errors from parametric knowledge (the model reasoning incorrectly about the retrieved content). The Hallucination Mitigation chapter explores how RAG system design choices affect each of these hallucination types and what mitigation strategies work best in each case.

The Grounding SpectrumLink Copied

Rather than a binary distinction between closed-domain and open-domain tasks, it is more accurate to describe a grounding spectrum. At one end, highly constrained closed-domain tasks (extractive summarization, where the model is explicitly restricted to copying information from the source) have near-zero opportunity for most hallucination types. Moving along the spectrum, abstractive summarization introduces some freedom that allows extrinsic hallucinations. RAG-based generation adds even more freedom, since the model must synthesize across multiple retrieved documents and fill gaps. Open-domain generation sits at the far end, where any factual claim can potentially be a hallucination.

The practical implication is that you should calibrate your hallucination evaluation and mitigation strategy to where your task sits on this spectrum. A system at the extractive end needs minimal hallucination mitigation but careful NLI-based faithfulness checking. A system at the open-domain end needs reliable fact-checking pipelines, uncertainty quantification, and user-facing caveats about the limits of model knowledge.

Quantifying Hallucination TypesLink Copied

Each hallucination type requires a different evaluation approach. Researchers have developed a range of metrics and benchmarks to measure hallucination at scale.

NLI-Based FaithfulnessLink Copied

For intrinsic hallucinations, natural language inference is the dominant automated approach. NLI models are trained to classify whether one sentence (the hypothesis) is entailed by, neutral with respect to, or contradicted by another sentence (the premise). This maps naturally onto hallucination detection:

  • Premise: a sentence from the source document
  • Hypothesis: a sentence from the generated summary
  • Entailed: the summary sentence is supported by the source (faithful)
  • Contradicted: the summary sentence contradicts the source (intrinsic hallucination)
  • Neutral: the summary sentence neither follows from nor contradicts the source (possibly extrinsic)

Tools like SummaC, FactCC, and MiniCheck use this approach to score summary faithfulness. They decompose the output into atomic claims and check each claim against the source, producing a per-claim faithfulness score. SummaC in particular introduced the insight that the faithfulness score should be computed at the sentence level rather than the document level, because document-level NLI tends to be dominated by the longest or most salient claim and misses sentence-level contradictions.

The NLI-based approach has an important limitation: it can only detect contradictions between claims that share significant lexical overlap with source sentences. Abstract or paraphrased claims that are semantically contradicted but lexically distant from the source may receive neutral or even entailment scores from weaker NLI models. More capable cross-encoder models like DeBERTa-based NLI systems handle paraphrase better, but the gap is not eliminated. This is one reason why research has moved toward stronger model-based evaluators for faithfulness assessment.

Factual Verification BenchmarksLink Copied

For open-domain factual errors, researchers use benchmarks that test factual accuracy against ground truth.

TruthfulQA contains 817 questions specifically designed to elicit common misconceptions and hallucinations, covering health, law, finance, and politics. The benchmark is notable for its adversarial design: the questions target claims that are commonly believed but false, or that exploit known model weaknesses. The benchmark revealed that larger models sometimes perform worse than smaller ones on specific misconception types, because larger models are more fluent and more likely to produce convincing-sounding wrong answers.

HaluEval is a large-scale evaluation benchmark with human-annotated hallucinations across QA, dialogue, and summarization, containing over 35,000 examples. Its breadth across task types makes it useful for comparing hallucination rates across settings and for training hallucination detection models.

FActScoring takes a different approach: it decomposes biography generation into atomic facts and verifies each against a reference corpus (typically Wikipedia). This decomposition strategy is important because it allows fine-grained measurement rather than a single per-document score. A model might generate a ten-sentence biography where eight sentences are fully accurate and two contain factual errors. A document-level score conflates these, while FActScoring isolates the two problematic claims.

FEVER (Fact Extraction and VERification) provides 185,445 claims paired with Wikipedia evidence, allowing automated fact verification at scale. It is used both as a benchmark and as training data for fact-verification models.

Model-Based EvaluationLink Copied

As LLMs have become more capable, another approach has emerged: using a strong language model as an evaluator for the outputs of another. The evaluating model is given the source (or a reference fact base) and the output, and asked to identify factual inconsistencies. This approach is flexible and does not require task-specific training, but it introduces the question of whether the evaluating model is itself reliable. We will return to this tension in the Hallucination Detection chapter.

Model-based evaluation has become increasingly common under the rubric of "LLM-as-judge." The key practical advantage is coverage: a strong LLM can evaluate hallucinations across all types, including extrinsic and fabrication types that NLI-based methods cannot reliably detect. The key limitation is that the evaluator model may have the same knowledge gaps or the same tendency to hallucinate as the model being evaluated, and there is no guarantee that its judgments are accurate when both the evaluated model and the evaluator have incorrect beliefs about the same topic.

The following heatmap shows how well each detection method covers each hallucination type, giving you a quick reference for choosing evaluation strategies.

Out[4]:

Visualization

Visualizing the TaxonomyLink Copied

Let's visualize the full taxonomy of hallucination types to consolidate these concepts before diving into code.

Out[5]:

Visualization

Code: Detecting Intrinsic Hallucinations with NLILink Copied

Let's build an NLI-based intrinsic hallucination detector. We will use a cross-encoder NLI model to score whether each sentence in a generated summary is entailed by or contradicted by the source document.

The approach works as follows: for each sentence in the output, we retrieve the source sentence with the highest lexical overlap and run the NLI classifier on that pair. A sentence with a high contradiction score is flagged as a likely intrinsic hallucination.

Candidate retrieval is important because NLI classifiers assess a pair of sentences, not a whole document. Unrelated source sentences can receive unstable contradiction scores, so taking the maximum contradiction over every possible pair can create false positives. Retrieving the closest source sentence first gives the classifier a relevant premise and mirrors the retrieve-then-verify design used in practical faithfulness systems.

First, install the required package:

In[6]:

Code

In[7]:

Code

Now define example source documents and generated summaries covering each hallucination type:

In[8]:

Code

In[9]:

Code

Load the NLI model. On first run this downloads the weights; subsequent runs use the local cache:

In[10]:

Code

Run the hallucination scorer on each summary type:

In[11]:

Code

Out[12]:

Console

The faithful summary scores high on entailment across all sentences. The intrinsic hallucination (wrong year: 2020 vs 2021) shows up as a direct contradiction. The extrinsic summary scores as uncertain or neutral: the London detail is neither contradicted nor entailed by the source. The fabrication also registers as neutral, since the source says nothing about awards.

This illustrates a key insight: NLI-based scoring is well-suited for catching intrinsic hallucinations (direct contradictions) but limited for extrinsic ones, which score as "neutral" rather than "contradicted." Detecting extrinsic hallucinations and fabrications requires external knowledge sources, which is the focus of the Hallucination Detection chapter.

Notice that the fabricated Turing Award claim also scores as uncertain or low on both dimensions. The NLI model cannot detect the fabrication because it has no world knowledge of whether Dario Amodei won the Turing Award or not. It can only assess whether the claim is supported or contradicted by the source document, and since the source says nothing about awards, the claim is neither. This limitation is fundamental to the NLI approach, not an artifact of model quality.

Now let's visualize the scoring results:

Out[13]:

Visualization

Out[14]:

Visualization

The per-sentence breakdown localizes the error to the specific hallucinated sentence. This is how production faithfulness checkers like SummaC work: by decomposing outputs into atomic claims and scoring each one individually, rather than assigning a single quality score to the whole response.

Key ParametersLink Copied

The key parameters for the NLI-based hallucination scorer are:

  • model: The cross-encoder checkpoint used for NLI classification. cross-encoder/nli-deberta-v3-small balances speed and accuracy; larger variants like cross-encoder/nli-deberta-v3-large improve precision at higher compute cost.
  • device: Set to -1 for CPU or 0 for the first available GPU. Batch scoring on GPU is significantly faster when evaluating many documents.
  • max_length: Truncation limit for premise-hypothesis pairs (512 tokens). Pairs exceeding this are truncated, which can affect accuracy on long source sentences.
  • top_k=None: Returns scores for all NLI labels (entailment, neutral, contradiction). Without this, the pipeline returns only the top-scoring label, which is insufficient for hallucination scoring.
  • contradiction threshold (0.5): The score at which a sentence is flagged as hallucinated. Lower thresholds increase recall at the cost of precision. The right value depends on your application's tolerance for false positives.

Self-Consistency as an Inconsistency DetectorLink Copied

Beyond NLI-based faithfulness checking, self-consistency offers a complementary approach that does not require a source document and is particularly suited to detecting inconsistency-type hallucinations. The basic idea is simple: if a model's answer to a question is consistent regardless of how the question is phrased or what sampling temperature is used, it probably knows the answer. If the answers vary, the model is uncertain, and inconsistent answers signal a likely hallucination.

Formally, the self-consistency approach generates multiple responses to the same prompt and measures agreement across responses. For factual questions with discrete answers, this means checking whether the most common answer agrees with the full distribution of answers. For more open-ended generation, it means checking whether key factual claims in one response are also present in other responses.

The self-consistency signal is interpretable: a claim that appears in 9 out of 10 independently generated responses is likely grounded in the model's parametric knowledge. A claim that appears in only 2 out of 10 responses is uncertain, and a response that contains it should be treated with skepticism. This does not guarantee correctness (the model could consistently hallucinate the same wrong answer), but it provides a probabilistic reliability signal that has proven useful in practice.

Hallucination BenchmarksLink Copied

Researchers have developed standardized benchmarks to evaluate hallucination across settings:

Hallucination evaluation benchmarks organized by domain and hallucination type.
BenchmarkDomainHallucination TypeSize
TruthfulQAOpen-domain QAFactual errors, misconceptions817 questions
HaluEvalQA, Dialogue, SummarizationAll types35,000 examples
FEVERFact verificationFactual errors185,445 claims
SummaCSummarizationIntrinsic4,000+ examples
FactCCSummarizationIntrinsic503 examples
FActScoringBiography generationAtomic factual errorsVariable

TruthfulQA is particularly notable because its questions are specifically designed to target common misconceptions, the kinds of things language models are likely to have absorbed from their training data. Questions probe the model's ability to resist generating plausible-but-false completions in domains where misconceptions are common. The benchmark revealed that larger models are sometimes more likely to produce convincing hallucinations, not less, because they are better at generating fluent text that sounds authoritative. This counterintuitive result reflects a real tension: a more capable model generates more convincing text, and a more convincing hallucination is more dangerous than an obviously wrong one.

HaluEval covers multiple task types and includes both automatic and human evaluation. It shows that hallucination rates vary significantly by task: summarization and open-ended QA show higher hallucination rates than more constrained extraction tasks. The variation across tasks is an important practical finding: deploying a model on tasks where hallucination rates are known to be high should trigger additional safeguards.

FEVER is notable for its scale and systematic annotation methodology. Because claims are paired with Wikipedia evidence, automated fact verification can be applied at scale, making it useful both as a benchmark and as training data for verification models. The dataset has proven foundational for research on fact-checking systems that operate at production scale.

Limitations and ImpactLink Copied

Understanding hallucination types is essential, but the taxonomy itself has limitations worth keeping in mind.

The intrinsic/extrinsic distinction assumes you have a source document to compare against. For open-domain generation, this boundary dissolves: any generated content is potentially extrinsic since there is no source. In practice, researchers apply different evaluation frameworks depending on whether the task is grounded or open, which means a single unified hallucination score across tasks is difficult to define. Comparing hallucination rates across papers can be misleading when different papers use different evaluation frameworks or focus on different hallucination types.

The categories are also not mutually exclusive. A single sentence can simultaneously be extrinsic (adds information not in the source) and factually wrong (the added information is incorrect). A model can exhibit intra-document inconsistency while also making specific factual errors. The taxonomy is a tool for analysis and communication, not a strict partition of distinct failure modes. When building evaluation pipelines, you should think of the categories as lenses that highlight different aspects of reliability, not as exhaustive buckets that partition all possible errors.

Measuring hallucination reliably is still an open research problem. NLI-based metrics catch intrinsic hallucinations reasonably well but miss extrinsic ones. Factual verification requires access to reliable knowledge bases, which are incomplete and may themselves contain errors. Human evaluation remains the gold standard but is expensive and does not scale to production monitoring. The field has not yet converged on a single evaluation methodology that works across all hallucination types and all task domains.

The practical impact of hallucination varies dramatically by deployment context. In a creative writing assistant, occasional extrinsic hallucinations may be desirable: the model adds imaginative detail that was not in any source. In a medical information system or legal document analyzer, any factual error could be dangerous. The same model behavior that is a feature in one context is a critical bug in another. This context-dependence is one reason why hallucination research has moved toward task-specific evaluation rather than searching for a single universal metric.

The economic and trust implications are significant. Research has shown that users tend to trust AI-generated text more than they should, calibrating their confidence to the model's tone rather than its actual accuracy. A hallucinated medical fact delivered with the same fluency as a correct one is particularly dangerous precisely because users often cannot tell them apart. Building systems that communicate uncertainty accurately, and that acknowledge the limits of their knowledge, is an active area of research. We will explore these approaches in the Uncertainty Quantification chapter, which covers confidence calibration, verbalized uncertainty, and sampling-based uncertainty estimation.

Hallucination also has implications for the bias research covered in earlier sections. Measurement bias and hallucination interact: a model that hallucinates demographic facts can produce biased outputs even when it does not have an underlying bias in its representations. Separating "the model generated a false claim" from "the model generated a biased claim" is often necessary for a complete fairness analysis. A model that invents statistics about a demographic group is both hallucinating and potentially causing harm through that hallucination, and both dimensions require attention in system evaluation.

One final dimension is the relationship between hallucination and the retrieval-augmented generation (RAG) paradigm. Many practitioners treat RAG as a solution to hallucination, and it does substantially reduce factual errors by providing the model with current, relevant information. But RAG does not eliminate hallucination: it shifts the primary failure mode from parametric hallucination (the model invents from memory) to grounding failure (the model misinterprets or contradicts the retrieved context). A model that hallucinates in a RAG system is likely committing intrinsic hallucinations (contradicting retrieved documents) or extrinsic hallucinations (adding detail not in retrieved documents). Understanding the taxonomy helps designers instrument RAG systems with the right evaluation and monitoring strategies.

SummaryLink Copied

Hallucination in language models describes generated content that is unfaithful to a source, factually incorrect, or entirely fabricated. The key type distinctions are:

  • Intrinsic hallucination: directly contradicts the provided source document, detectable by comparing output to input using NLI
  • Extrinsic hallucination: adds information not in the source, not necessarily factually wrong but ungrounded and unverifiable
  • Factual errors: wrong claims about world knowledge (wrong entity facts, numerical errors, outdated information, relationship errors)
  • Fabrication: inventing entities, citations, statistics, or events that do not exist
  • Inconsistency: self-contradictions within a response (intra-document) or across conversation turns (cross-turn)

The intrinsic/extrinsic distinction is most useful in closed-domain tasks like summarization and RAG-based QA, where NLI-based evaluation can automatically detect contradictions between output and source. For open-domain generation, factual verification against external knowledge bases is required. Inconsistency is unique in that it requires no external reference: the output contradicts itself, and this is detectable from the output alone.

NLI-based scoring works well for intrinsic hallucinations but scores extrinsic ones as "neutral," motivating hybrid evaluation approaches that combine NLI with external knowledge lookup. Self-consistency checking complements NLI by detecting uncertainty and potential inconsistency without any external knowledge. The next chapter, Hallucination Detection, covers these methods in depth, including entailment models, self-consistency checking, and knowledge base verification.

The taxonomy is not just academic: it dictates which evaluation tools apply, which mitigation strategies are appropriate, and what a deployable reliability guarantee looks like for a given task. Understanding hallucination types is the prerequisite for building systems that fail gracefully and communicate their limitations clearly.

QuizLink Copied

Ready to test your understanding? Take this quick quiz to reinforce what you've learned about hallucination types in language models.

Read the original on mbrenndoerfer.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.