liveBook · Manning

Hallucination

As explained in 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.

A hallucination is AI-generated content that does not correspond to reality. It can look convincing while being misleading, fabricated, or unsupported, so generated text, data, images, and code should not be treated as truth by default. section 10.1.1 section 4.1.5

Generative systems produce statistically probable output rather than communicating intent. This can yield plausible errors, especially where training data underrepresents a language or context. Hallucinations can mislead audiences, distort decisions, and enable manipulation. section 10.1.1

Reduce the chance that an appealing output becomes part of a misleading data story:

  • Write accurate, concise, specific instructions with consistent syntax, language, and format. section 4.1.5
  • Keep a human in the loop: judge and review every generated item before incorporating it. section 10.1.1 section 4.1
  • Treat generated output as an assistant’s draft, not an absolute truth. section 4.1
  • Consider generation parameters such as temperature when tailoring randomness, predictability, creativity, and unpredictability. section 10.1.1

A believable but nonexistent code method

When asked for a hexbin chart, ChatGPT produced Altair code using mark_hex(), a method that was not implemented. The output looked like usable code, but checking the target library exposed the hallucination. section 4.1.5

A fabricated data-story claim

An entirely AI-generated data story could describe a nonexistent political scandal. Even without obvious warning signs, such a claim could mislead the public and influence decisions based on false information. section 10.1.1

Figure 4.7 An example of a bad output produced by ChatGPT to generate code
figure

Inspect a concrete bad code output to see why plausible syntax still requires verification against the actual library. section 4.1.5

How Data Storytelling with Altair and AI covers it

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 it assumes
Assumes no technical AI foundation and introduces LLM behavior only as statistical text generation.
What you can do after
Evaluate/understand generated content by recognizing plausible unsupported output and reviewing it before use.
How it connects
Connects hallucination with generative AI, large language models, bias, copyright, temperature, prompting, and human-in-the-loop validation.

Also explained in

Compare how 29 books explain hallucination →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Storytelling with Altair and AI. The section links point to the parts of the book it draws on.