Fundamentals

AI Hallucination

When an AI model generates information that sounds plausible but is factually incorrect, fabricated, or nonsensical.

What is AI hallucination?

AI hallucination occurs when a language model generates content that is factually incorrect, fabricated, or inconsistent—but presents it confidently as if it were true.

Examples of hallucination:

  • Citing a research paper that doesn't exist
  • Attributing quotes to people who never said them
  • Inventing statistics or dates
  • Describing products with features they don't have
  • Creating plausible but fictional historical events

The term "hallucination" captures how the AI isn't lying intentionally—it's generating what statistically seems like it should be true, much like how a human hallucination feels real to the person experiencing it.

Why do AI models hallucinate?

LLMs are pattern matchers, not knowledge bases

Language models learn to predict plausible-sounding text based on patterns in training data. They don't "know" facts—they've learned what kinds of text tend to follow other text.

Key causes:

Training data issues:

  • Incorrect information in training data
  • Gaps in knowledge coverage
  • Conflicting information from different sources

Statistical nature:

  • Models optimize for "likely" text, not "true" text
  • Rare or specific facts are harder to learn than common patterns

Prompt factors:

  • Vague questions invite fabrication
  • Leading questions encourage agreement
  • Requests for very specific information (dates, numbers, citations)

Model confidence:

  • Models don't signal uncertainty well
  • Trained to be helpful, they may answer rather than decline
  • No mechanism to distinguish known from unknown

Types of AI hallucinations

Factual hallucinations Stating incorrect facts: "The Eiffel Tower was built in 1920" (actually 1889).

Citation hallucinations Inventing fake references: "According to Smith et al. (2023)..." when no such paper exists.

Statistical hallucinations Making up numbers: "Studies show 73% of users prefer..." without any actual study.

Logical hallucinations Drawing incorrect conclusions from correct premises, or creating circular reasoning.

Temporal hallucinations Confusing timelines or claiming events happened in wrong order.

Entity hallucinations Attributing statements or actions to the wrong person or organization.

Capability hallucinations Claiming abilities the AI doesn't have, like accessing real-time data or remembering past conversations.

Self-hallucinations Making false claims about itself, its training, or its knowledge.

How to reduce hallucinations

Use RAG (Retrieval-Augmented Generation) Ground responses in actual documents. When the AI can cite real sources, it hallucinates less.

Improve prompts:

  • Be specific about what you need
  • Ask the model to say "I don't know" when uncertain
  • Request sources and verify them
  • Use system prompts that emphasize accuracy

Lower temperature: Lower temperature settings (0.0-0.3) produce more deterministic, less creative outputs—reducing hallucination but also reducing variety.

Verify critical information: Never trust AI outputs for critical facts without verification. Treat AI as a first draft, not final source.

Use grounded generation: Explicitly provide the information you want discussed, then ask the model to work only with that information.

Ask for reasoning: Request step-by-step explanations. This can expose flawed logic and make hallucinations more obvious.

Multiple generations: Generate multiple responses and look for consistency. Hallucinations often vary between runs; facts stay stable.

Detecting hallucinations

Red flags to watch for:

  • Very specific numbers, dates, or statistics (often fabricated)
  • Academic citations (frequently invented)
  • Confident claims about recent events (knowledge cutoff issues)
  • Highly specific quotes (often misremembered or fabricated)
  • Information that seems too convenient for the question

Detection strategies:

Source verification: Search for any cited sources. Many hallucinated papers and quotes don't exist.

Cross-reference: Ask the same question multiple ways. Inconsistent answers suggest hallucination.

Ask for uncertainty: "How confident are you in this answer?" Sometimes models will hedge.

Fact-check key claims: Verify important facts with authoritative sources.

Automated detection: Tools like Vectara's HHEM, Patronus AI, and others can automatically detect likely hallucinations.

Business impact of hallucinations

Risks:

Misinformation: Customer-facing AI providing wrong information damages trust and can have legal implications.

Professional liability: In fields like law, medicine, or finance, hallucinated advice could lead to serious harm.

Reputation damage: Viral examples of AI mistakes embarrass companies and erode confidence.

Wasted time: Developers debugging non-existent code, researchers chasing fake citations, teams acting on false data.

Mitigation strategies:

Human review: For high-stakes outputs, require human verification before use.

Confidence thresholds: Only use AI outputs when the system indicates high confidence.

Domain restriction: Limit AI to domains where you can provide verified source documents.

Clear disclaimers: Be transparent that AI can make mistakes. Set appropriate user expectations.

Feedback loops: Enable users to report errors. Use this feedback to improve systems.