learn·7 min read

AI Hallucinations: Why LLMs Make Things Up

By Keimodel Team·

LLMs sometimes generate plausible-sounding but completely false information. Here's why it happens and how to reduce it.

Key Takeaways

TakeawayDetails
AI Hallucination DefinitionLLMs generate factually incorrect information while presenting it with confident fluency as accurate.
Root CauseModels predict statistically likely continuations without explicit truth-checking mechanisms.
Hallucination TypesInclude factual errors, intrinsic contradictions, extrinsic additions, and flawed reasoning chains.
RAG MitigationRetrieval-Augmented Generation grounds answers in real source material that can be cited and verified.
Prompt StrategiesAsk models to cite sources, acknowledge uncertainty, or use step-by-step reasoning before answering.
Verification NecessityCritical applications require outputs to be verified against authoritative sources before acting.

What Is an AI Hallucination?

In the context of large language models, a hallucination is when a model generates text that is factually incorrect, fabricated, or unsupported by reality, while presenting it with the same confident fluency as accurate information. The model might cite a paper that doesn't exist, invent a statistic, or describe historical events that never happened.

The term 'hallucination' is borrowed from psychology, where it describes perception without a real external stimulus. For LLMs, it's a fitting metaphor: the model 'perceives' (generates) something that isn't there. Unlike human mistakes, LLM hallucinations often appear perfectly grammatical and stylistically convincing, making them especially dangerous.

Why Do LLMs Hallucinate?

Hallucinations arise from the fundamental nature of how LLMs are trained. Models learn to predict the next token given preceding context, optimizing for fluency and coherence. They don't have an explicit truth-checking mechanism, they generate the most statistically likely continuation, which is often correct but not always. When asked about topics underrepresented in training data, the model fills gaps with plausible-sounding completions.

Other contributing factors include prompt ambiguity (the model guesses at intent), knowledge cutoffs (outdated information presented as current), and confidence calibration failures (the model doesn't know what it doesn't know). RLHF training can exacerbate hallucinations if human raters reward confident-sounding answers over hedged but accurate ones.

Types of Hallucination

Hallucinations come in several varieties. Factual hallucinations are outright false claims (wrong dates, invented people, nonexistent citations). Intrinsic hallucinations contradict information in the provided context. Extrinsic hallucinations add information not supported by any provided source. Reasoning hallucinations involve flawed logical chains that reach incorrect conclusions even when premises are correct.

Some hallucinations are harmless, a slightly wrong date in a casual summary. Others are dangerous: wrong drug dosage, false legal precedents, or fabricated technical specifications. Risk severity depends on the use case, which is why high-stakes applications require verification layers.

How to Reduce Hallucinations

Retrieval-Augmented Generation (RAG) is the most effective mitigation for factual hallucinations: instead of relying on memorized knowledge, the model retrieves relevant documents at query time and grounds its answer in them. The model still generates text, but it's constrained by real source material that can be cited and verified.

Prompt-level strategies also help: ask the model to cite sources, acknowledge uncertainty, or say 'I don't know' when unsure. Instructing models to reason step-by-step (chain-of-thought) before answering reduces reasoning hallucinations. For critical applications, outputs should always be verified against authoritative sources before acting on them.

hallucinationreliabilitygroundingRAG