Why models hallucinate
A large language model generates the most plausible next words. It does not look facts up unless a system hands it sources, and it has no built-in sense of what it does not know. Gaps in training data, vague questions and missing context all push it towards a guess. Training and scoring methods that reward a confident answer over admitting uncertainty make guessing more likely.
The forms it takes
- Invented facts: a price, a date, a clause or a product feature that is not real.
- Fabricated sources: references, links or case numbers that look right and lead nowhere.
- Unfaithful summaries: a summary that adds a detail the document never contained.
- Wrong actions: an AI agent calls a tool with an order number it made up.
How to reduce the risk
No method removes it completely, so build layers.
- Ground answers in approved sources with retrieval-augmented generation, and require citations.
- Tell the model it may say it does not know, and test that it does.
- Constrain output where you can: pick from a list, fill a fixed schema, quote rather than paraphrase.
- Check claims against systems of record. If the model names an order, confirm the order exists before acting.
- Measure how well answers stick to their sources with an evaluation set, and sample live answers.
- Keep a person reviewing outputs that carry legal, financial or medical weight.
An example
Imagine a shop's chat assistant asked whether sale items can be returned. The policy page was never indexed, so the model offers a plausible return window the shop never had. A better prompt alone is not the fix: index the policy, require a citation for any policy answer, and send the question to staff when no source supports it. This example is hypothetical. Our AI agent testing work looks for exactly these gaps.