Generative AI can draft an email, summarise a report or write working code in seconds. It can also state something completely false, in the same confident tone, with no warning. That second behaviour has a name: hallucination.
If you use AI tools at work, or you are building AI features into a product, understanding hallucinations is essential. This guide explains what they are, the different forms they take, why they happen, and the practical techniques that reduce them.
What is an AI hallucination?
An AI hallucination is output from an AI model that sounds plausible and confident but is false, made up, or not supported by the information the model was given.
The term is most often used for large language models (LLMs), the systems behind chatbots such as ChatGPT, Claude and Gemini, but it also applies to image, audio and video generators. A hallucination is not a bug in the usual sense. It is a side effect of how generative models work: they are built to produce likely-looking output, and likely-looking is not the same as true.
In short: a hallucination is when an AI fills a gap in its knowledge with something that sounds right instead of saying "I don't know".
Common types of hallucinations
1. Factual fabrications
The model states an incorrect fact: a wrong date, a statistic that does not exist, a quote someone never said, or a product feature that was never built.
2. Fake citations and sources
Asked for references, a model may produce realistic-looking academic papers, URLs, court cases or book titles that do not exist. The format is perfect; the content is invented. This is one of the most damaging types, because citations are exactly what people rely on to check facts.
3. Source-contradicting (intrinsic) hallucinations
The model is given a document, for example a contract or a meeting transcript, and its summary says something that contradicts that document, such as reversing a deadline or attributing a decision to the wrong person.
4. Unsupported (extrinsic) hallucinations
The output adds details that are not in the source at all. They might even be true, but they cannot be verified from the input, which is a problem when the task was "summarise only what is in this file".
5. Reasoning and calculation errors
The model presents a step-by-step explanation where one step is wrong, or performs arithmetic incorrectly, and then builds a confident conclusion on top of the mistake.
6. Code hallucinations
Coding assistants can invent functions, parameters or entire libraries that do not exist. This has a security angle: attackers can register package names that AI tools commonly hallucinate, so a developer who installs a suggested package without checking could pull in malicious code. This is sometimes called "slopsquatting".
7. Image and multimodal hallucinations
Image generators may produce extra fingers, impossible objects or garbled text. Vision models describing an image may report objects that are not there.
Why do AI models hallucinate?
They predict, they do not look things up
An LLM generates text one small piece (a token) at a time, choosing what is most likely to come next based on patterns learned during training. It does not consult a database of verified facts. When the patterns strongly point to the right answer, the output is correct. When they are weak or conflicting, the model still produces something fluent.
Gaps and errors in training data
Models learn from huge amounts of text that inevitably contain mistakes, outdated information and gaps. Rare topics, recent events after the model's training cutoff, and niche company-specific details are where hallucinations are most common.
Training rewards a confident answer
Models are trained and evaluated on producing helpful answers. If training and benchmarks reward a guess that might be right more than an honest "I'm not sure", models learn to guess. Researchers increasingly point to this incentive as a root cause, and newer training methods try to reward appropriate uncertainty.
No built-in sense of what they do not know
A model has no reliable internal signal that says "this fact is outside my knowledge". Its confidence in wording is not the same as confidence in accuracy.
Randomness in generation
Most AI tools sample from several possible next words rather than always picking the single most likely one. Settings such as temperature control this randomness. Higher randomness produces more creative text, and also more opportunity to drift from the facts.
Ambiguous prompts and long contexts
Vague questions invite the model to fill in assumptions. Very long conversations or documents can cause it to lose track of details, mix up sources or carry an early mistake forward.
Hallucination vs creativity
The same ability that causes hallucinations makes generative AI useful for brainstorming, fiction, marketing ideas and design. Inventing a new product name is valuable; inventing a product's safety certification is not. The question is never "can this model hallucinate?" (they all can) but "does this task require factual accuracy, and how will we verify it?"
Real-world risks of AI hallucinations
- Legal: lawyers in several countries have faced sanctions after submitting court filings that cited cases invented by AI chatbots.
- Customer service: in a widely reported 2024 Canadian tribunal decision, an airline was held responsible for a refund policy that its website chatbot had described incorrectly to a customer.
- Healthcare and finance: incorrect dosage information, eligibility rules or financial figures can cause real harm.
- Software security: hallucinated packages and insecure suggested code can introduce vulnerabilities.
- Brand reputation: AI assistants may describe your company, prices or services incorrectly to potential customers.
The common lesson: an organisation is usually still responsible for what its AI tools say.
How to reduce hallucinations as a user
- Give the model the facts. Paste the document, data or policy and ask it to answer only from that material.
- Allow "I don't know". Explicitly say: "If the answer is not in the provided text, say you don't know."
- Ask for sources, then check them. Open every link and confirm the cited page actually says what the AI claims.
- Use tools with web search or file access for recent or specific facts, rather than relying on the model's memory.
- Break big tasks into steps and review each step before moving on.
- Ask the same question twice or rephrase it. If answers disagree, treat the claim as uncertain.
- Verify numbers, names, dates, quotes and code before you publish or act on them.
How to reduce hallucinations when building AI products
Retrieval-augmented generation (RAG)
RAG connects the model to your own trusted content. For each question, the system searches your documents, passes the most relevant passages to the model, and instructs it to answer from them. This grounds answers in real, current information and makes it possible to show sources.
Require and verify citations
Have the model cite the exact passage behind each claim, then automatically check that the cited text exists and supports the statement. Remove or flag claims without support.
Use tools for things models are bad at
Let the model call a calculator, a database query, a search API or your product catalogue rather than generating numbers, prices or availability from memory.
Constrain the output
Use structured outputs (for example JSON with a fixed schema), validate them in code, and restrict answers to allowed values where possible.
Tune generation settings
For factual tasks, lower the temperature and keep instructions precise and specific.
Add guardrails and fallbacks
Detect questions outside the system's scope and respond with a safe fallback such as "I can't answer that, here is how to contact our team" instead of guessing.
Evaluate continuously
Build a test set of real questions with known correct answers and run it every time you change the prompt, model or data. Track the hallucination rate alongside other quality metrics.
Keep a human in the loop
For high-stakes outputs, such as legal, medical, financial or anything published publicly, require human review before the answer is used.
How to spot a possible hallucination
- Very specific details (exact figures, quotes, citations) with no source
- Sources that are hard to find or whose links do not open
- Answers that change when you ask again
- Claims that contradict a document you provided
- Overly smooth answers to questions that should be uncertain or debated
- Code that references functions or packages you cannot find in official documentation
Will AI hallucinations ever go away?
Newer models hallucinate less often than earlier ones, especially when connected to search and retrieval, and research into calibrated uncertainty is active. But because generative models produce probable output rather than retrieving verified facts, hallucinations are expected to become rarer, not to disappear entirely. The reliable approach is to design workflows where AI output is grounded in trusted data and important claims are verified.
Conclusion
AI hallucinations are confident mistakes: plausible-sounding output that is false or unsupported. They happen because generative models predict likely text rather than look up facts, and because training has often rewarded answering over admitting uncertainty. You cannot eliminate them completely, but you can make them rare and catch them early by grounding the model in real data, letting it say "I don't know", using tools for facts and figures, checking sources, and keeping humans in charge of high-stakes decisions.



