Why models hallucinate, and what actually reduces it
A model always produces a plausible continuation, whether or not grounds exist for one. Instructing it not to invent things helps marginally; giving it the source material, letting it decline, and verifying claims against something external help considerably more.
Calling it hallucination makes it sound like malfunction — as though the system usually reports facts and occasionally glitches. The mechanism is the same in both cases. The model produces the most plausible continuation. Sometimes the plausible continuation happens to be true.
Nothing can report a gap
A lookup that misses returns nothing and your code handles it. A model has no equivalent step, so there is no point at which "I do not have this" could be produced by the machinery rather than by the prose.
Ask for a citation on an obscure topic and you may get a perfectly formatted reference to a paper that does not exist. Every surface feature is right, because surface features are what the model models.
Why instructions alone are weak
"Only state facts you are certain of" assumes an internal certainty signal that the model can consult. It does not have one in any usable form. The instruction shifts the style — more hedging, more qualifiers — without much changing which claims appear.
It is worth including, and worth not relying on.
The instruction that does work
Explicitly permitting refusal is different, because it makes "the answer is not here" a plausible continuation rather than an unusual one. "If the provided context does not contain the answer, reply exactly: not in the source." gives the model a well-formed thing to say, and it says it far more often than you would expect.
Grounding is the big lever
Put the source material in the context and the problem changes shape. The model is no longer reaching into diffuse statistical knowledge; it is summarising text in front of it, which is a task it is genuinely good at.
This is most of the value of retrieval-augmented generation. Not that it makes the model smarter, but that it converts recall into reading.
Verification belongs outside the model
For anything consequential, add a check the model does not perform on itself. Require quotes from the supplied text and confirm in code that they appear. Check cited identifiers against your database. Run generated code. Have a second call assess the first against the source.
And design the interface for the failure. Showing the passage an answer came from, so the user can judge in a glance, is often worth more than another point of accuracy.
Frequently asked questions
Will a bigger model stop hallucinating?
It will hallucinate less on things it saw more of, which is not the same as stopping. The mechanism is unchanged: generate the most plausible continuation. Anything outside the training data still produces confident invention.
Does retrieval solve it?
It reduces it a great deal and introduces a new failure: the model can still misread or over-extend what was retrieved. Grounding plus a citation the user can check is much stronger than grounding alone.