Hallucination
In the context of AI, a hallucination refers to a model generating outputs that seem plausible but are factually incorrect or nonsensical, often presented with high confidence.
In the context of artificial intelligence, particularly large language models (LLMs) and other generative models, a 'hallucination' refers to the phenomenon where the AI produces output that is nonsensical, factually incorrect, or not grounded in its training data or provided input, yet presents it with a high degree of confidence. These outputs can range from subtle inaccuracies to completely fabricated information, events, or citations. Hallucinations arise from several factors inherent in the way these models learn and generate text. Models learn statistical patterns from vast datasets; if these patterns are ambiguous, incomplete, or contain biases, the model may generate plausible-sounding but incorrect statements. During the generation process, models predict the next most likely word (or token) based on the preceding sequence. This probabilistic approach can lead the model to 'drift' into generating incorrect information, especially when dealing with topics outside its core training data or when prompted in ways that exploit its learned associations. Furthermore, models might 'confabulate' by combining unrelated pieces of information from their training data in a way that creates a false narrative. Addressing AI hallucinations is a major area of research, involving techniques like improving training data quality, refining model architectures, implementing fact-checking mechanisms, and using methods like Retrieval-Augmented Generation (RAG) to ground responses in verifiable external knowledge sources.
graph LR
Center["Hallucination"]:::main
Pre_computer_science["computer-science"]:::pre --> Center
click Pre_computer_science "/terms/computer-science"
Rel_hallucination["hallucination"]:::related -.-> Center
click Rel_hallucination "/terms/hallucination"
Rel_artificial_intelligence["artificial-intelligence"]:::related -.-> Center
click Rel_artificial_intelligence "/terms/artificial-intelligence"
Rel_large_language_model["large-language-model"]:::related -.-> Center
click Rel_large_language_model "/terms/large-language-model"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Explain Like I'm 5
AI hallucinations are like when a robot confidently tells you something that sounds true but is actually made up or wrong, like saying dogs can fly because it mixed up stories it heard.
🤓 Expert Deep Dive
AI hallucinations represent a failure mode in generative models, stemming from the discrepancy between the model's learned internal representation and objective reality or factual accuracy. Architecturally, LLMs trained solely on next-token prediction can overfit to spurious correlations in the training data or extrapolate beyond their knowledge boundaries. This can manifest as generating plausible but false factual claims, inventing non-existent entities or events, or misattributing information. Techniques to mitigate hallucinations include: 1) Improving data quality and diversity to reduce noise and bias. 2) Employing retrieval-augmented generation (RAG), where the model retrieves relevant information from an external knowledge base before generating a response, thereby grounding the output. 3) Using uncertainty quantification methods to estimate the confidence of generated statements. 4) Fine-tuning with human feedback (RLHF) specifically penalizing factual inaccuracies. 5) Constraining the generation process with logical rules or knowledge graphs. The challenge lies in balancing hallucination reduction with maintaining the model's fluency, creativity, and ability to handle novel or underspecified prompts.