<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/tech-in-five---why-does-ai-hallucinate--dnofwckkg" -->

---
title: Tech in Five - Why does AI Hallucinate? | daily.dev
description: An explanation of why generative AI models hallucinate, demonstrated through a token-by-token generation experiment. Changing the context around an identical...
canonical: https://daily.dev/posts/tech-in-five---why-does-ai-hallucinate--dnofwckkg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Tech in Five - Why does AI Hallucinate? | daily.dev
og:description: An explanation of why generative AI models hallucinate, demonstrated through a token-by-token generation experiment. Changing the context around an identical...
og:url: https://daily.dev/posts/tech-in-five---why-does-ai-hallucinate--dnofwckkg
og:image: https://api.daily.dev/og/posts/DNoFwCkkG.png
og:image:alt: Tech in Five - Why does AI Hallucinate?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Tech in Five - Why does AI Hallucinate?

**[John Savill's Technical Training](https://daily.dev/sources/john-savill)** · 5 min read · 2 upvotes · 0 comments

## Summary

An explanation of why generative AI models hallucinate, demonstrated through a token-by-token generation experiment. Changing the context around an identical prompt shifts the probability of the next predicted token, showing that models generate plausible continuations rather than retrieving verified facts. Hallucination is framed as a natural consequence of next-token prediction rather than a bug, and the fix is presented as a system design problem: grounding models with retrieval (RAG), constraining sources, allowing 'I don't know' responses, and verifying outputs via citations, groundedness evaluations, and reviewer-agent patterns.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=KJzAfLRf8oc>

## Questions this post answers

### Why does an AI language model hallucinate false information instead of just saying it doesn't know?

Hallucination happens because a language model has no built-in database of verified facts to look up; it only predicts a plausible next token based on patterns learned during training and the context it has been given. When context shifts, or when a topic is rare, recent, or underrepresented in training data, the model may generate a fluent, plausible-sounding continuation that is actually false, unless it has been specifically trained or instructed to express uncertainty.

_Teams shipping AI features can follow ongoing coverage of grounding and verification techniques on daily.dev to keep hallucinations in check._

### How can I reduce hallucinations in an AI assistant or agent I'm building?

Reducing hallucinations is a system design problem, not just a matter of picking a smarter model. Ground the model in authoritative information using retrieval-augmented generation, constrain it to specific approved sources and let it say 'I don't know' when evidence is missing, and verify outputs with citations, groundedness evaluations, deterministic checks, or a reviewer pattern where one agent checks another's answer.

_Developers weighing grounding, constraints, and verification strategies for AI agents can track these design patterns on daily.dev._

## Similar posts on daily.dev

- [What are AI Hallucinations?](https://daily.dev/posts/what-are-ai-hallucinations--czh7btwi4) · databricks · 3 upvotes · 0 comments
- [AI Crash Course: Hallucinations](https://daily.dev/posts/ai-crash-course-hallucinations-rkbdydbi8) · Telerik · 1 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#ai-agents](https://daily.dev/tags/ai-agents), [#rag](https://daily.dev/tags/rag)

[View this post on daily.dev](https://daily.dev/posts/tech-in-five---why-does-ai-hallucinate--dnofwckkg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Tech in Five - Why does AI Hallucinate?","url":"https://daily.dev/posts/tech-in-five---why-does-ai-hallucinate--dnofwckkg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/tech-in-five---why-does-ai-hallucinate--dnofwckkg"},"datePublished":"2026-09-02T10:55:58.460Z","dateModified":"2026-09-14T08:35:25.960Z","description":"An explanation of why generative AI models hallucinate, demonstrated through a token-by-token generation experiment. Changing the context around an identical...","image":"https://i.ytimg.com/vi/KJzAfLRf8oc/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/KJzAfLRf8oc/sddefault.jpg","isAccessibleForFree":true,"articleSection":"John Savill's Technical Training","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"John Savill's Technical Training","logo":"https://media.daily.dev/image/upload/s--4rApg0fT--/f_auto,q_auto/v1780213220/logos/john-savill?_a=BAMAMiWQ0","url":"https://daily.dev/sources/john-savill"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/tech-in-five---why-does-ai-hallucinate--dnofwckkg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,ai-agents,rag","timeRequired":"PT5M","video":{"@type":"VideoObject","name":"Tech in Five - Why does AI Hallucinate?","description":"An explanation of why generative AI models hallucinate, demonstrated through a token-by-token generation experiment. Changing the context around an identical...","thumbnailUrl":"https://i.ytimg.com/vi/KJzAfLRf8oc/sddefault.jpg","uploadDate":"2026-09-02T10:55:58.460Z","duration":"PT5M","url":"https://api.daily.dev/r/DNoFwCkkG","embedUrl":"https://www.youtube.com/embed/KJzAfLRf8oc"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"John Savill's Technical Training","item":"https://daily.dev/sources/john-savill"},{"@type":"ListItem","position":3,"name":"Tech in Five - Why does AI Hallucinate?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/tech-in-five---why-does-ai-hallucinate--dnofwckkg#faq","mainEntity":[{"@type":"Question","name":"Why does an AI language model hallucinate false information instead of just saying it doesn't know?","acceptedAnswer":{"@type":"Answer","text":"Hallucination happens because a language model has no built-in database of verified facts to look up; it only predicts a plausible next token based on patterns learned during training and the context it has been given. When context shifts, or when a topic is rare, recent, or underrepresented in training data, the model may generate a fluent, plausible-sounding continuation that is actually false, unless it has been specifically trained or instructed to express uncertainty. Teams shipping AI features can follow ongoing coverage of grounding and verification techniques on daily.dev to keep hallucinations in check."}},{"@type":"Question","name":"How can I reduce hallucinations in an AI assistant or agent I'm building?","acceptedAnswer":{"@type":"Answer","text":"Reducing hallucinations is a system design problem, not just a matter of picking a smarter model. Ground the model in authoritative information using retrieval-augmented generation, constrain it to specific approved sources and let it say 'I don't know' when evidence is missing, and verify outputs with citations, groundedness evaluations, deterministic checks, or a reviewer pattern where one agent checks another's answer. Developers weighing grounding, constraints, and verification strategies for AI agents can track these design patterns on daily.dev."}}]}
```

