<!-- 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 do large language models hallucinate incorrect information?

Hallucination happens because generative models predict the most plausible next token based on learned patterns, not by looking up verified facts in a database. Changing surrounding context can shift token probabilities dramatically even without new factual input, so for rare topics or facts underrepresented in training, the model may generate a fluent but false continuation instead of saying it does not know.

_Developers debugging unreliable model outputs can follow grounding and verification techniques discussed on daily.dev._

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

Reduce hallucinations through system design rather than model choice alone: ground the model with authoritative data using retrieval-augmented generation, constrain it to specific sources while allowing it to say 'I don't know,' and verify outputs with citations, groundedness evaluations, deterministic checks, or a reviewer agent that peer-reviews another agent's answer.

_Teams designing trustworthy AI systems can track grounding and verification patterns like these 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-02T10:56:19.795Z","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 do large language models hallucinate incorrect information?","acceptedAnswer":{"@type":"Answer","text":"Hallucination happens because generative models predict the most plausible next token based on learned patterns, not by looking up verified facts in a database. Changing surrounding context can shift token probabilities dramatically even without new factual input, so for rare topics or facts underrepresented in training, the model may generate a fluent but false continuation instead of saying it does not know. Developers debugging unreliable model outputs can follow grounding and verification techniques discussed on daily.dev."}},{"@type":"Question","name":"How can I reduce hallucinations in an AI agent or assistant?","acceptedAnswer":{"@type":"Answer","text":"Reduce hallucinations through system design rather than model choice alone: ground the model with authoritative data using retrieval-augmented generation, constrain it to specific sources while allowing it to say 'I don't know,' and verify outputs with citations, groundedness evaluations, deterministic checks, or a reviewer agent that peer-reviews another agent's answer. Teams designing trustworthy AI systems can track grounding and verification patterns like these on daily.dev."}}]}
```

