AI Chatbot Terms > 4 min read

AI Hallucination: Why LLMs Make Things Up and How to Stop It

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.

Frequently Asked Questions

Language models are trained to produce fluent text, not to verify facts. They predict the next token based on statistical patterns in their training data. When the right answer is not clearly represented in those patterns, the model still generates something plausible-sounding. It does not have a built-in "I do not know" signal unless you design one into the system prompt.

No, but it reduces them significantly. Retrieval augmented generation gives the model real passages from a trusted knowledge base, which stops it from inventing facts. Contextual hallucinations can still happen when the model overgeneralises from the retrieved context or mixes in its own training data. Pair RAG with citation enforcement and low temperature for best results.

The common approach is to sample a representative set of conversations, manually label each answer as correct, partially correct, or hallucinated, and track the rate over time. Automated graders using a second LLM are useful for scale but less accurate than human review. Whichever you choose, measure regularly and break the numbers down by topic so you can see which parts of the knowledge base need work.

Share this article:
Copied!

Ready to automate your customer service with AI?

Join over 1000+ businesses, websites and startups automating their customer service and other tasks with a custom trained AI agent.

Create Your AI Agent No credit card required