Evaluation · beginner
Hallucination
A hallucination is a confidently-stated, plausible-sounding LLM output that is factually wrong. It is the failure mode that most often surprises non-expert users.
Explanation
LLMs predict likely tokens. "Likely" does not mean "true." When asked about a topic the model did not see much of in training (rare authors, niche software versions, recent events past the knowledge cutoff), it tends to interpolate something fluent and wrong rather than admit it does not know.
Reducing hallucinations: lower temperature, retrieve real sources (RAG), allow the model to say "I do not know," constrain outputs to specific schemas, and use grounded eval to catch regressions. Hallucinations cannot be fully eliminated with current architectures — the safer play is treating LLM output as a draft to verify.
Examples
- Citing a paper that does not exist.
- Inventing a function name for a library that does not have one.
Frequently asked
What is Hallucination?
A hallucination is a confidently-stated, plausible-sounding LLM output that is factually wrong. It is the failure mode that most often surprises non-expert users.
What is an example of hallucination?
Citing a paper that does not exist.
How is Hallucination related to Retrieval-Augmented Generation?
Hallucination and Retrieval-Augmented Generation are both evaluation concepts. RAG retrieves relevant documents from a corpus at query time and includes them in the prompt, letting an LLM answer with up-to-date, source-cited, private information without retraining.
Is Hallucination considered beginner?
Hallucination is generally considered beginner-level material in the AI and LLM space.