Back to glossary

Term

Hallucination

A hallucination is a language-model response that sounds plausible but is factually wrong or fabricated — typically caused by statistical guessing without a factual anchor.

Hallucination — explained in more detail

Language models generate text token by token based on probabilities. When the model lacks reliable context for a question, it still fills the gap fluently — the output looks convincing but may invent sources, misquote figures, or attribute statements to people who never said them. Hallucinations cluster in areas where training data is thin, the knowledge cutoff has passed, or the question asks for internal details the model simply does not have.

Example / Practical context

Classic cases: fabricated book titles with plausible-looking ISBNs, invented court rulings with realistic case numbers, made-up API parameters in code samples. Countermeasures include retrieval-augmented generation (RAG), requiring sources in the prompt, lowering temperature, and verifying through external tools or tests.

A hallucination is neither a deliberate lie nor a classical bug — it is a property of generative systems. It differs from prompt injection (external manipulation of the input) and from a knowledge-cutoff gap (where the model simply does not know something rather than inventing it).

Entdecke mehr