Hallucinations & How to Reduce Them
- Understand WHY models fabricate confident, well-formed answers
- Recognize the 5 high-risk zones where you should be most skeptical
- Apply a 6-part toolkit to drastically reduce hallucinations
- Use one copy-paste anti-hallucination prompt that grounds, gives an out, and forces citations
- Adopt the mindset that matches verification effort to the cost of being wrong
A hallucination is when a model states something false with complete confidence. It's not lying and not broken — it's the flip side of how LLMs work: they generate plausible text, and plausible isn't always true (see What Is an LLM?). You can't prompt this away entirely, but you can drastically reduce it and catch the rest.
Why it happens
The model predicts a likely continuation. When it doesn't "know" something, the most likely-looking continuation is often a confident, well-formed — and wrong — answer. There's no built-in "I'm unsure" signal unless you create room for one.
- The fix for most hallucinations is to deliberately create room for uncertainty — give the model permission to say it doesn't know.
The high-risk zones
Be most skeptical when output involves:
- Citations, quotes, and references — fabricated papers, fake URLs, misattributed quotes.
- Specific numbers, dates, and stats — plausible but invented figures.
- Niche or very recent facts — beyond what the model reliably learned.
- APIs and library details — methods or parameters that don't exist.
- People and legal/medical specifics — high stakes, easy to get subtly wrong.
The reduction toolkit
Stack these — each one helps:
- Paste the source text and say "answer only from the text above; if it's not there, say so." This is the core idea behind RAG (/docs/foundations/rag).
- Explicitly allow "If you're not sure, say 'I don't know'" — it dramatically reduces confident guessing.
- "Quote the exact sentence that supports each claim." Unsupported claims become obvious.
- For factual tasks where the model exposes a temperature control, turn it down (see Sampling Controls at /docs/foundations/sampling-controls).
- For math, current data, or lookups, give the model a calculator/search/tool (/docs/api/tool-use) instead of trusting recall.
- Ask the same question two ways, or have a second pass critique the first.
A copy-paste anti-hallucination prompt
Most of the toolkit above collapses into one reusable wrapper. Paste your source where shown and ask your question — it grounds the answer, gives the model an out, and forces citations in a single shot:
Anti-hallucination wrapper
You answer ONLY from the SOURCE below. Rules: - If the answer is not in the SOURCE, reply exactly: "Not stated in the source." - After every claim, quote the exact sentence from the SOURCE that supports it. - Do not add outside knowledge, estimates, or assumptions. SOURCE: """ [paste the document, transcript, or data here] """ QUESTION: [your question]
Why it works: the "Not stated in the source" escape hatch removes the pressure to guess, and the quote-the-sentence rule makes any unsupported claim impossible to hide. Drop the SOURCE block when you genuinely want the model's own knowledge — but then verification is back on you.
The mindset that actually protects you
- No prompt makes output 100% reliable. For anything consequential — a number in a report, a citation, a command you'll run, a medical/legal/financial detail — check it against a trusted source. Treat AI as a fast first draft, not a final authority. This is the heart of Responsible Use (/docs/security/responsible-use).
A simple rule: the cost of being wrong sets the amount of verification. Brainstorming? Trust freely. Publishing a statistic? Verify every time.
- Hallucinations are a byproduct of plausibility-based generation, not a bug you can fully prompt away.
- Be most skeptical with citations, numbers/dates, niche or recent facts, API details, and people/legal/medical specifics.
- Stack the toolkit: ground in sources, give an out, demand citations, lower temperature, use tools, cross-check.
- One wrapper prompt grounds + gives an out + forces citations in a single shot.
- Match verification effort to the cost of being wrong — trust freely when cheap, verify every claim when consequential.