Blog/What is an LLM hallucination?
Definition

What is an LLM hallucination?

By Samuel Seidel · Published September 9, 2026

An LLM hallucination is output that reads as fluent and confident but is factually wrong, invented, or unsupported by the source material it was meant to be based on. A model can invent a citation, misstate a date, cite a court case that was never decided, or describe a function argument no library accepts, in exactly the tone it uses for correct answers.

Why it happens

A language model generates text by predicting the next most likely token given everything before it, based on patterns learned from training data. It has no built-in way to check whether a claim is true. It produces the sequence of words that statistically resembles a correct answer, and usually that sequence is correct, because true statements dominate its training data. When the plausible answer and the correct answer diverge, nothing inside the model signals the difference: it is trained for likely text, and likely is not the same as true.

Where it shows up most

Hallucination risk rises with how far a question sits from well-represented training data: obscure facts, recent events past the model's training cutoff, specific numbers, and exact citations are common failure points. It's also common when a model is asked to reason beyond what it retrieved or was told, filling gaps with plausible-sounding invention rather than saying it doesn't know. Models tend to hallucinate less on tasks with strong patterns in training data, like common code syntax, and more on tasks requiring precise, verifiable facts.

What reduces it, and what doesn't fully fix it

Retrieval-augmented generation grounds a model's answer in retrieved source documents rather than its training memory alone, which reduces fabrication on questions the retrieved documents cover. Lower sampling temperature makes output more deterministic and can reduce some invention, though it doesn't address the underlying cause. Neither eliminates the problem: a model can still misread a retrieved passage, or confidently state something the passage doesn't support.

If LLM output feeds decisions that matter, add a human review step or an automated check against a trusted source. A better prompt alone won't do it.

Why it matters for how you deploy

Where the model runs doesn't change how often it hallucinates. What deployment does change is whether you can test, log and iterate on a specific model against your own workload, comparing model versions and prompt changes to find the configuration that hallucinates least on your data. See evaluating an LLM before deploying it for a structured way to test this before committing to a model, and logging and log retention for LLM APIs for keeping the record needed to catch hallucinations after deployment.

Related pages

First top-up: pay $20, get $30 in credit

Test models against your own workload before you commit.

Run candidate models side by side on one dedicated Spark, $0.79/hour, deployed in minutes from EU-Central.

Create account