# AI Hallucination An AI hallucination is when a [[Large Language Models (LLMs)|Large Language Model]] generates content that is factually incorrect, fabricated, or nonsensical while presenting it with full confidence. The model doesn't "know" it's wrong; it's producing the most statistically likely continuation of its input, and sometimes that continuation is fiction dressed as fact. Hallucinations are not bugs in the traditional sense. They're a structural property of how LLMs work: the model predicts tokens based on patterns, not based on verified knowledge. It can confidently cite papers that don't exist, invent function signatures, or describe historical events that never happened. Common hallucination types: - **Factual fabrication**: invented facts, dates, names, citations - **Code hallucination**: plausible-looking code that references nonexistent APIs, functions, or parameters - **Confident confabulation**: filling knowledge gaps with plausible-sounding but false information - **Source hallucination**: inventing URLs, paper titles, or quotes Hallucination risk increases with [[Context Bloat]] (noisy context confuses the model), poor [[Context Engineering]] (insufficient grounding information), and long generation without verification. [[Retrieval-Augmented Generation (RAG)]] reduces hallucinations by grounding output in actual documents. [[Agentic TDD]] catches code hallucinations through execution and testing. [[AI Guardrails]] can flag likely hallucinations before they reach users. The practical stance: never assume LLM output is correct until verified. This is why [[Agentic Engineering]] emphasizes code execution, testing, and human review over blind trust. ## References - ## Related - [[Large Language Models (LLMs)]] - [[AI Limitations]] - [[AI Sycophancy]] - [[AI Safety]] - [[AI Guardrails]] - [[Context Engineering]] - [[Context Bloat]] - [[Retrieval-Augmented Generation (RAG)]] - [[Agentic TDD]] - [[Agentic Engineering]] - [[Prompt Engineering]] - [[Slopsquatting]] - [[Obsidian Starter Kit - Tutorial - Managing AI sessions]] - Operational guidance to reduce hallucination risk in OSK sessions