Try Bifrost Enterprise free for 14 days.
Request access
[ Hallucination ]

What is hallucination?

Quick answer

A hallucination is model output that sounds confident and plausible but is false or unsupported. It contradicts the source text the model was given, goes beyond it, or repeats an error learned in training, as when a model cites a paper that does not exist.

Updated 2026-09-08

Hallucination is model output that reads as authoritative but is false or unsupported: it contradicts the documents you supplied, goes beyond them, or repeats an error the model absorbed in training. The defining property is the mismatch between confidence and support. A hallucinated citation has a plausible author, a plausible journal, a plausible year, and does not exist.

"The production of confidently stated but erroneous or false content (known colloquially as 'hallucinations' or 'fabrications') by which users may be misled or deceived."

Source: NIST AI 600-1, definition of "confabulation", its term for hallucination

Hallucination comes from how language models are trained. A language model is trained to predict the next token, and NIST AI 600-1 calls confabulation "a natural result of the way generative models are designed." Fluency follows from that objective; truth is only a correlate of fluency in the training corpus, and correlates break down at the edges of what the corpus covered.

So for a general-purpose model that always answers, hallucination can be reduced and detected but not eliminated. Kalai et al. argue that hallucinations are inevitable only for base models, and that the remaining lever is rewarding the model for abstaining instead of guessing. Treating model output as authoritative assumes a reliability the training objective never targeted.

Causes

There is no database inside the model, and what is stored is compressed lossily. Weights encode statistical regularities, not retrievable records, so producing a date is token prediction rather than a lookup even when it returns the right answer. Billions of documents are squeezed into a fixed parameter budget, and what survives depends on repetition: Kandpal et al. found that a model's accuracy on a factual question tracks how many relevant documents it saw in pretraining. For rare facts, what remains is often the shape of the fact without its specifics.

Training exposes the model to a distribution of text, errors included. The corpus contains contradictions, outdated claims, fiction, and errors. The model learns the distribution over all of it, including the confident register false claims are written in.

Post-training and benchmarks can reward confidence. The GPT-4 Technical Report found that the pre-trained model was highly calibrated and that RLHF post-training reduced calibration. Kalai et al. find in Why Language Models Hallucinate that "the vast majority of popular evaluations have binary grading," scoring a wrong answer and "I do not know" the same, zero, so guessing beats abstaining.

The model's sense of its own knowledge is weak and poorly voiced. Its internal states carry some signal about whether a statement is true (Azaria and Mitchell), but when it states its confidence in words it tends to be overconfident (Xiong et al.), which is why asking it whether it is sure is a weak check.

Types of hallucination

Ji et al.'s Survey of Hallucination in Natural Language Generation splits hallucination into two types, and each is detected differently.

TypeDefinitionDetectable by
IntrinsicOutput contradicts the source text provided in contextComparing output against the source; automatable, though checkers make errors
ExtrinsicOutput cannot be verified against the source, though it may be trueRequires external knowledge or a retrieval step

Intrinsic hallucination is the tractable case: everything needed to catch it is already in the request. Extrinsic hallucination is harder to catch.

Classified instead by what is fabricated:

VariantExample failureExample trigger
FactualA wrong date, statistic, or attributeRare entities, precise numbers
CitationA paper, URL, or API method that does not existRequests demanding references
Instruction-followingClaims to have applied a constraint it ignoredLong or conflicting instructions
ReasoningValid-looking chain with an invalid stepMulti-step arithmetic or logic

Where it concentrates

Hallucination clusters in a few areas, and those are where checks belong.

  • Rare entities. A niche company, a minor author, a small town. Compression kept the pattern and lost the details. FActScore makes this measurable by decomposing generated biographies into atomic facts, and its authors found that scores drop sharply as entities get rarer (for ChatGPT, from about 80% to 16%).
  • Precise numbers and identifiers. Prices, dates, DOIs, case numbers, function signatures. Highly structured strings are easy to fabricate convincingly.
  • Recent events. Anything past the training cutoff can produce confident interpolation instead of a refusal.
  • Long contexts. Detail buried mid-document is more likely to be misstated than detail at either end (Liu et al., Lost in the Middle, TACL 2024).
Diagram
[ RENDERING DIAGRAM ]

