Hallucination
When an LLM confidently produces output that is wrong, fabricated, or unsupported by sources.
- Stems from next-token prediction, not fact retrieval.
- Forms: invented citations, wrong APIs, fake packages, bad math.
- Drops with retrieval, tool use, larger models - never zero.
When to use: Always assume; verify generated code with tests, type checkers, and docs.
Example: A model invents `pandas.DataFrame.normalize_columns()` then writes calling code; lint catches it as undefined.