 {"id":522416,"date":"2023-11-25T09:13:00","date_gmt":"2023-11-25T16:13:00","guid":{"rendered":"https:\/\/jorgep.com\/blog\/?p=522416"},"modified":"2026-10-23T10:08:43","modified_gmt":"2026-10-23T17:08:43","slug":"when-ai-dreams-up-facts-understanding-ai-hallucinations","status":"publish","type":"post","link":"https:\/\/jorgep.com\/blog\/when-ai-dreams-up-facts-understanding-ai-hallucinations\/","title":{"rendered":"When AI Dreams Up Facts: Understanding AI Hallucinations"},"content":{"rendered":"\n<div class=\"wp-block-columns has-theme-palette-7-background-color has-background is-layout-flex wp-container-core-columns-is-layout-5dc627e1 wp-block-columns-is-layout-flex\" style=\"margin-top:0;margin-bottom:0\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:80%\"><style>.kb-row-layout-id395113_8e8b6a-7f > .kt-row-column-wrap{align-content:start;}:where(.kb-row-layout-id395113_8e8b6a-7f > .kt-row-column-wrap) > .wp-block-kadence-column{justify-content:start;}.kb-row-layout-id395113_8e8b6a-7f > .kt-row-column-wrap{column-gap:var(--global-kb-gap-md, 2rem);row-gap:var(--global-kb-gap-md, 2rem);padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);grid-template-columns:minmax(0, 1fr) minmax(0, 2fr);}.kb-row-layout-id395113_8e8b6a-7f > .kt-row-layout-overlay{opacity:0.30;}@media all and (max-width: 1024px){.kb-row-layout-id395113_8e8b6a-7f > .kt-row-column-wrap{grid-template-columns:minmax(0, 1fr) minmax(0, 2fr);}}@media all and (max-width: 767px){.kb-row-layout-id395113_8e8b6a-7f > .kt-row-column-wrap{grid-template-columns:minmax(0, 1fr);}}<\/style><div class=\"kb-row-layout-wrap kb-row-layout-id395113_8e8b6a-7f alignnone wp-block-kadence-rowlayout\"><div class=\"kt-row-column-wrap kt-has-2-columns kt-row-layout-right-golden kt-tab-layout-inherit kt-mobile-layout-row kt-row-valign-top\">\n<style>.kadence-column395113_0e0821-40 > .kt-inside-inner-col{display:flex;}.kadence-column395113_0e0821-40 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column395113_0e0821-40 > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}.kadence-column395113_0e0821-40 > .kt-inside-inner-col > .aligncenter{width:100%;}.kt-row-column-wrap > .kadence-column395113_0e0821-40{align-self:flex-start;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_0e0821-40{align-self:auto;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_0e0821-40 > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}.kadence-column395113_0e0821-40 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column395113_0e0821-40{position:relative;}@media all and (max-width: 1024px){.kt-row-column-wrap > .kadence-column395113_0e0821-40{align-self:flex-start;}}@media all and (max-width: 1024px){.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_0e0821-40{align-self:auto;}}@media all and (max-width: 1024px){.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_0e0821-40 > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}}@media all and (max-width: 1024px){.kadence-column395113_0e0821-40 > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}}@media all and (max-width: 767px){.kt-row-column-wrap > .kadence-column395113_0e0821-40{align-self:flex-start;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_0e0821-40{align-self:auto;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_0e0821-40 > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}.kadence-column395113_0e0821-40 > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column395113_0e0821-40\"><div class=\"kt-inside-inner-col\">\n<p class=\"wp-block-paragraph\">Part of: <strong> <a href=\"https:\/\/jorgep.com\/blog\/series-ai-learnings\/\">AI Learning Series Here<\/a><\/strong><\/p>\n<\/div><\/div>\n\n\n<style>.kadence-column395113_be7678-6e > .kt-inside-inner-col{display:flex;}.kadence-column395113_be7678-6e > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column395113_be7678-6e > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}.kadence-column395113_be7678-6e > .kt-inside-inner-col > .aligncenter{width:100%;}.kt-row-column-wrap > .kadence-column395113_be7678-6e{align-self:flex-start;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_be7678-6e{align-self:auto;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_be7678-6e > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}.kadence-column395113_be7678-6e > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column395113_be7678-6e{position:relative;}@media all and (max-width: 1024px){.kt-row-column-wrap > .kadence-column395113_be7678-6e{align-self:flex-start;}}@media all and (max-width: 1024px){.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_be7678-6e{align-self:auto;}}@media all and (max-width: 1024px){.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_be7678-6e > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}}@media all and (max-width: 1024px){.kadence-column395113_be7678-6e > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}}@media all and (max-width: 767px){.kt-row-column-wrap > .kadence-column395113_be7678-6e{align-self:flex-start;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_be7678-6e{align-self:auto;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column395113_be7678-6e > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}.kadence-column395113_be7678-6e > .kt-inside-inner-col{flex-direction:column;justify-content:flex-start;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column395113_be7678-6e\"><div class=\"kt-inside-inner-col\"><style>.kadence-column510545_d73d55-65 > .kt-inside-inner-col{padding-top:var(--global-kb-spacing-xs, 1rem);padding-bottom:var(--global-kb-spacing-xs, 1rem);}.kadence-column510545_d73d55-65 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column510545_d73d55-65 > .kt-inside-inner-col{flex-direction:column;}.kadence-column510545_d73d55-65 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column510545_d73d55-65 > .kt-inside-inner-col{background-color:var(--global-palette7, #EDF2F7);}.kadence-column510545_d73d55-65:hover > .kt-inside-inner-col{background-color:var(--global-palette8, #F7FAFC);background-image:none;}.kadence-column510545_d73d55-65 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column510545_d73d55-65{position:relative;}@media all and (max-width: 1024px){.kadence-column510545_d73d55-65 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column510545_d73d55-65 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column510545_d73d55-65\"><div class=\"kt-inside-inner-col\"><style>.wp-block-kadence-advancedheading.kt-adv-heading510545_4f04b8-a3, .wp-block-kadence-advancedheading.kt-adv-heading510545_4f04b8-a3[data-kb-block=\"kb-adv-heading510545_4f04b8-a3\"]{text-align:center;font-size:var(--global-kb-font-size-sm, 0.9rem);font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading510545_4f04b8-a3 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading510545_4f04b8-a3[data-kb-block=\"kb-adv-heading510545_4f04b8-a3\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading510545_4f04b8-a3 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading510545_4f04b8-a3[data-kb-block=\"kb-adv-heading510545_4f04b8-a3\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<p class=\"kt-adv-heading510545_4f04b8-a3 wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading510545_4f04b8-a3\">Quick Links:\u00a0<a href=\"https:\/\/jorgep.com\/blog\/resources-for-learning-ai\/\">Resources for Learning AI<\/a> | <a href=\"https:\/\/jorgep.com\/blog\/keeping-up-with-ai\/\">Keep up with AI<\/a> | <a href=\"https:\/\/jorgep.com\/blog\/list-of-ai-tools\/\" data-type=\"post\" data-id=\"402818\">List of AI Tools<\/a> | <a href=\"https:\/\/jorgep.com\/blog\/local-ai-series\/\" data-type=\"page\" data-id=\"519365\">Local AI<\/a> | <a href=\"https:\/\/jorgep.com\/blog\/tag\/ai-agents\/\" data-type=\"post_tag\" data-id=\"941\">AI Agents<\/a> |  <a href=\"https:\/\/jorgep.com\/blog\/work-beyond-tomorrow-series\/\" data-type=\"page\" data-id=\"365001\">Future of Work<\/a> | <a href=\"https:\/\/jorgep.com\/blog\/latest-token-prices\/\" data-type=\"page\" data-id=\"521255\">Latest Token Prices<\/a><\/p>\n<\/div><\/div>\n\n\n<style>.kadence-column395113_ef932c-45 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column395113_ef932c-45 > .kt-inside-inner-col{flex-direction:column;}.kadence-column395113_ef932c-45 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column395113_ef932c-45 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column395113_ef932c-45{position:relative;}@media all and (max-width: 1024px){.kadence-column395113_ef932c-45 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column395113_ef932c-45 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column395113_ef932c-45\"><div class=\"kt-inside-inner-col\"><style>.wp-block-kadence-advancedheading.kt-adv-heading395113_4a53da-59, .wp-block-kadence-advancedheading.kt-adv-heading395113_4a53da-59[data-kb-block=\"kb-adv-heading395113_4a53da-59\"]{text-align:center;font-size:var(--global-kb-font-size-sm, 0.9rem);font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading395113_4a53da-59 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading395113_4a53da-59[data-kb-block=\"kb-adv-heading395113_4a53da-59\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading395113_4a53da-59 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading395113_4a53da-59[data-kb-block=\"kb-adv-heading395113_4a53da-59\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<p class=\"kt-adv-heading395113_4a53da-59 wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading395113_4a53da-59\"><\/p>\n<\/div><\/div>\n<\/div><\/div>\n\n<\/div><\/div>\n\n<style>.kadence-column395113_9b59ba-8b > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column395113_9b59ba-8b > .kt-inside-inner-col{flex-direction:column;}.kadence-column395113_9b59ba-8b > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column395113_9b59ba-8b > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column395113_9b59ba-8b{position:relative;}@media all and (max-width: 1024px){.kadence-column395113_9b59ba-8b > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column395113_9b59ba-8b > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column395113_9b59ba-8b\"><div class=\"kt-inside-inner-col\"><\/div><\/div>\n\n\n<style>.kb-row-layout-id395113_48c9f9-e5 > .kt-row-column-wrap{align-content:start;}:where(.kb-row-layout-id395113_48c9f9-e5 > .kt-row-column-wrap) > .wp-block-kadence-column{justify-content:start;}.kb-row-layout-id395113_48c9f9-e5 > .kt-row-column-wrap{column-gap:var(--global-kb-gap-md, 2rem);row-gap:var(--global-kb-gap-none, 0rem );padding-top:var(--global-kb-spacing-xxs, 0.5rem);padding-bottom:var(--global-kb-spacing-xxs, 0.5rem);grid-template-columns:repeat(2, minmax(0, 1fr));}.kb-row-layout-id395113_48c9f9-e5 > .kt-row-layout-overlay{opacity:0.30;}@media all and (max-width: 1024px){.kb-row-layout-id395113_48c9f9-e5 > .kt-row-column-wrap{grid-template-columns:repeat(2, minmax(0, 1fr));}}@media all and (max-width: 767px){.kb-row-layout-id395113_48c9f9-e5 > .kt-row-column-wrap{grid-template-columns:minmax(0, 1fr);}}<\/style><div class=\"kb-row-layout-wrap kb-row-layout-id395113_48c9f9-e5 alignnone wp-block-kadence-rowlayout\"><div class=\"kt-row-column-wrap kt-has-2-columns kt-row-layout-equal kt-tab-layout-inherit kt-mobile-layout-row kt-row-valign-top\">\n<style>.kadence-column395113_fd93ac-3a > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column395113_fd93ac-3a > .kt-inside-inner-col{flex-direction:column;}.kadence-column395113_fd93ac-3a > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column395113_fd93ac-3a > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column395113_fd93ac-3a{position:relative;}@media all and (max-width: 1024px){.kadence-column395113_fd93ac-3a > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column395113_fd93ac-3a > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column395113_fd93ac-3a\"><div class=\"kt-inside-inner-col\"><\/div><\/div>\n\n\n<style>.kadence-column395113_346775-3e > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column395113_346775-3e > .kt-inside-inner-col{flex-direction:column;}.kadence-column395113_346775-3e > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column395113_346775-3e > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column395113_346775-3e{position:relative;}@media all and (max-width: 1024px){.kadence-column395113_346775-3e > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column395113_346775-3e > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column395113_346775-3e\"><div class=\"kt-inside-inner-col\"><\/div><\/div>\n\n<\/div><\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-top is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/jorgep.com\/blog\/book-series-ai-dont-just-chat\/\"><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"1024\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/BookCover-791x1024.jpg\" alt=\"\" class=\"wp-image-522269\" style=\"aspect-ratio:0.6250142320391666;width:80px;height:auto\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/BookCover-791x1024.jpg 791w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/BookCover-232x300.jpg 232w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/BookCover-768x994.jpg 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/BookCover.jpg 1102w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/a><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading519190_af62a4-66, .wp-block-kadence-advancedheading.kt-adv-heading519190_af62a4-66[data-kb-block=\"kb-adv-heading519190_af62a4-66\"]{font-size:var(--global-kb-font-size-sm, 0.9rem);font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading519190_af62a4-66 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading519190_af62a4-66[data-kb-block=\"kb-adv-heading519190_af62a4-66\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading519190_af62a4-66 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading519190_af62a4-66[data-kb-block=\"kb-adv-heading519190_af62a4-66\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<p class=\"kt-adv-heading519190_af62a4-66 wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading519190_af62a4-66\"><strong>Disclaimer:<\/strong> <strong>I create this content entirely on my own time, and the views expressed here are mine alone (not my employer&#8217;s)<\/strong>. Because I love leveraging new tech, I use AI tools like Gemini, ChatGPT, Claude, Perplexity and others as a &#8220;digital team&#8221; to help research and polish these articles so I can share the best possible insights with you!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019ve spent any time interacting with modern artificial intelligence\u2014chatbots, writing assistants, or search tools\u2014you might have noticed an unsettling quirk: sometimes, the AI makes things up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not just minor slips, either. A model might invent a completely fabricated historical event, quote a legal case that never occurred, or cite a scientific study written by real researchers who never actually published it. Even more startling is the tone: the AI states these falsehoods with calm, unwavering confidence.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the tech world, this phenomenon is called <strong>hallucination<\/strong>. But what does that really mean, and why does a piece of software do it in the first place?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Part 1: The Non-Technical Explanation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">The Confident Storyteller<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To understand a hallucination, imagine you are playing an improvisational storytelling game with a very articulate friend. The rules are simple:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Every time you ask a question, they must continue the conversation without pausing.<\/li>\n\n\n\n<li>They cannot look up facts in an encyclopedia or browse a database.<\/li>\n\n\n\n<li>They must produce something that <em>sounds<\/em> convincing, grammatically elegant, and appropriate for the context.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Your friend has read millions of books, articles, and websites. They know the rhythm of academic writing, the formal cadence of legal filings, and the narrative flow of a history text.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you ask them, <em>&#8220;What year was the Treaty of Saltford signed?&#8221;<\/em>\u2014even though no such treaty exists\u2014their brain doesn&#8217;t stop and say, <em>&#8220;Wait, that doesn&#8217;t exist.&#8221;<\/em> Instead, because their job is to keep the narrative moving, they assemble words that <em>feel<\/em> historically plausible:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>&#8220;The Treaty of Saltford was signed in 1784 between British colonial authorities and regional merchants to regulate river navigation.&#8221;<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">It reads smoothly. The vocabulary fits. The date sounds roughly right for that style of treaty. But every single piece of information was conjured out of thin air.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Plausibility vs. Truth<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A standard computer program works like a calculator: if you enter <code>2 + 2<\/code>, it accesses strict arithmetic logic to return <code>4<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generative AI does not operate like a calculator. It operates more like an extraordinarily sophisticated version of <strong>auto-complete<\/strong> on your smartphone. When you start typing a text message and the phone suggests the next word, it isn&#8217;t &#8220;thinking&#8221; about what you want to say; it is predicting what word typically follows the previous ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generative AI does this on an enormous scale. It doesn&#8217;t possess a mental model of truth or a live connection to reality. Its primary objective is <strong>coherence and plausibility<\/strong>, not factual verification. When coherence and factual accuracy diverge, hallucination is the result.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Part 2: The Technical Roots of Hallucinations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To understand why this happens under the hood, we have to look at the mathematical architecture of <strong>Large Language Models (LLMs)<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Probabilistic Text Generation (Next-Token Prediction)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">At its core, an LLM is a probabilistic engine. Text is broken down into chunks called <strong>tokens<\/strong> (roughly parts of words or characters).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you provide a prompt, the model converts those tokens into numerical representations (vectors) in a high-dimensional space. It then calculates a probability distribution across its entire vocabulary for what the very next token should be:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"635\" height=\"86\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-198.png\" alt=\"\" class=\"wp-image-522417\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-198.png 635w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-198-300x41.png 300w\" sizes=\"auto, (max-width: 635px) 100vw, 635px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The model selects a token based on these probabilities, appends it to the sequence, and repeats the process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because the model is optimizing for the <strong>most statistically probable sequence of tokens<\/strong>, it creates sequences that match the structural patterns of human language. If a false statement happens to have a higher statistical weight or matches a common syntactic pattern in the model&#8217;s weights, the model will generate the falsehood without any internal mechanism alerting it that the statement is factually incorrect.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Lossy Compression in Model Weights<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">During training, an LLM processes petabytes of text data. However, the resulting model file is only a fraction of that size (often tens or hundreds of gigabytes).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The training process does not copy and paste the training data into an internal library. Instead, the model acts as a <strong>lossy compression algorithm<\/strong>. It adjusts billions (or trillions) of internal parameters (weights) to capture statistical relationships, grammar, associations, and abstract concepts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because the data is compressed into statistical associations rather than discrete records:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Specific, high-frequency facts (e.g., <em>&#8220;Paris is the capital of France&#8221;<\/em>) are reinforced across countless examples and encoded strongly.<\/li>\n\n\n\n<li>Rare, nuanced, or low-frequency facts (e.g., specific dates, middle names, legal citations, niche academic papers) are fuzzy in the parameter space.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">When the model is prompted about a low-frequency fact, the latent associations are too weak to reconstruct the exact data, so the model fills in the gaps with the surrounding statistical average\u2014generating an entity that sounds real, but isn&#8217;t.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. The Objective Function Mismatch<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">LLMs are trained using <strong>Maximum Likelihood Estimation (MLE)<\/strong>. The mathematical objective during pre-training is:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>Minimize the difference between the model\u2019s predicted probability distribution and the actual token distribution in the training corpus.<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Notice what is absent from that objective: <strong>there is no mathematical penalty for being &#8220;factually untrue&#8221; versus &#8220;grammatically sound.&#8221;<\/strong> A sentence that is factually false but stylistically indistinguishable from the training corpus scores almost as well during loss calculation as a factually true one.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Reinforcement Learning Alignment Nuances<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Modern models undergo post-training via <strong>Reinforcement Learning from Human Feedback (RLHF)<\/strong> or similar alignment methods (like DPO). Human evaluators rate responses to guide the model toward being helpful, polite, and detailed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, human evaluators are naturally biased toward answers that look well-organized, comprehensive, and articulate. If a model generates a thorough, beautifully formatted response containing a subtle falsehood alongside real facts, human raters frequently score it higher than a terse response or one that admits uncertainty. The model&#8217;s weights are therefore tuned to favor stylistic completeness, reinforcing the tendency to invent details rather than break character.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Takeaway<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An AI hallucination is not a system crash, a bug in the code, or a sign that the software has developed an imagination.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From a non-technical perspective, it is a creative storyteller answering questions it was never built to verify. From a technical perspective, it is the natural mathematical consequence of a system designed to calculate probability distributions over text rather than verify truth against an external ground reality.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve spent any time interacting with modern artificial intelligence\u2014chatbots, writing assistants, or search tools\u2014you might have noticed an unsettling quirk: sometimes, the AI makes things up. Not just minor slips, either. A model might invent a completely fabricated historical event, quote a legal case that never occurred, or cite a scientific study written by&#8230;<\/p>\n","protected":false},"author":2,"featured_media":395044,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","ngg_post_thumbnail":0,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[1068,441],"tags":[930,894,1093],"class_list":["post-522416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-emerging-technology","category-tech-talk","tag-ai-series","tag-artificial-intelligence","tag-hallucination"],"taxonomy_info":{"category":[{"value":1068,"label":"AI &amp; Emerging Technology"},{"value":441,"label":"Tech Talk"}],"post_tag":[{"value":930,"label":"AI Series"},{"value":894,"label":"artificial intelligence"},{"value":1093,"label":"hallucination"}]},"featured_image_src_large":["https:\/\/jorgep.com\/blog\/wp-content\/uploads\/2023\/05\/image-6.png",780,330,false],"author_info":{"display_name":"Jorge Pereira","author_link":"https:\/\/jorgep.com\/blog\/author\/jorge\/"},"comment_info":0,"category_info":[{"term_id":1068,"name":"AI &amp; Emerging Technology","slug":"ai-emerging-technology","term_group":0,"term_taxonomy_id":1078,"taxonomy":"category","description":"","parent":0,"count":236,"filter":"raw","cat_ID":1068,"category_count":236,"category_description":"","cat_name":"AI &amp; Emerging Technology","category_nicename":"ai-emerging-technology","category_parent":0},{"term_id":441,"name":"Tech Talk","slug":"tech-talk","term_group":0,"term_taxonomy_id":451,"taxonomy":"category","description":"","parent":0,"count":761,"filter":"raw","cat_ID":441,"category_count":761,"category_description":"","cat_name":"Tech Talk","category_nicename":"tech-talk","category_parent":0}],"tag_info":[{"term_id":930,"name":"AI Series","slug":"ai-series","term_group":0,"term_taxonomy_id":940,"taxonomy":"post_tag","description":"","parent":0,"count":258,"filter":"raw"},{"term_id":894,"name":"artificial intelligence","slug":"artificial-intelligence","term_group":0,"term_taxonomy_id":904,"taxonomy":"post_tag","description":"","parent":0,"count":222,"filter":"raw"},{"term_id":1093,"name":"hallucination","slug":"hallucination","term_group":0,"term_taxonomy_id":1103,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/posts\/522416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/comments?post=522416"}],"version-history":[{"count":1,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/posts\/522416\/revisions"}],"predecessor-version":[{"id":522418,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/posts\/522416\/revisions\/522418"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/media\/395044"}],"wp:attachment":[{"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/media?parent=522416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/categories?post=522416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/tags?post=522416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}