An "AI hallucination" is when a language model confidently produces something that is false. Not stylistically wrong, not subtly off — actually false, and presented as fact. It's the failure mode that makes lawyers cite cases that don't exist, makes students submit essays with fabricated quotes, and makes journalists publish numbers nobody can verify.
This guide explains why it happens at the level you actually need (no PhD required), and gives you five habits that materially reduce how often you get burned.
What's actually happening
Language models are next-token predictors. Given a sequence of words, they produce the most likely next word, then the next, and so on. They have no separate "truth" representation. There is no internal model of the world that the output is being checked against. The model produces fluent, statistically-likely text. Sometimes that text happens to be true; sometimes it doesn't.
This means hallucination is not a bug; it is a feature of how the system works. The system was never designed to be a truth-machine. It was designed to be a fluent-text machine. We are using it for tasks (factual Q&A, citations, code that references real APIs) that require truth, and the impedance mismatch produces hallucination.
This also means hallucination cannot be fully "fixed" by making the model bigger or better-trained. It can be reduced, mitigated, gated, and detected — but the underlying mechanic stays.
Where hallucinations come from, specifically
- Long-tail facts: the model saw the topic once or twice in training, doesn't really know it, but can produce a plausible-sounding answer. Most factual hallucinations.
- Recent events: training cutoffs. The model produces what was true at training time, presented as current.
- Citations: the model has seen many citation strings (Author, Year, Journal, Title) but the specific combination it produces may not correspond to a real paper. Citations are uniquely vulnerable because the format is so consistent.
- Code referencing real APIs: the model has seen many API calls and can produce one that looks right but uses methods that don't exist.
- Confident over-extrapolation: the user asks a question with a single right answer the model doesn't know; the model averages over plausible candidates and produces one with confidence.
What does NOT reliably reduce hallucination
- "Don't make things up" in the prompt — the model wasn't lying on purpose; you can't ask it to stop. (Mild effect at best.)
- Asking the model to rate its own confidence — model self-evaluation is not well-calibrated. It can be confidently wrong about being confident.
- Bigger / newer models — modern frontier models hallucinate less than 2023-era models, but they still hallucinate. The improvement curve is real but not infinite.
What actually works: 5 habits
1. Ground the model in real text
Whenever possible, give the model the source material to work from instead of asking it to recall facts. This is the principle behind retrieval-augmented generation (RAG) and behind features like Gemini's Deep Research or Claude's project files.
If you're asking about a paper, paste the paper (or its abstract). If you're asking about a codebase, give it the relevant files. If you're asking about a product's pricing, paste the pricing page. Grounded models hallucinate dramatically less because they are answering "what does this text say?" instead of "what do you remember about this?"
2. Use models with retrieval where freshness matters
For anything that changes — current prices, recent releases, news, public figures' current roles — use a model with live retrieval. Perplexity, Gemini with search, ChatGPT with browsing. The model still produces text; the search step grounds it in pages that exist.
Even then, click through the citations. Models occasionally hallucinate citation URLs or summarise sources incorrectly. The retrieval step reduces hallucination; it doesn't eliminate it.
3. Cross-check every concrete claim before publishing
Numbers, dates, quotes, names, citations, API methods, prices, regulations — these are the categories that get hallucinated most often. If your AI-assisted draft contains any of these, you have to manually verify each one.
Develop a habit: every concrete claim gets a primary source. Not "the AI said so" — a primary source. This is slow at first and fast once it's a habit.
4. Ask the model to show its work
Ask for citations, then check them. Ask the model to quote the source directly, then check the quote. Models can still hallucinate when asked to cite — but the act of citing introduces structure that's easier to verify than free-form claims.
For reasoning-heavy tasks, asking the model to "think step by step" or using a reasoning-tier model (o1, R1) measurably improves correctness, especially in math and structured logic.
5. Use the right model for the task
Some models hallucinate less for specific jobs:
- Long-context tasks — Claude with a pasted document hallucinates less about that document than any model asked to recall it.
- Research with citations — Gemini Deep Research is currently best in class.
- Reasoning / math — o1 / R1-class reasoning models.
- Code referencing specific APIs — Cursor / Copilot with the actual SDK files in context.
The bigger pattern: don't ask a tool to recall facts when you can hand it the facts to read.
When hallucination doesn't matter
Plenty of AI uses don't require factual correctness:
- Brainstorming, ideation, "what if"
- Creative writing, fiction, poetry
- Drafts you'll edit anyway
- Format transformations of text you already have
- Summarising text you'll then read yourself
For these, hallucination is a low-stakes nuisance — you'll catch it as part of normal editing.
When hallucination is catastrophic
- Legal filings, medical advice, financial figures
- Citations in academic or journalistic work
- Code that interacts with money, security, or production data
- Public communications attributed to a real person
- Anything you'll publish under your name without re-reading
For these, treat AI output as suggestion only. Every fact gets verified. Every citation gets clicked through. Your name is on the output, not the model's.
The honest summary
Hallucination is a structural property of language models. You can manage it. You cannot prompt it away. Use AI as a fluent collaborator who knows a lot but doesn't always know what they don't know — and treat the work like you would treat a confident-sounding junior employee: review the work before it leaves your desk.