Mitigation techniques, ranked

These techniques differ widely in effect. Effectiveness ratings are our assessment.

TechniqueEffectivenessCostNotes
Ground with retrievalHighestInfrastructure, latencyConverts extrinsic risk into checkable intrinsic risk
Require and verify citationsHighOne verification passVerification must be programmatic, not requested in the prompt
Constrain the output spaceHigh, where applicableSchema designRemoves the freedom to fabricate a value
Allow the model to abstainModerateOne prompt lineReal but modest, and easy to test
Lower the temperatureSmallNoneRemoves some sampling noise; does not fill knowledge gaps
Fine-tune for accuracyUsually the wrong toolHighTeaches behavior and style, not facts

Grounding is the single biggest lever. Retrieval-augmented generation, introduced by Lewis et al., puts the source text in the context so the model summarizes rather than recalls. It does not eliminate hallucination, since the model can still contradict or over-extend the passage, but it converts an unbounded problem into a bounded one: you hold the source, so faithfulness is mechanically checkable.

Citations only help if you check them. Displaying references without validating them makes fabricated sources look more credible. Resolve every identifier and confirm the quoted span appears in the retrieved chunk.

Constraining the output space removes the failure mode entirely. If the answer must be one of a known set of SKUs, emit an enum. If it must come from a lookup, use function calling and let the tool return the value. Often the best fix is to stop asking the model for the fact.

The bottom three rows are weaker levers. Telling the model it may say it does not know is worth one line of prompt engineering, but test whether it changes behavior on your own evaluation set. Lowering temperature trims sampling-induced errors but cannot supply missing knowledge. And fine-tuning shapes format and task behavior efficiently while making a poor fact store, and it can backfire: Gekhman et al. found that fine-tuning examples with new knowledge are learned slowly and, once learned, linearly increase the model's tendency to hallucinate.

Detection

Since a model that always answers will sometimes hallucinate, measure it with the methods below.

Self-consistency sampling. Generate the answer several times at nonzero temperature and compare. Grounded facts stay stable across samples; fabricated ones vary, because nothing anchors them. Errors the model makes consistently will still pass. SelfCheckGPT formalizes this as a black-box method requiring no logits and no external knowledge base.

Semantic entropy. A refinement aimed at confabulations, meaning arbitrary errors that change from sample to sample. Naive sampling penalizes paraphrases, since "Paris" and "It is Paris" are different strings with the same meaning. Farquhar et al., in Detecting hallucinations in large language models using semantic entropy in Nature, cluster samples by semantic equivalence first and compute entropy over the clusters, so high entropy means uncertainty about meaning rather than wording.

Faithfulness checking against source. Where a source exists, run a natural language inference model or an LLM judge over each claim with the source in context and ask whether the source entails it. Unlike the generating model asked whether it was sure, the judge sees evidence, so it verifies instead of introspecting.

py

Both signals belong in production as guardrails, where a groundedness check can suppress or regenerate an unsupported response, and in offline evaluation, where the same check scores a frozen golden set. Bifrost runs guardrails that validate inputs and outputs in real time, including hallucination detection through the Patronus AI provider, and exports traces to OpenTelemetry backends, so failures surface as a rate rather than one support ticket at a time.

Design for recoverability

You will not reach zero, so the design question changes from "how do we stop wrong answers" to "what happens when one gets through."

  • Show sources next to claims, so a user can verify instead of trusting.
  • Prefer abstention to a guess on consequential paths, and route the abstention to search or to a human.
  • Put a human in the loop where the cost of wrong is high. Medical, legal, and financial output should be reviewed, not shipped.
  • Make errors reversible. Have the system draft instead of send, and propose instead of execute.
  • Track a groundedness rate as a product metric. OWASP catalogs the downstream risk as LLM09 Misinformation and notes that overreliance, users trusting output without verifying it, "exacerbates the impact of misinformation."

Key takeaways

  • In our ranking, grounding with retrieval comes first, then verified citations and constrained outputs. Lowering temperature helps only with sampling noise, and fine-tuning teaches behavior, not facts.
  • You cannot reach zero, so design so a wrong answer is visible, reversible, and reviewed where the stakes justify it.

Sources and further reading