A hallucination is a language model stating something false with the same fluency it states something true. It is not a bug in the ordinary sense — nothing crashed, no exception was raised, and the output looks exactly like a correct one. That is precisely what makes it expensive in a live product: the failure is invisible at the point it happens, and the first person to notice is usually a customer.
This piece is about the production problem rather than the research one: where hallucinations actually enter a shipped feature, what reduces them in order of leverage, and why none of it is manageable until you can put a number on it.
Why models hallucinate at all
A language model is trained to predict the next token given the tokens so far. Everything it produces is a continuation that is plausible given its training distribution. Truth is not a term in that objective — it correlates with plausibility often enough to be useful, and comes apart exactly where you would expect: specific names, dates, figures, citations, identifiers, and anything that happened after training.
This is why “the model is lying” is the wrong mental model. Lying requires knowing the truth and choosing otherwise. The model has no separate store of facts to consult, and no representation of its own uncertainty that it reliably reports. Asked for a reference that does not exist, it will produce something reference-shaped, because reference-shaped is what the context calls for.
It also explains a behaviour teams find maddening: telling the model not to hallucinate barely helps. The instruction is just more context, and it does not give the model access to a fact it never had.
The four places hallucinations enter a production feature
In a shipped product they almost always come from one of four places, and the fix is different in each.
1. No grounding
The feature asks the model for facts it was never given. Anything specific to your customers, your catalogue, your policies or this week is not in the weights, so the model fills the gap from the distribution. Most “the AI made it up” reports are this.
2. Retrieval that missed
You added RAG, so the model has documents — but the wrong ones, or not the one that mattered. The model still answers, now with the added authority of having cited something. Retrieval failures are the most under-diagnosed source of hallucination in production, because the system looks grounded from the outside.
3. Context the model cannot actually use
Grounding material is present but buried in a very long context, spread across contradictory documents, or written in a way that requires inference the model gets wrong. Having the right chunk in the prompt is not the same as the model using it.
4. Agentic misuse
The agent calls the wrong tool, calls the right tool with wrong arguments, or receives a correct result and then narrates something different. This one is hardest to catch by reading outputs, because the answer can be wrong for a reason that never appears in the answer. It is the failure mode behind agentic pilots that stall before production.
What actually reduces the rate, in order of leverage
Roughly the order we would try them on a live feature:
- Ground the answer, and make grounding mandatory. Give the model the source material and require the answer to come from it. The biggest single reduction available, and it converts an unbounded problem into a retrieval problem you can measure.
- Fix retrieval before touching the prompt. If the right document is not being retrieved, no amount of prompt work will save the answer. Measure retrieval separately from generation — a correct answer assembled from the wrong chunks is a passing result that will fail on the next document set.
- Constrain the output shape. Structured output, enumerated options, schemas and tool signatures remove whole classes of invention. A field that must be one of six values cannot be hallucinated into a seventh.
- Give it a licensed way to decline. Models over-answer partly because nothing in the prompt makes “I don’t have that” an acceptable response. Make abstention explicit, and score it as correct when it is correct.
- Add a verification pass where the stakes justify the cost. A second call that checks the claim against the retrieved source catches a meaningful share of what survives the steps above, at roughly double the token cost on that path.
- Then consider the model. Model choice matters, and it is the step most teams reach for first — which is the wrong order. A stronger model on ungrounded inputs is still guessing, just more convincingly.
Notice what is not on the list: instructing the model to be accurate, or lowering the temperature and hoping. Temperature narrows variety, not error.
You cannot manage what you have not measured
Every intervention above is a trade. Mandatory grounding raises abstention, which users read as unhelpfulness. A verification pass costs latency and money. Constrained output can be too rigid for the actual use case. Choosing between them requires knowing what your current rate is, on your traffic, against your definition of a correct answer — and that number does not exist in a public benchmark, because a benchmark measures a model and you need to measure your feature.
In practice that means a labelled set of real cases sampled from production — enough to cover the edges that actually occur, each with an expected output and a rubric for what counts as correct. It is unglamorous work, and it is the part that gets deferred, because it is the only part an evaluation framework cannot do for you. Once it exists, “did that change help?” becomes a question with an answer, and the same set becomes the gate that stops the next prompt edit quietly undoing the work.
That is what LLM evaluation is for: not a score for its own sake, but the instrument that makes every decision above something other than a guess.
Frequently asked questions
What is an AI hallucination?
An AI hallucination is a confident, fluent output from a language model that is factually wrong or unsupported by any source the model was given. It is distinct from an ordinary software error because nothing fails visibly: no exception is raised, and the incorrect output is indistinguishable in style from a correct one. The term covers invented facts, invented citations, misattributed quotes, and, in agentic systems, narrated actions that were never actually taken.
What causes AI hallucinations?
A language model is trained to predict the next token, so it produces continuations that are plausible given its training distribution. Truth is not part of that objective; it correlates with plausibility much of the time and comes apart on specifics such as names, dates, figures, citations, identifiers, and anything after the training cutoff. In a production feature the proximate causes are usually narrower: the model was asked for facts it was never given, retrieval returned the wrong documents, the grounding material was present but unusable, or an agent misused a tool.
Does RAG stop hallucinations?
It reduces them substantially but does not eliminate them, and it introduces a new failure mode. Retrieval-augmented generation grounds the answer in retrieved documents, which converts an unbounded problem into a retrieval problem. But when retrieval returns the wrong documents, or misses the one that mattered, the model still answers, now with the apparent authority of having cited a source. Retrieval quality therefore has to be measured separately from generation quality: an answer that is correct despite being assembled from the wrong chunks is a passing result that will fail on the next document set.
Can AI hallucinations be eliminated completely?
No, not with current architectures, and any vendor claiming otherwise is describing a demo rather than a product. The generative mechanism that makes a model useful on unseen inputs is the same one that lets it produce plausible-but-wrong output. What is achievable is a rate you have measured, reduced deliberately, and bounded, plus system design that makes the remaining errors cheap: grounding, constrained output, a licensed way for the model to decline, verification on high-stakes paths, and human review where the cost of being wrong justifies it.
How do you measure an AI hallucination rate?
Against a labelled set of real cases from your own product, not a public benchmark, because a benchmark measures a model and you need to measure your feature on your own users' inputs. In practice: sample real production traffic including the edge cases that actually occur, write the expected output and a rubric defining what counts as correct, then score the current system against it to get a baseline. That baseline is what makes every subsequent change measurable, and running it as a gate in the deployment pipeline is what stops a later prompt or model change quietly undoing the improvement.
Does lowering the temperature reduce hallucinations?
Only marginally, and it is often mistaken for a fix. Temperature controls how much variety the model samples across plausible continuations; it does not add information the model never had. A lower temperature makes the output more deterministic, so an ungrounded answer becomes a consistently wrong answer rather than a differently wrong one each time. Grounding, retrieval quality and output constraints all move the rate far more.
Want to know your actual hallucination rate?
We build the eval set from your own production traffic, measure the baseline, and put it in your pipeline as a gate. One feature, four weeks.
See how LLM evaluation works