Hallucination
When an LLM generates content that is fluent and confident but factually wrong.
What is Hallucination?
Hallucinations are LLMs' biggest production risk. The model generates plausible-sounding text that simply is not true — citing papers that do not exist, attributing quotes to wrong people, inventing API endpoints. The output sounds confident; the facts are made up.
Hallucinations happen because LLMs predict likely text, not retrieve facts. When the model has not seen reliable information about a topic, it fills the gap with plausible-sounding patterns rather than saying "I do not know".
Mitigation: (1) use **RAG** to ground answers in retrieved documents, (2) ask the model to cite its sources, (3) use a **smaller, more conservative model** for factual tasks, (4) post-process outputs against known facts, (5) tell the model it is OK to say "I do not know".
Hallucinations are the #1 reason Gen AI products fail in production. Knowing how to detect, mitigate, and design around them is essential.
An early version of a Bangalore HR-tech product hallucinated job titles that did not exist at the queried company. Switching to RAG over LinkedIn data eliminated 95% of hallucinations and unlocked enterprise sales.
Want to master this?
Learn Hallucination in a structured cohort
3-month live program with mentors, real projects, and 50+ partner placement support.
