Skip to content
in/guard/out
in/guard/out

Learn

What are AI hallucinations?

An AI hallucination is output a model states as fact that is not supported by its input or by reality: an altered figure, an invented citation, a confident claim its sources cannot back. The model is not malfunctioning when it does this – it is doing exactly what it was built to do, continue text plausibly – and plausible is not the same as true.

Hallucination is why teams that would happily save 10x on a cheaper model don’t: the cheaper the model, the higher the rate, and nobody wants to find the wrong number after it shipped in a customer-facing report. Detection changes that economics – if wrong answers get caught at the boundary, the guarantee no longer has to come from the most expensive model.

§01 The four types that matter in production

Taxonomies abound; these are the four classes that actually cause incidents:

Numeric drift

A figure changes between source and answer – 15 mg becomes 50 mg, €1,240 becomes €1,420 – or the arithmetic connecting figures is simply wrong. The most consequential class in reports, finance, and healthcare, and the most mechanically detectable.

Fabricated references

Citations, clause numbers, case names, URLs that do not exist or do not say what is claimed. Endemic in legal and research use.

Internal contradiction

The answer disagrees with itself – “revenue grew 12%” two paragraphs after a table showing a decline. Common when documents are revised or summarized in pieces.

Overconfident extrapolation

The source supports a hedged claim; the model states an unhedged one. The subtlest class – every word is fluent, only the certainty is fabricated.

§02 Why models hallucinate

A language model predicts the next token given the previous ones. Nothing in that objective distinguishes remembering from improvising – when the context underdetermines the answer, the model produces the statistically plausible continuation either way, in the same fluent voice. Post-training makes it worse in one specific dimension: models are tuned to be helpful and confident, and a training process that rewards an answer over an honest “I don’t know” produces exactly the overconfident extrapolation that grading rubrics now try to penalize.

This is also why hallucination cannot be solved purely with a better prompt. “Do not make things up” is an instruction; the failure is in how the answer is generated, not in what the model was asked to do.

§03 How detection actually works

The effective strategy is layered and cheapest-first, because the detectable classes differ enormously in what it costs to catch them:

Deterministic grounding

Recompute the arithmetic, match every figure in the answer to the source, check stated directions against the underlying values. Catches numeric drift and directional contradictions with zero model calls – and it can never hallucinate about hallucinations.

A fact-check judge

A guard model evaluates whether claims are supported by the provided material, flags internal contradictions and unhedged certainty. Crucially, an honest “I don’t know” is never punished – only confidence the source can’t back.

External grounding

For claims the request alone can’t verify: retrieval against your document store, live web search, or a second model as an independent critic – disagreement itself is signal.

§04 Detection is only half; the other half is what happens next

A flag in a log nobody reads is not a guardrail. In FIX mode the proxy repairs what is safely repairable – wrong arithmetic corrected in place – and records everything else in a grounding report: the answer marked up with exactly which claims failed and why. In PREVENT mode an ungrounded answer never reaches the user at all; your app receives a 422 with the findings instead. Either way the failure is caught before it ships, not in next week’s eval run.

§05 Frequently asked questions

What causes AI hallucinations?

The generation objective itself: models continue text plausibly rather than truthfully, so when context underdetermines the answer they improvise in the same confident voice. Tuning for helpfulness amplifies the confidence.

Can hallucinations be eliminated?

Not at the model level – rates fall with better models and grounding, but no model guarantees zero. What can be guaranteed is boundary checking: verify figures and claims against sources on every response and block or repair what fails.

How do you detect a hallucination without using another LLM?

Deterministically, for the numeric class: recompute the arithmetic, match every number in the answer to the source, compare stated trends to the actual values. That covers altered figures, botched math, and contradicted directions with no judge model involved.

Do hallucination checks let us use a cheaper model?

That is the core economics: when the boundary catches wrong answers, the quality guarantee comes from the checks rather than the model tier – so cost-effective models become usable for work that previously demanded the frontier one.

§06 Keep reading

See the checks run on your own traffic.

One base-URL change puts every request behind the guardrail pipeline. We’re running a limited demo – sign up and we’ll get you in as soon as we can.