liveBook · Manning

Hallucination

As explained in Natural Language Processing in Action, Second Edition

Hallucination is the production of fluent or plausible language that is unsupported, incorrect, or disconnected from reality.

Hallucination is fluent, confident language that is unsupported by reality, incorrect, or nonsensical. Large language models can sound intelligent while mainly recognizing patterns in internet text rather than reasoning about the physical world. section 10.1 section 10.2.3

The problem persists even as models grow larger: scaling improves grammar, vocabulary, and memorization, but does not reliably produce common-sense reasoning. Because text-only models lack a sense of reality and opportunities to learn from physical mistakes, fluent output can remain disconnected from the world. section 10.1 section 10.2.3

Counting cow legs with GPT-2

Given “There are 2 cows and 2 bulls, how many legs are there?”, ten generated answers included “four,” “2,” “30,” “three,” and “no.” The variation shows how an ungrounded model can produce plausible-looking language without consistently solving a simple real-world question. section 10.1

Use hallucination as a warning about language-model outputs:

  • Treat confidence and fluency as separate from correctness. section 10.1
  • Expect common-sense failures when a model has only consumed and produced text. section 10.2.3
  • Ground outputs in information retrieval or real-world sensing when reliability matters. section 10.1 section 10.2.3

How Natural Language Processing in Action, Second Edition covers it

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 it assumes
Assumes familiarity with language models while establishing from examples why fluent text does not guarantee reasoning or factuality.
What you can do after
Evaluate model answers more cautiously and identify when retrieval or physical grounding is needed.
How it connects
Connects hallucination with generalization, common-sense reasoning, information retrieval, and embodied AI.

Also explained in

Compare how 29 books explain hallucination →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.