Hallucination
A hallucination is model-generated content that is false, fabricated, or unsupported by relevant evidence but presented as plausible or factual.
Starting Data Analytics with Generative AI and Python
A generative-AI behavior in which a model produces plausible but unsupported, invented, or inaccurate information.
- How it is used
- Flags unreliable AI-generated insights and code during data analysis and business decision-making.
- How deep it goes
- Defines hallucination, distinguishes it from bad training data and user overtrust, and gives practical verification steps.
- Examples
- Illustrates an invented pandas DataFrame and fictitious legal cases submitted without cross-checking.
- What you can do after
- Diagnose and debug suspect AI output by checking data structures, testing code, and cross-verifying claims.
Read how Starting Data Analytics with Generative AI and Python explains hallucination →
Introduction to Generative AI, Second Edition
An AI hallucination is generated content presented as valid or plausible despite being false, fabricated, or unsupported by available evidence.
- How it is used
- Highlights a major limit on trusting generated answers, especially in high-stakes or automated settings.
- How deep it goes
- Defines hallucination and explains pattern prediction, false premises, and possible causes without implementation detail.
- Examples
- Illustrates fabricated answers with a false bridge-transport question and confident errors on radiology exams.
- What you can do after
- Evaluate generated answers with greater awareness that fluency and confidence do not establish correctness.
Read how Introduction to Generative AI, Second Edition explains hallucination →
The Art of AI Product Development
An AI hallucination is a generated output that presents false, unsupported, or fabricated information as if it were reliable.
- How it is used
- Frames hallucination as a product risk in direct model interaction, interface design, and stakeholder communication.
- How deep it goes
- Defines fabricated outputs and offers risk-assessment and communication practices without explaining their model-level causes.
- Examples
- Uses an unsupported demand-planning recommendation and an unrealistic brainstorming suggestion to illustrate different consequences.
- What you can do after
- Evaluate and understand hallucination risks by considering stakes, error visibility, verification, and user intervention.
Read how The Art of AI Product Development explains hallucination →
Software Testing with Generative AI
A hallucination is a false or unsupported output generated by a large language model that is presented in a clear and authoritative manner.
- How it is used
- Flags a central reliability risk when using LLMs for testing, coding, data generation, or system understanding.
- How deep it goes
- Defines false authoritative output, identifies contributing factors, and gives mitigation tactics without explaining model internals.
- Examples
- Uses a nonexistent book recommendation, an incorrect timesheet risk, and modified-code or unverified system-understanding examples.
- What you can do after
- Diagnose hallucinations by checking claims against code, requirements, models, or external reality before acting on generated output.
Read how Software Testing with Generative AI explains hallucination →
The AI Pocket Book
A model output that is confidently or plausibly produced despite being unsupported or wrong relative to the intended real-world relationship.
- How it is used
- Frames hallucination as a central AI limitation for evaluating applications, products, and everyday model use.
- How deep it goes
- Explains definitions, types, behavioral traits, causes, examples, risks, and mitigation, but does not provide detailed detection procedures.
- Examples
- Uses fabricated books and citations, contextual misreadings, flawed images and puzzles, contradictory arithmetic, chatbots, and self-driving cars.
- What you can do after
- Evaluate hallucination risk, apply prompt engineering, and choose mitigation, detection, reframing, or non-AI alternatives.
Machines that Think
An AI hallucination is a generated claim or content that is false, unsupported, or fabricated while being presented as plausible.
- How it is used
- Frames hallucination as a reliability risk when fluent model outputs are used in consequential decisions and workflows.
- How deep it goes
- Explains probabilistic generation, weak evidence, extrapolation, and answer incentives, then outlines mitigation without claiming guarantees.
- Examples
- Uses a dolphin misclassified as a fish, a weak Einstein finance premise, and fabricated citations in Mata v. Avianca.
- What you can do after
- Evaluate model claims by distinguishing fluent presentation from evidential support and recognizing when external verification or professional oversight is needed.
Effective Conversational AI
An AI hallucination is generated content that presents fabricated, unsupported, or incorrect information as if it were reliable.
- How it is used
- Identifies the risk of plausible, unsupported output when conversational AI answers questions, summarizes transcripts, or helps perform user tasks.
- How deep it goes
- Defines the failure and develops grounding, review, testing, and bounded API choices, without explaining model internals.
- Examples
- Uses an account-balance search with constrained identifiers and transcript ID extraction checked against the conversation.
- What you can do after
- Diagnose/debug with it by checking generated answers or extracted values against evidence and testing risky or ambiguous inputs.
Read how Effective Conversational AI explains hallucination →
AI Governance
An AI hallucination is an output that presents fabricated, unsupported, or false information as though it were valid.
- How it is used
- Frames hallucination as an output-integrity and governance risk that can harm people and affect consequential decisions.
- How deep it goes
- Explains plausible fabrication and its privacy consequences, while deferring hallucination and overreliance remediations.
- Examples
- Uses a fabricated insurance claims history, a false criminal accusation, and AI-invented legal facts or citations.
- What you can do after
- Evaluate the risks of relying on plausible AI claims, especially when they concern identifiable people or inform significant decisions.
LLM Evaluation and Alignment, The Foundational Ideas
An AI system's production of information that is unsupported, fabricated, or factually incorrect while being presented as credible.
- How it is used
- Treats hallucination detection as claim-level evaluation of whether generated information is supported by evidence.
- How deep it goes
- Defines hallucination, outlines claim verification and detection strategies, and briefly surveys mitigation without developing each method in detail.
- Examples
- Illustrates fabrication with a nonexistent Stanford AI ethics study and plausible invented research details.
- What you can do after
- Evaluate generated claims against evidence, select a detection approach for the task, and understand mitigation limitations.
Read how LLM Evaluation and Alignment, The Foundational Ideas explains hallucination →
LLMs in Production
A hallucination is generated content that is presented as plausible but is unsupported, inaccurate, or fabricated relative to the relevant facts or source material.
- How it is used
- Frames hallucinations as a production reliability problem for applications expected to deliver consistent results.
- How deep it goes
- Defines plausible-sounding errors, discusses uncertain causes, and demonstrates prompt optimization for math without claiming a universal fix.
- Examples
- Uses fabricated book references and URLs alongside a grade-school math prompt-optimization example.
- What you can do after
- Evaluate/understand hallucinations as a reliability risk and apply DSPy prompt optimization to a specific math task.
AI Agents and Applications
A hallucination is an incorrect, misleading, or fabricated response generated by a language model.
- How it is used
- Identifies a reliability risk in document Q&A, generated SQL, and tool-based agents.
- How deep it goes
- Defines the failure and works through safer prompts, schema examples, and tool guidance without establishing a guarantee of correctness.
- Examples
- Uses an incorrect temple-column count, invented SQL identifiers, and a travel agent that searches destinations and checks weather.
- What you can do after
- Diagnose and reduce hallucination risk by constraining answers to supplied context, permitting uncertainty, and inspecting tool calls.
Read how AI Agents and Applications explains hallucination →
Data Storytelling with Altair and AI
A hallucination is a generative AI output that convincingly resembles valid or real content despite lacking grounding in reality or the underlying source.
- How it is used
- Supports responsible use of generative AI in data storytelling by requiring review before generated outputs are shared.
- How deep it goes
- Defines hallucinations, explains statistical generation and risks, and gives validation guidance while deferring technical details.
- Examples
- Uses an unsupported Altair mark_hex() method and a nonexistent political scandal in an AI-generated data story.
- What you can do after
- Evaluate/understand generated content by recognizing plausible unsupported output and reviewing it before use.
Read how Data Storytelling with Altair and AI explains hallucination →
Natural Language Processing in Action, Second Edition
Hallucination is the production of fluent or plausible language that is unsupported, incorrect, or disconnected from reality.
- How it is used
- Frames hallucination as a practical reliability problem when evaluating or deploying large language models.
- How deep it goes
- Explains fluent nonsense, scaling limits, and missing physical grounding, but does not develop a formal generation mechanism.
- Examples
- Uses GPT-2 responses to a cow-and-bull counting question as a concrete test of ungrounded output.
- What you can do after
- Evaluate model answers more cautiously and identify when retrieval or physical grounding is needed.
Read how Natural Language Processing in Action, Second Edition explains hallucination →
Machine Learning Platform Engineering
A hallucination is generated content that is unsupported by the available evidence or factually incorrect despite being presented as an answer.
- How it is used
- Reduces unsupported LLM answers through document grounding, structured prompting, observability, and adversarial security testing.
- How deep it goes
- Explains causes and mitigations through RAG, prompt structure, tracing, and testing, but defers full response-validation implementation.
- Examples
- Uses a grounded key-rotation assistant, structured Context-Question-Answer prompts, Gemini configuration, and Promptfoo red-team tests.
- What you can do after
- Diagnose/debug with it by grounding responses, tracing RAG failures, and testing hallucination vulnerabilities adversarially.
Read how Machine Learning Platform Engineering explains hallucination →
Generative AI in Action
An AI hallucination is generated content that is coherent or plausible but factually unsupported, nonsensical, or fabricated.
- How it is used
- Frames hallucination as an enterprise reliability and safety risk, especially in customer-facing and critical decisions.
- How deep it goes
- Defines hallucination and surveys causes and mitigations, with practical prompting and generation examples but no detailed account of model internals.
- Examples
- Uses an incorrect telescope claim, pet-business name generations, and a pet assistant instructed to acknowledge unknown answers.
- What you can do after
- Evaluate hallucination risks and select grounding, prompting, checks, and oversight measures without assuming they eliminate errors.
Retrieval Augmented Generation, The Foundational Ideas
A generated claim that contradicts the evidence or source context available to the generation system.
- How it is used
- Frames unsupported answers as a production reliability risk that retrieval, grounding, and verification must address.
- How deep it goes
- Defines the failure and classifies six forms, but does not provide a step-by-step verification procedure.
- Examples
- Uses a fabricated legal attribution and a Pacific Northwest question answered differently by parameter-only and retrieval-augmented systems.
- What you can do after
- Diagnose/debug with it by separating unsupported claims from retrieval and answer-synthesis failures.
Read how Retrieval Augmented Generation, The Foundational Ideas explains hallucination →
Sutskever's List
A hallucination is content generated by an AI model that is fluent or plausible but factually unsupported or false.
- How it is used
- Uses GPT-2’s polished prose to distinguish convincing generation from a reliable world model.
- How deep it goes
- Illustrates hallucination through sample details, without explaining an internal cause or a remedy.
- Examples
- Contrasts the journalistic style of “Ovid’s Unicorn” with its “four-horned” unicorns and “fires burning underwater.”
- What you can do after
- Evaluate/understand fluent model output without treating its coherence as proof of accuracy.
Inside AI
A hallucination is AI-generated content that is nonsensical, unsupported, or false despite appearing to be a meaningful response.
- How it is used
- Highlights the risk of treating generated answers as trustworthy knowledge.
- How deep it goes
- Defines inaccurate generation and illustrates changing false answers, while noting limits of word prediction and interpretability.
- Examples
- Uses repeated ChatGPT biographical queries that produced fabricated company, award, and degree claims before an accurate response.
- What you can do after
- Evaluate/understand generated answers by recognizing that fluent responses can be false and should be checked against testable sources.
Vibe Engineering
A hallucination is a language-model output that presents false, unsupported, or fabricated information as if it were true.
- How it is used
- Frames hallucination as a risk in AI-assisted coding and autonomous tool use.
- How deep it goes
- Explains missing-context failure modes and practical guardrails, without developing a formal detection method.
- Examples
- Illustrates invented authentication functions, labeled multishot prompts, and fabricated records after a production deletion.
- What you can do after
- Evaluate generated output against project context and apply structured prompts and verifiable references to reduce guessing.
Building Reliable AI Systems
A hallucination is a model-generated output that presents fabricated or unsupported information as if it were true.
- How it is used
- Frames hallucination as a production reliability risk requiring prevention, detection, and ongoing monitoring.
- How deep it goes
- Defines hallucination forms and generation causes, then details mitigation and reference-based evaluation with judge limitations.
- Examples
- Uses invented legal citations, a current-weather API query, and a warranty mismatch to illustrate fabrication and grounding.
- What you can do after
- Diagnose and monitor hallucinations with reference-based LLM judgments and Phoenix classification, while accounting for evaluator errors.
Read how Building Reliable AI Systems explains hallucination →
Grokking AI Applications
An incorrect or nonsensical output generated by a language model, often because of insufficient context or vague instructions.
- How it is used
- Frames hallucination as a prompting problem to manage when seeking reliable language-model outputs.
- How deep it goes
- Defines causes and practical mitigations, but stops short of explaining model internals.
- Examples
- Contrasts underspecified prompts with overloaded prompts and uses a colleague analogy plus a pirate illustration.
- What you can do after
- Apply prompt engineering and verification checks to reduce, but not eliminate, hallucinations.
Learn AI Data Engineering
An AI hallucination is a confident but incorrect or misleading output produced by an artificial intelligence model.
- How it is used
- Frames human review and validation as safeguards when using AI for data-engineering code and extraction.
- How deep it goes
- Defines common failures and gives schema rules, test validation, and multi-solution comparison without explaining model internals.
- Examples
- Uses invented pandas methods, nonexistent columns, invalid SQL joins, fabricated log fields, and unsupported product attributes.
- What you can do after
- Diagnose/debug with it by checking generated outputs against schemas, test data, business context, and independently produced SQL results.
Build an Advanced RAG Application (From Scratch)
A hallucination is a model-generated statement or content that is factually incorrect or nonsensical while appearing coherent.
- How it is used
- Frames hallucination as a reliability limitation requiring validation and fact-checking, especially in critical applications.
- How deep it goes
- Explains the definition, token-prediction mechanism, examples, and RAG-based mitigation without detailing validation algorithms.
- Examples
- Uses a fictional first-person-on-Mars answer and inaccurate hotel-information generation as concrete examples.
- What you can do after
- Apply retrieval-augmented generation to ground generated responses in retrieved, relevant information.
Read how Build an Advanced RAG Application (From Scratch) explains hallucination →
Effective Data Analysis
A hallucination is generated model output that is nonsensical, fabricated, or factually inaccurate despite being presented as a response.
- How it is used
- Frames generative AI output as a practical risk in data-analysis workflows.
- How deep it goes
- Defines the failure mode and links it to prediction errors, but does not develop detection or mitigation procedures.
- Examples
- Uses stale answers about current events and incompatible Python package code as concrete failure examples.
- What you can do after
- Evaluate generated answers as potentially inaccurate and account for freshness and package-version limitations in analytics work.
Machine Learning System Design
A generative-model behavior in which false or unsupported information is presented as if it were true.
- How it is used
- Flags a reliability problem when language models answer questions without dependable external information.
- How deep it goes
- Defines false presentation of information and surveys grounding directions, but stops short of detection or mitigation procedures.
- Examples
- Contrasts GPT-4's zero-shot answers with Bing AI, ChatGPT plugins, Galactica, Toolformer, and LangChain.
- What you can do after
- Evaluate why zero-shot language-model answers may need external sources, executable tools, or API access.
Read how Machine Learning System Design explains hallucination →
Knowledge Graphs and LLMs in Action
A language-model failure in which generated content is plausible but factually unsupported or incorrect.
- How it is used
- Frames LLM reliability as a grounding requirement for accurate, explainable, domain-specific applications.
- How deep it goes
- Explains next-token prediction, missing training knowledge, fabricated outputs, and graph-based mitigation without detailing model internals.
- Examples
- Uses a fabricated NASA SLS rocket cost as a concrete example and graph-grounded querying as an engineering response.
- What you can do after
- Design grounded LLM workflows that retrieve verified knowledge, validate extracted information, and reduce fabricated responses.
Read how Knowledge Graphs and LLMs in Action explains hallucination →
Deep Learning with R, Third Edition
The hallucination problem is a generative-model failure mode in which a model produces plausible-sounding but unsupported or incorrect content.
- How it is used
- Frames hallucination as a central reliability problem in generative language-model prompting and text generation.
- How deep it goes
- Explains next-token prediction and vector-space interpolation, then stops short of offering a guaranteed solution.
- Examples
- Uses an impossible-president prompt and a fabricated historical answer as the central concrete example.
- What you can do after
- Evaluate/understand why fluent LLM output can be factually wrong and apply instruction fine-tuning for more targeted behavior.
Read how Deep Learning with R, Third Edition explains hallucination →
Build Python Web Apps with Streamlit
An AI hallucination is a generated response that presents invented or unsupported information as if it were factual.
- How it is used
- Warns application builders that generated questions and answers may be factually unreliable.
- How deep it goes
- Defines the failure and its probabilistic cause, then defers detailed hallucination handling to external knowledge sources.
- Examples
- Uses repeated trivia questions and Nibby’s fictional fountain-pen brands to demonstrate unreliable generation.
- What you can do after
- Evaluate generated claims as potentially unsupported and recognize external information as a mitigation strategy.
Read how Build Python Web Apps with Streamlit explains hallucination →
AI-Powered Search
Model hallucination is the generation of plausible-sounding but incorrect or unsupported content by an AI model.
- How it is used
- Explains why search systems tether generative models to indexed, trusted information and use RAG for more accurate answers.
- How deep it goes
- Defines hallucination, attributes it to lossy knowledge compression, and stops short of implementation detail.
- Examples
- Uses factual question answering, generated search content, and a Paris itinerary to illustrate reliability and ethical risks.
- What you can do after
- Apply it via retrieval-augmented generation by supplying search results as context for generative tasks.
Troubleshooting Java, Second Edition
An AI hallucination is an AI-generated claim or detail that appears plausible but is fabricated or unsupported by reality.
- How it is used
- Guides developers in checking AI-assisted troubleshooting answers before applying them to an application problem.
- How deep it goes
- Defines fabricated plausible claims and gives verification, prompting, and privacy safeguards without explaining model internals.
- Examples
- Uses pasted troubleshooting code, sensitive prompt details, reliable-source checks, and follow-up prompts as investigative examples.
- What you can do after
- Evaluate AI troubleshooting responses, verify their claims, refine prompts, and protect sensitive information.
Read how Troubleshooting Java, Second Edition explains hallucination →
MongoDB 8.0 in Action, Third Edition
An AI hallucination is plausible-sounding generated content that is incorrect, unsupported, or nonsensical.
- How it is used
- Explains why generated answers become unreliable and motivates grounding chatbot responses with retrieved external information.
- How deep it goes
- Defines the failure mode, explains pattern-based generation, and outlines mitigation without detailing model internals or verification algorithms.
- Examples
- Uses MongoDB Atlas documentation, Atlas Vector Search, GPT-4, LangChain, embedded queries, and retrieved documents as grounding examples.
- What you can do after
- Apply it via LangChain and Atlas Vector Search to ground chatbot responses in retrieved, verified information.
Read how MongoDB 8.0 in Action, Third Edition explains hallucination →
Enterprise RAG
AI-generated answers that contain fabricated, unsupported, or factually inaccurate information.
- How it is used
- Reduces trust, sales, reliability, and legal risks when deploying LLM-powered enterprise RAG systems.
- How deep it goes
- Defines plausible false answers and discusses retrieval accuracy, uncertainty handling, limitations, consistency, and operational monitoring without implementation details.
- Examples
- Uses incorrect product availability, fabricated product features, and a legally consequential chatbot promise as failure examples.
- What you can do after
- Evaluate/understand hallucination risks and design RAG workflows that handle uncertainty, communicate limitations, and monitor answer reliability.
Investing for Programmers
An AI hallucination is a generated statement or output that is unsupported, fabricated, or factually incorrect despite being presented plausibly.
- How it is used
- Uses hallucination risk to qualify LLM-assisted financial research and discourage unverified investment advice.
- How deep it goes
- Explains the decision risk and review response, but stops short of technical causes, detection methods, or mitigation algorithms.
- Examples
- Uses generic stock recommendations, detailed company questions, and investment scorecards as contrasting research examples.
- What you can do after
- Evaluate LLM-generated financial research through review, detailed questioning, and further investigation before making decisions.
Financial AI in Practice
A model hallucination is generated content that is unsupported or misleading but presented as though it were reliable.
- How it is used
- Treats hallucination as a reliability risk in financial AI and investment research.
- How deep it goes
- Defines plausible fabrication and outlines financial failure modes and RAG limitations.
- Examples
- Cites invented CEO quotes, misstated financial metrics, and misleading positive spins in summaries.
- What you can do after
- Evaluate generated investment signals as hypotheses to verify rather than proof.
AI Agents in Action, Second Edition
A hallucination is model-generated content that is plausible-sounding but wrong or contradictory to the relevant source information.
- How it is used
- Constrains RAG agent answers to retrieved documents instead of unsupported model knowledge.
- How deep it goes
- Explains the failure mode, its cause, and prompt-based safeguards without descending into model internals.
- Examples
- Uses a Back to the Future script, Chroma vector storage, retrieved passages, and time-specific questions as grounding tests.
- What you can do after
- Diagnose hallucinations and reduce them by enforcing context-only answers, citations, passage selection, and source tracing.
Read how AI Agents in Action, Second Edition explains hallucination →
Coding with AI
An AI-generated output that is fluent or confident but factually incorrect, nonsensical, or unsupported.
- How it is used
- Treats hallucination as a warning that requires verification before accepting AI-generated code.
- How deep it goes
- Explains prediction and training-data causes, then stops short of presenting a detection algorithm or formal model.
- Examples
- Uses flawed code, inefficient list choices, unnecessary libraries, edge-case failures, and outdated Python patterns as examples.
- What you can do after
- Diagnose/debug with it by checking generated code against facts, edge cases, Python practices, and project architecture.
Causal AI
A hallucination is confidently generated model output that contains false, unsupported, or incorrectly inferred content.
- How it is used
- Uses causal expertise to audit fluent LLM answers before incorporating them into causal analysis.
- How deep it goes
- Explains hallucination through a worked probability-of-necessity error and connects it to identification, attention, and unverifiable representations.
- Examples
- Uses a GPT-4 probability-of-necessity formula, compiling Python code, omitted assumptions, and contrasting model responses.
- What you can do after
- Diagnose/debug with causal expertise by checking identifying assumptions before trusting generated causal formulas, explanations, or code.
Also covered in
- Learn AI-Assisted Python Programming, Second Edition
- AI for Everyday IT
- Grokking Software ArchitectureIn early access (MEAP)
- Spring AI in Action
- Data-Driven Cybersecurity
- Data Analysis with LLMs
- Context EngineeringIn early access (MEAP)
- Crack Any Codebase with AIIn early access (MEAP)
- Essential GraphRAG
- Understanding AIIn early access (MEAP)
- Graph Algorithms for Data Science
- Architecting Autonomous Agentic SystemsIn early access (MEAP)
What to know first
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- ChatGPTChatGPT is OpenAI’s conversational AI service, which lets users interact with generative AI models and related tools through natural-language prompts.
- promptA prompt is text or other input supplied to an AI model to provide instructions, context, or other information that guides its response or generated output.
- conversational aiConversational AI is artificial intelligence that enables software systems to interpret user input and interact with users through natural-language dialogue.
Related concepts
- retrieval-augmented generationaddressed by · Retrieval-augmented generation is a technique that retrieves relevant information from external sources and supplies it as context to a generative model when producing an output.
- extrinsic hallucinationincludes · An extrinsic hallucination is generated content that is unsupported by, or not inferable from, the supplied source or context.
- intrinsic hallucinationincludes · An intrinsic hallucination is generated content that contradicts or is factually inconsistent with the supplied source or context.
- tool integrationaddressed by · Tool integration is the process of connecting external tools to an AI system so that its model or application logic can invoke them.
Questions about hallucination
What is hallucination?
A hallucination is model-generated content that is false, fabricated, or unsupported by relevant evidence but presented as plausible or factual.
Which Manning books explain hallucination?
Starting Data Analytics with Generative AI and Python, Introduction to Generative AI, Second Edition, The Art of AI Product Development, Software Testing with Generative AI, The AI Pocket Book, Machines that Think, Effective Conversational AI, AI Governance and 29 more.
What should I know before learning hallucination?
Manning books that teach hallucination usually introduce language model, ChatGPT, prompt and conversational ai first.
What is the difference between hallucination and error?
A hallucination is model-generated content that is false, fabricated, or unsupported by relevant evidence but presented as plausible or factual. A software error is a fault or unexpected condition in a program or its execution that causes incorrect behavior or prevents intended operation.
What kinds of hallucination are there?
Kinds of hallucination include extrinsic hallucination and intrinsic hallucination.
What is hallucination also called?
Hallucination is also called hallucinate, hallucinating, hallucinated, fabrication or confabulation.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




































