When AI Confidently Makes Things Up
Hallucination occurs when an LLM generates facts that sound plausible but are not in the retrieved context — or are simply wrong. LLMs are probabilistic: when they do not have the right answer, they still produce the most statistically likely next words. The result is confident, fluent, wrong information.
Why Hallucination Happens in RAG
Strict Prompt Grounding
The most effective and simplest technique — tell the LLM explicitly to answer only from the provided context. This one instruction dramatically reduces hallucination in most RAG systems.
Is Supported Verification Check
After generation, verify the answer against the retrieved context. An LLM evaluator reads both the answer and the source documents and assigns a support level — fully supported, partially supported, or not supported.
Better Retrieval = Less Hallucination
If retrieval is poor, no prompt instruction will save the answer. Better retrieval means the LLM always has accurate, relevant context to draw from — leaving no gaps it needs to fill with guesses.
Stopping hallucination requires a multi-layer approach. Layer 1 — strict prompt grounding forces the LLM to use only provided context. Layer 2 — the Is Supported check verifies every claim post-generation. Layer 3 — better retrieval ensures relevant context exists. Three layers together produce a production RAG system where hallucination is the exception, not the rule.