API glossary

Hallucination

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

A hallucination is output from an AI model (especially a large language model) that is false, fabricated, or ungrounded, yet presented fluently and confidently as if it were true. (“Ungrounded” in this case meaning the output is unsupported by the model’s training data or the sources it was given.) Hallucinations range from invented citations and fake statistics to plausible-sounding details that no source actually supports, and can also arise when a model misreads, misattributes, or overgeneralizes from stale or partial sources.

In short: a hallucination is confident, fluent output that is not reliably true—an answer in which the model has filled a gap with something plausible instead of something correct.

How hallucinations happen

A language model predicts likely text, not verified facts, and several factors push it toward confident invention:

  1. Prediction, not retrieval: The model generates statistically likely words, so fluency is optimized while factual accuracy is not guaranteed.
  2. Gaps in knowledge: When training data is missing, outdated, or thin on a topic, the model fills the gap with a plausible guess.
  3. No built-in ground truth: Without a source to check against at the time a response is generated, the model cannot tell a supported claim from an invented one.
  4. Leading or ambiguous prompts: Vague questions or false premises can nudge the model into answering rather than pushing back.
  5. Bias toward answering: Models tend to produce a confident response instead of admitting uncertainty, so gaps in knowledge can appear in the form of fabrications.

The defining point is that the model is not lying: it has no internal distinction between a well-supported statement and a plausible-sounding invention.

Hallucination vs. factual errors and misinformation

  • A factual error can come from any cause, including correct reasoning over bad data; a hallucination specifically means the model produced something ungrounded or unsupported—often inventing it outright, but also misreading or misattributing sources.
  • Misinformation is false or inaccurate information, regardless of intent; while misinformation or disinformation imply an intent to mislead, a hallucination is unintentional, since the model has no awareness that its output is false.
  • Intrinsic hallucinations contradict a source the model was given; extrinsic hallucinations cannot be verified from that source, even when they happen to be true.

How hallucinations are reduced

  • Retrieval-augmented generation (RAG): Grounding answers in retrieved, citable text gives the model real sources to work from instead of guessing (but RAG can still produce errors if retrieval misses relevant sources or the model misuses what it finds).
  • Citations and verification: Asking the model to cite sources, then checking them, surfaces claims that nothing supports.
  • Permission to abstain: Letting the model say “I don’t know” reduces forced guesses, a technique Anthropic recommends for more reliable output.
  • Human review in high-stakes domains: In medicine, law, and finance, where a confident fabrication is most costly, human checking remains essential.
  • Reinforcement learning from human feedback (RLHF): Further training based on curated examples can help teach the model to follow instructions, decline harmful requests, and produce more reliable responses.
  • Fine-tuning: Further training a pretrained model on curated examples can improve reliability within a domain and encourage it to abstain when unsure. Fine-tuning is complementary to grounding rather than a replacement, and can sometimes backfire if used to teach unfamiliar facts.

Hallucinations can be reduced but not fully eliminated; the practical goal is to ground outputs in verifiable sources and build systems that surface uncertainty rather than hide it.

Retrieval-augmented generation (RAG), web grounding, source attribution, citation, large language model (LLM), prompt engineering, AI answer engine, factual accuracy, confabulation.