An AI hallucination is a confident but factually wrong answer from an LLM. Learn why it happens, how to detect it, and how to reduce it in chatbots.
More about AI Hallucination
An AI hallucination is a response from a large language model that sounds confident and well-written but contains information that is simply not true. The model invents a citation, fabricates a product feature, gets a date wrong, or confidently states a policy the business never had. Hallucinations are the single biggest reason AI chatbot projects get pulled before launch.
The word "hallucination" is a bit misleading. The model is not seeing things. It is doing exactly what it was trained to do: predict the next token that statistically fits the context. When the training data does not contain the right fact, or the prompt is ambiguous, the model still produces a fluent answer, because fluency is what it optimises for.
Why AI Hallucinations Happen
A few specific mechanisms cause most hallucinations:
- Training data gaps: if a fact is not in the training set, the model guesses based on patterns in related text.
- Outdated knowledge: models have a knowledge cut-off date and know nothing after it.
- Ambiguous prompts: vague questions leave the model room to invent.
- Overconfident decoding: sampling strategies and high temperature settings can push the model into creative territory where accuracy drops.
- Context overflow: if the context window is full, earlier instructions can get ignored or overwritten.
- Instruction conflicts: when the system prompt says one thing and the user asks for another, the model splits the difference and often makes up a compromise.
Categories of Hallucination
Not every hallucination is the same. It helps to separate them:
- Factual hallucinations: wrong facts, wrong dates, wrong names.
- Fabricated citations: made-up URLs, papers, or quotes.
- Logical hallucinations: reasoning that sounds valid but breaks down when you check it.
- Contextual hallucinations: the model invents details that were not in the retrieved context, even when doing retrieval augmented generation.
The last type is the most dangerous for business chatbots, because teams often assume that RAG alone solves the problem. It reduces hallucinations but does not eliminate them.
How to Reduce Hallucinations in Chatbots
Production systems use several defences in combination:
- Grounding with RAG: retrieve relevant passages from a trusted knowledge base and instruct the model to answer only from those passages.
- Strict system prompts: tell the model explicitly that if it does not know, it should say so. Include an out like "if the answer is not in the provided context, reply: I do not have that information."
- Lower temperature: set temperature close to zero for factual queries.
- Guardrails and validators: run outputs through rule-based or model-based checks before showing them.
- Citation enforcement: require the model to quote its source and link to the page, and reject replies that do not cite.
- Human-in-the-loop review: sample outputs and flag problems back into the training or prompt improvement loop.
SiteSpeak chatbots are grounded in the customer's own site content by default, so when a visitor asks a question, the assistant pulls answers from indexed pages rather than from the model's memory. That one design choice removes the largest class of hallucination for support and sales chatbots.
How to Detect Hallucinations
Detection methods exist but none are perfect:
- Self-consistency checks: ask the same question twice and compare. Real facts stay stable; hallucinations often drift.
- Retrieval overlap: verify that claims in the answer actually appear in the retrieved context.
- Second-model verification: use another LLM to grade whether the first model's answer is supported by the source.
- Human spot checks: the most reliable method, especially for high-stakes domains.
Expect to catch most hallucinations in testing if you sample aggressively. The ones that reach production almost always come from queries nobody anticipated.