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
Inspect a concrete bad code output to see why plausible syntax still requires verification against the actual library. section 4.1.5




























