The probability transport chapter moved samples from noise to data along a velocity field. Each sample followed a smooth path, and the flow matching section learned that field from samples.Flow matching designs the motion explicitly. It picks an interpolation between noise and data, which fixes both the path of densities and the velocity field along it, and then learns that field by regression. This chapter asks a different question. Can you get a useful probability path without first designing a velocity field?Diffusion models get one from random paths. A fixed forward process adds a little Gaussian noise at each step, so every data point drifts toward noise. The model learns to reverse that process. Time runs the other way from the transport chapter: data sits at t=0 and noise at t=T.The two views meet in the probability flow ODE, introduced in the Fokker-Planck section. The score-based section samples with it once the score is learned. It gives a velocity field that moves the density along the same path as the noisy process.The chapter builds the random process before it trains anything. The Brownian motion section introduces random walks and drift toward the origin. The Fokker-Planck section follows the density of those walks and finds a deterministic flow with the same densities, and the gradient flow section reads that evolution as steepest descent of a free energy. The score-based section then learns the missing score from samples, and the score mixture example repeats the method in two dimensions. The chapter ends with the discrete-time models: the DDPM section, its mixture example, and the DDIM example, which samples deterministically from the same trained model.For a companion text, read the elementary tutorial that derives diffusion models and flow matching from first principles (Nakkiran et al., 2024).
References
Nakkiran, P., Bradley, A., Zhou, H., Advani, M. (2024). Step-by-step diffusion: An elementary tutorial. arXiv [cs.LG]. Link
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"aegean.ai","description":"Engineering AI Agents - Comprehensive courses on deep learning, computer vision, robotics, and AI systems","colors":{"primary":"#2196C8","light":"#5CADD8","dark":"#1565B0"},"logo":{"light":"https://mintcdn.com/aegeanaiinc/ai8d4zdsUnwq_5J6/logo.png?fit=max\u0026auto=format\u0026n=ai8d4zdsUnwq_5J6\u0026q=85\u0026s=fe5e281c1569f8468ff85157bd7d9dc3","dark":"https://mintcdn.com/aegeanaiinc/ai8d4zdsUnwq_5J6/logo-dark.png?fit=max\u0026auto=format\u0026n=ai8d4zdsUnwq_5J6\u0026q=85\u0026s=6a455ae676293280c72ec43f2ac544b4","href":"/"},"favicon":"https://mintcdn.com/aegeanaiinc/0dr6ajwzGFHGACv0/favicon.png?fit=max\u0026auto=format\u0026n=0dr6ajwzGFHGACv0\u0026q=85\u0026s=c0348644679947ce971abb8037adb632","appearance":{"default":"system","strict":false},"navbar":{"links":[{"href":"https://github.com/aegean-ai","label":"GitHub"},{"href":"https://www.linkedin.com/company/aegean-ai/","label":"LinkedIn"}]},"footer":{"socials":{"github":"https://github.com/aegean-ai","linkedin":"https://www.linkedin.com/company/aegean-ai","x":"https://x.com/aegeanai"},"links":[{"header":"Products","items":[{"label":"Auraison","href":"https://n8n.aegeanai.com"}]},{"header":"Courses","items":[{"label":"AI Foundations","href":"/courses/ai/index"},{"label":"Computer Vision","href":"/courses/cv/index"},{"label":"Robotics","href":"/courses/robotics/index"}]},{"header":"Resources","items":[{"label":"Use These Docs","href":"/use-these-docs"},{"label":"GitHub","href":"https://github.com/aegean-ai"},{"label":"Blog","href":"/blog"},{"label":"RSS Feed","href":"/rss.xml"}]},{"header":"Company","items":[{"label":"About","href":"/about"},{"label":"Careers","href":"/careers/virtual-internships/index"},{"label":"Contact","href":"https://forms.gle/W3z4NTC883mNY5Kr8"},{"label":"Privacy Policy","href":"/privacy"}]}]},"styling":{"eyebrows":"section","latex":true},"integrations":{"ga4":{"measurementId":"G-EHRC22H65X"},"posthog":{"apiKey":"phc_J5w6esvspb1vh8O3MegWoaUYiq1zzWYuv7GTfjgui6F","sessionRecording":true}},"contextual":{"options":["claude","perplexity","mcp","cursor","vscode",{"title":"Report an issue","description":"Tell us about an error on this page","icon":"bug","href":{"base":"https://github.com/aegean-ai/eaia-feedback/issues/new","query":[{"key":"template","value":"page-issue.yml"},{"key":"page","value":"$path"}]}}],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"aegeanaiinc","hasAudioNarration":false,"actualSubdomain":"aegeanaiinc","customDomains":["aegean.ai"],"gitSource":{"type":"github","owner":"aegean-ai","repo":"eaia","deployBranch":"prod","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"agentFeedback":true},"entitlements":{},"buildId":"6b0f1f74933dd638a36d00d4","clientVersion":"0.0.4389","searchFilterCounts":[{"language":"default","tag":"Book","count":307},{"language":"default","tag":"Perception","count":68},{"language":"default","tag":"Courses","count":60},{"language":"default","tag":"Products","count":51},{"language":"default","tag":"Applications","count":39},{"language":"default","tag":"Foundations","count":28},{"language":"default","tag":"Manufacturing QC","count":27},{"language":"default","tag":"Latent Transport Models","count":24},{"language":"default","tag":"Embodied Agent Motion","count":24},{"language":"default","tag":"RL","count":24}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"header,nav,[class*=\"navbar\"],[class*=\"Navbar\"],[class*=\"header\"],[class*=\"Header\"]{padding-top:1.5rem!important;padding-bottom:1.5rem!important}header img[alt*=\"logo\"i],header img[src*=\"logo\"i],nav img[alt*=\"logo\"i],nav img[src*=\"logo\"i],[class*=\"logo\"] img,[class*=\"Logo\"] img,[class*=\"brand\"] img,[class*=\"Brand\"] img,a[href=\"/\"]>img,a[href=\"/\"] img:first-child{height:40px!important;max-height:40px!important;width:auto!important}header [class*=\"logo\"] span,header [class*=\"Logo\"] span,header [class*=\"brand\"] span,nav [class*=\"logo\"] span,nav [class*=\"Logo\"] span,a[href=\"/\"]>span,#navbar #sidebar-title,header #sidebar-title,[class*=\"siteName\"],[class*=\"site-name\"],[class*=\"SiteName\"]{font-size:1.35rem!important;font-weight:600!important}a code,a[href] code{color:inherit!important;text-decoration:none!important;padding:0!important}.callout a,[class*=\"callout\"] a{font-size:inherit!important;color:inherit!important}.callout ul,.callout ol,.callout li,[class*=\"callout\"] ul,[class*=\"callout\"] ol,[class*=\"callout\"] li{font-size:inherit!important;color:inherit!important;line-height:inherit!important}.callout p,[class*=\"callout\"] p{font-size:inherit!important;color:inherit!important}.callout strong,.callout b,.callout em,.callout i,[class*=\"callout\"] strong,[class*=\"callout\"] b,[class*=\"callout\"] em,[class*=\"callout\"] i{font-size:inherit!important;color:inherit!important}.mermaid{text-align:center;display:flex;justify-content:center}.mermaid .labelBkg{background-color:white!important;border:1px solid #2F6868!important;border-radius:4px!important;padding:0 4px!important}.mermaid .labelBkg:not(:has(p)){display:none!important}.mermaid .edgeLabel{color:#1C3C3C!important}.dark .mermaid .labelBkg{background-color:#1C3C3C!important;border-color:#84C4C0!important}.dark .mermaid .edgeLabel{color:#84C4C0!important}.mermaid .node rect,.mermaid .node polygon,.mermaid .node circle{fill:none!important;stroke:#9ca3af!important;stroke-width:2px!important;rx:12px;ry:12px;transition:stroke 0.2s ease, filter 0.2s ease, stroke-width 0.2s ease}.mermaid .node .nodeLabel{font-family:inherit!important}.mermaid .node .nodeLabel p{color:#fff!important;font-family:inherit!important}.mermaid a:hover .node rect,.mermaid a:hover .node polygon,.mermaid a:hover .node circle,.mermaid .node:hover rect,.mermaid .node:hover polygon,.mermaid .node:hover circle{stroke:#2196C8!important;stroke-width:3px!important;filter:drop-shadow(0 0 8px rgba(33, 150, 200, 0.5));cursor:pointer}.mermaid .cluster rect{rx:12px!important;ry:12px!important}.prose table td,article table td,.markdown table td,.content table td,[class*=\"prose\"] table td,.prose table th,article table th,.markdown table th,.content table th,[class*=\"prose\"] table th{vertical-align:middle!important;line-height:1.5!important}#pagination{display:none}#banner a{color:inherit!important;text-decoration:none!important}.compact-first-col [data-table-wrapper]{overflow-x:visible!important}.compact-first-col table{table-layout:auto!important;width:100%!important}.compact-first-col table td,.compact-first-col table th{min-width:0!important}.compact-first-col table td:first-child,.compact-first-col table th:first-child{width:1%!important;white-space:nowrap!important}.home-page~:is(.callout,[data-callout-type]){display:none!important}.sidebar-group-header,#sidebar-content .sidebar-group-header,#sidebar .sidebar-group-header,[class*=\"sidebar-group-header\"],[class*=\"SidebarGroupHeader\"],[class^=\"sidebar_group\"]>button,[class^=\"sidebar_group\"]>div:first-child,#sidebar button[class*=\"group\"],#sidebar-content button,aside button{font-size:14px!important;font-weight:400!important;letter-spacing:normal!important;line-height:1.4!important;padding-top:0.5rem!important;padding-bottom:0.25rem!important;margin:0!important;text-transform:none!important}.sidebar-group:first-child .sidebar-group-header{padding-top:0!important}.sidebar-nav-group-divider{display:none!important}.sidebar-group{margin:0!important;padding:0!important}#sidebar-content{gap:0!important}#sidebar svg,.sidebar-group svg{width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important}.sidebar-group-icon svg,.sidebar-group-header svg{width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important}.dark article img,.dark .prose img,.dark [class*=\"Frame\"] img,.dark figure img{background-color:#f8f9fa!important;border-radius:8px!important;padding:12px!important}.dark article img.no-dark-bg,.dark .prose img.no-dark-bg,.dark img.no-dark-bg{background-color:transparent!important;border-radius:0!important;padding:0!important}.preview-card{display:flex;flex-direction:column;background:rgba(255, 255, 255, 0.03);border-radius:16px;overflow:hidden;transition:background 0.2s ease, box-shadow 0.2s ease;text-decoration:none!important;color:inherit!important}.preview-card:hover{background:rgba(255, 255, 255, 0.06);box-shadow:0 4px 20px rgba(0, 0, 0, 0.3)}.preview-card iframe{width:100%;border:none;border-radius:8px 8px 0 0;display:block}.preview-card-caption{padding:14px 18px 16px}.preview-card-caption h3{font-size:17px!important;font-weight:600!important;margin:0 0 6px 0!important;line-height:1.4!important}.preview-card-caption p{font-size:13px!important;opacity:0.6;margin:0!important;line-height:1.5!important}.preview-card-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.preview-card-tag{background:rgba(255, 255, 255, 0.05);color:rgba(255, 255, 255, 0.5);border:none;border-radius:16px;padding:2px 10px;font-size:11px;cursor:default}.preview-card{border:1px solid rgba(0, 0, 0, 0.08)}.dark .preview-card{border:1px solid rgba(255, 255, 255, 0.06)}.dark .preview-card img{background-color:transparent!important;padding:0!important}.preview-card-tag{color:rgba(0, 0, 0, 0.4);background:rgba(0, 0, 0, 0.05)}.dark .preview-card-tag{color:rgba(255, 255, 255, 0.5);background:rgba(255, 255, 255, 0.05)}.katex,.katex *{line-height:normal}.katex .delimsizing.size1{font-size:1em}.katex .delimsizing.size2{font-size:1.2em}.katex .delimsizing.size3{font-size:1.8em}.katex .delimsizing.size4{font-size:2.4em}.katex-display>.katex{overflow-y:hidden}.page-authors{display:flex;flex-wrap:wrap;gap:2px 18px;margin:-4px 0 28px;font-size:14px;line-height:1.5;opacity:0.6}.page-author-affiliation::before{content:\" · \"}#content-area img:not([src*=\"colab-badge\"],[src*=\"colab\"],[src*=\"badge\"],[src*=\"icon\"],[alt*=\"logo\"i],[alt*=\"avatar\"i],.no-figure-card,[data-component-part^=\"card\"],[data-component-part^=\"card\"] *,.card *,table *,.not-prose *){box-sizing:border-box;max-width:100%;border:1px solid rgba(127, 127, 127, 0.3);border-radius:12px!important;padding:12px!important;background-color:transparent}.dark #content-area img[src*=\"colab-badge\"]{padding:0!important;background-color:transparent!important;border-radius:0!important}.dark:has(a[aria-current=\"page\"][href*=\"/lectures/diffusion/\"]) #content-area img,.dark #content-area img[src*=\"/lectures/diffusion/\"]{background-color:transparent!important}"}]}
{"page":{"pagePath":"aiml-common/lectures/diffusion/introduction","slug":"/aiml-common/lectures/diffusion/introduction","pageMetadata":{"title":"Introduction to diffusion models","sidebarTitle":"Introduction","description":"Diffusion models as transport along random paths.","href":"/aiml-common/lectures/diffusion/introduction/index"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Diffusion models as transport along random paths.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,annotation:`annotation`,em:`em`,hr:`hr`,li:`li`,math:`math`,mi:`mi`,mn:`mn`,mo:`mo`,mrow:`mrow`,p:`p`,semantics:`semantics`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{Callout,Heading}=_components;if(!Callout)_missingMdxReference(`Callout`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/aiml-common/lectures/optimal-transport/introduction/index`,children:`probability transport chapter`}),` moved samples from noise to data along a velocity field. Each sample followed a smooth path, and the `,_jsx(_components.a,{href:`/aiml-common/lectures/flow-matching/index`,children:`flow matching section`}),` learned that field from samples.`]}),`\n`,_jsx(_components.p,{children:`Flow matching designs the motion explicitly. It picks an interpolation between noise and data, which fixes both the path of densities and the velocity field along it, and then learns that field by regression. This chapter asks a different question. Can you get a useful probability path without first designing a velocity field?`}),`\n`,_jsxs(_components.p,{children:[`Diffusion models get one from random paths. A fixed forward process adds a little Gaussian noise at each step, so every data point drifts toward noise. The model learns to reverse that process. Time runs the other way from the transport chapter: data sits at `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mi,{children:`t`}),_jsx(_components.mo,{children:`=`}),_jsx(_components.mn,{children:`0`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`t = 0`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6151em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`t`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}}),_jsx(_components.span,{className:`mrel`,children:`=`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`0`})]})]})]}),` and noise at `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mi,{children:`t`}),_jsx(_components.mo,{children:`=`}),_jsx(_components.mi,{children:`T`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`t = T`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6151em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`t`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}}),_jsx(_components.span,{className:`mrel`,children:`=`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6833em`}}),_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.1389em`},children:`T`})]})]})]}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The two views meet in the probability flow ODE, introduced in the `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/fokker-planck/fokker_planck`,children:`Fokker-Planck section`}),`. The `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/score-based/index`,children:`score-based section`}),` samples with it once the score is learned. It gives a velocity field that moves the density along the same path as the noisy process.`]}),`\n`,_jsxs(_components.p,{children:[`The chapter builds the random process before it trains anything. The `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/brownian-motion/brownian_motion`,children:`Brownian motion section`}),` introduces random walks and drift toward the origin. The `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/fokker-planck/fokker_planck`,children:`Fokker-Planck section`}),` follows the density of those walks and finds a deterministic flow with the same densities, and the `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/gradient-flow/gradient_flow`,children:`gradient flow section`}),` reads that evolution as steepest descent of a free energy. The `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/score-based/index`,children:`score-based section`}),` then learns the missing score from samples, and the `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/score-based/score-mog-example/score_mog_example`,children:`score mixture example`}),` repeats the method in two dimensions. The chapter ends with the discrete-time models: the `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/ddpm/index`,children:`DDPM section`}),`, its `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/ddpm/ddpm_mog_tutorial`,children:`mixture example`}),`, and the `,_jsx(_components.a,{href:`/aiml-common/lectures/diffusion/ddim/ddim_mog_tutorial`,children:`DDIM example`}),`, which samples deterministically from the same trained model.`]}),`\n`,_jsx(_components.p,{children:`For a companion text, read the elementary tutorial that derives diffusion models and flow matching from first principles (Nakkiran et al., 2024).`}),`\n`,_jsx(Heading,{level:`2`,id:`references`,children:`References`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Nakkiran, P., Bradley, A., Zhou, H., Advani, M. (2024). `,_jsx(_components.em,{children:`Step-by-step diffusion: An elementary tutorial`}),`. arXiv [cs.LG]. `,_jsx(_components.a,{href:`http://arxiv.org/abs/2406.08929`,children:`Link`})]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Callout,{icon:`bug`,iconType:`regular`,children:_jsxs(_components.p,{children:[`Found an error on this page? `,_jsx(_components.a,{href:`https://github.com/aegean-ai/eaia-feedback/issues/new?template=page-issue.yml\u0026page=/aiml-common/lectures/diffusion/introduction`,children:`Report an issue`}),`.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Introduction to diffusion models","sidebarTitle":"Introduction","description":"Diffusion models as transport along random paths.","href":"/aiml-common/lectures/diffusion/introduction/index"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"References","slug":"references","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/aegeanaiinc/d160583580826147/aiml-common/lectures/planning/task-planning/pddl/blocksworld/blocksWorldViz.js","/_mintlify/custom/aegeanaiinc/0663393b76c10385/osano.js"],"subdomain":"aegeanaiinc","siteName":"aegean.ai","title":"Introduction to diffusion models - aegean.ai","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-29T11:44:40.048Z","originalFileLocation":"aiml-common/lectures/diffusion/introduction/index.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Diffusion models as transport along random paths.\">\u003cmeta data-mint-head name=\"application-name\" content=\"aegean.ai\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Introduction to diffusion models - aegean.ai\">\u003cmeta data-mint-head property=\"og:description\" content=\"Diffusion models as transport along random paths.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"aegean.ai\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://aegean.ai/aiml-common/lectures/diffusion/introduction\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://aegeanaiinc.mintlify.site/_mintlify/api/og/v2?division=Diffusion+Models\u0026amp;title=Introduction+to+diffusion+models\u0026amp;description=Diffusion+models+as+transport+along+random+paths.\u0026amp;theme=b96415c7027c689888470b34\u0026amp;signature=c8f8c0954d5478a9cdcb5ffd4b8b13c76ae7a430481e2e908d933e92dfe9d65c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Introduction to diffusion models - aegean.ai\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Diffusion models as transport along random paths.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://aegeanaiinc.mintlify.site/_mintlify/api/og/v2?division=Diffusion+Models\u0026amp;title=Introduction+to+diffusion+models\u0026amp;description=Diffusion+models+as+transport+along+random+paths.\u0026amp;theme=b96415c7027c689888470b34\u0026amp;signature=c8f8c0954d5478a9cdcb5ffd4b8b13c76ae7a430481e2e908d933e92dfe9d65c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/aegeanaiinc/6M9Gi5GgxBzndhcq/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"aegean.ai\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2196C8\">\u003clink data-mint-head rel=\"canonical\" href=\"https://aegean.ai/aiml-common/lectures/diffusion/introduction\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/aiml-common/lectures/diffusion/introduction.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://aegean.ai/#organization\",\"name\":\"aegean.ai\",\"url\":\"https://aegean.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/aegeanaiinc/ai8d4zdsUnwq_5J6/logo.png?fit=max\u0026auto=format\u0026n=ai8d4zdsUnwq_5J6\u0026q=85\u0026s=fe5e281c1569f8468ff85157bd7d9dc3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://aegean.ai#website\",\"name\":\"aegean.ai\",\"url\":\"https://aegean.ai\",\"publisher\":{\"@id\":\"https://aegean.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://aegean.ai/aiml-common/lectures/diffusion/introduction#webpage\",\"url\":\"https://aegean.ai/aiml-common/lectures/diffusion/introduction\",\"name\":\"Introduction to diffusion models\",\"description\":\"Diffusion models as transport along random paths.\",\"dateModified\":\"2026-11-29T11:44:40.048Z\",\"isPartOf\":{\"@id\":\"https://aegean.ai#website\"},\"breadcrumb\":{\"@id\":\"https://aegean.ai/aiml-common/lectures/diffusion/introduction#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://aegean.ai/aiml-common/lectures/diffusion/introduction#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"aegean.ai\",\"item\":\"https://aegean.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to diffusion models\",\"item\":\"https://aegean.ai/aiml-common/lectures/diffusion/introduction\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://aegean.ai/aiml-common/lectures/diffusion/introduction#article\",\"headline\":\"Introduction to diffusion models\",\"name\":\"Introduction to diffusion models\",\"description\":\"Diffusion models as transport along random paths.\",\"url\":\"https://aegean.ai/aiml-common/lectures/diffusion/introduction\",\"mainEntityOfPage\":{\"@id\":\"https://aegean.ai/aiml-common/lectures/diffusion/introduction#webpage\"},\"dateModified\":\"2026-11-29T11:44:40.048Z\",\"publisher\":{\"@id\":\"https://aegean.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://aegean.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"aegean.ai\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"aegean.ai\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/aiml-common/lectures/diffusion/introduction.md","siteName":"aegean.ai","nav":{"global":null,"tabs":[{"tab":"Home","icon":"house","pages":[{"title":"Home","href":""}]},{"tab":"Products","icon":"box","menu":[{"item":"Overview","icon":"box","pages":[{"title":"Overview","href":"/products"}]},{"item":"Platforms","icon":"server","pages":[{"title":"Platforms","href":"/products/platforms"}]},{"item":"Applications","icon":"grid-2","pages":[{"title":"Applications","href":"/products/applications"}]},{"item":"Tech Demonstrations","icon":"flask","pages":[{"title":"Tech Demonstrations","href":"/products/tech-demonstrators"}]}],"pages":[{"title":"Products","href":"/products"}]},{"tab":"Book","icon":"book","menu":[{"item":"Introduction","pages":[{"title":"Introduction","href":"/book/introduction"}]},{"item":"Foundations","pages":[{"title":"Foundations","href":"/book/foundations"}]},{"item":"Neural Networks","pages":[{"title":"Neural Networks","href":"/book/training-dnns"}]},{"item":"Perception","icon":"eye","pages":[{"title":"Perception","href":"/book/perception"}]},{"item":"State Estimation","icon":"compass","pages":[{"title":"State Estimation","href":"/book/state-estimation-mapping"}]},{"item":"Language Models","icon":"omega","pages":[{"title":"Language Models","href":"/book/llms"}]},{"item":"Vision Language Models","icon":"image","pages":[{"title":"Vision Language Models","href":"/aiml-common/lectures/vlm"}]},{"item":"Speech Models","icon":"microphone","pages":[{"title":"Speech Models","href":"/aiml-common/lectures/speech/text-to-speech-and-voice-cloning"}]},{"item":"Latent Transport Models","icon":"wand-magic-sparkles","groups":[{"group":"Latent Transport Models","icon":"wand-magic-sparkles","pages":[{"title":"Latent Transport Models","sidebarTitle":"Overview","href":"/book/latent-transport-models"}]},{"group":"Variational Autoencoders","icon":"circle-nodes","pages":[{"title":"Variational Inference","sidebarTitle":"Introduction","href":"/aiml-common/lectures/vae/introduction/index"},{"title":"Conditional generator p(x|z)","sidebarTitle":"Generator Example","href":"/aiml-common/lectures/vae/introduction/x-given-z-generator/x_given_z_generator_example"},{"title":"Estimating marginal likelihood","sidebarTitle":"Monte Carlo Sampling","href":"/aiml-common/lectures/vae/introduction/monte-carlo-sampling/monte-carlo-sampling"},{"title":"Geometry of the data distribution","sidebarTitle":"Data geometry","href":"/aiml-common/lectures/vae/introduction/mnist-manifold/mnist-manifold"},{"title":"VAE architecture","sidebarTitle":"Architecture","href":"/aiml-common/lectures/vae/vae-architecture/index"},{"title":"Optimization and the ELBO","sidebarTitle":"Optimization","href":"/aiml-common/lectures/vae/elbo-optimization/index"}]},{"group":"Probability Transport Models","icon":"arrows-left-right","pages":[{"title":"Probability transport","sidebarTitle":"Introduction","href":"/aiml-common/lectures/optimal-transport/introduction/index"},{"title":"Transport maps and couplings","sidebarTitle":"Maps and couplings","href":"/aiml-common/lectures/optimal-transport/maps-and-couplings/index"},{"title":"Velocity fields","sidebarTitle":"Velocity fields","href":"/aiml-common/lectures/velocity-fields/index"},{"title":"Dynamic optimal transport","sidebarTitle":"Dynamic transport","href":"/aiml-common/lectures/optimal-transport/dynamic-transport/index"},{"title":"Normalizing flows and exact likelihoods","sidebarTitle":"Normalizing flows","href":"/aiml-common/lectures/normalizing-flows/index"},{"title":"Flow matching","sidebarTitle":"Flow matching","href":"/aiml-common/lectures/flow-matching/index"},{"title":"Flow matching on a 1D mixture","sidebarTitle":"Flow matching in 1D","description":"Learning the transport field from samples, with three couplings.","href":"/aiml-common/lectures/flow-matching/mog-1d/index"}]},{"group":"Diffusion Models","icon":"wand-magic-sparkles","pages":[{"title":"Introduction to diffusion models","sidebarTitle":"Introduction","href":"/aiml-common/lectures/diffusion/introduction/index"},{"title":"Brownian motion, the continuous-time core of diffusion","sidebarTitle":"Brownian Motion","description":"Brownian motion and its link to the diffusion forward process.","href":"/aiml-common/lectures/diffusion/brownian-motion/brownian_motion"},{"title":"Fokker-Planck and the probability flow ODE","sidebarTitle":"Fokker-Planck","href":"/aiml-common/lectures/diffusion/fokker-planck/fokker_planck"},{"title":"Diffusion as a gradient flow","sidebarTitle":"Gradient Flow","href":"/aiml-common/lectures/diffusion/gradient-flow/gradient_flow"},{"title":"Score-based generative models","sidebarTitle":"Score-based methods","href":"/aiml-common/lectures/diffusion/score-based/index"},{"title":"Score MoG Example","sidebarTitle":"Score MoG Example","href":"/aiml-common/lectures/diffusion/score-based/score-mog-example/score_mog_example"},{"title":"Denoising Diffusion Probabilistic Models","sidebarTitle":"DDPM","href":"/aiml-common/lectures/diffusion/ddpm/index"},{"title":"DDPM MoG Example","sidebarTitle":"DDPM MoG Example","href":"/aiml-common/lectures/diffusion/ddpm/ddpm_mog_tutorial"},{"title":"DDIM MoG Example","sidebarTitle":"DDIM MoG Example","href":"/aiml-common/lectures/diffusion/ddim/ddim_mog_tutorial"}]}]},{"item":"Reasoning","icon":"brain","pages":[{"title":"Reasoning","href":"/book/reasoning"}]},{"item":"Planning","icon":"route","pages":[{"title":"Planning","href":"/book/task-planning"}]},{"item":"MDPs","icon":"arrows-rotate","pages":[{"title":"MDPs","href":"/book/mdps"}]},{"item":"RL","icon":"arrows-rotate","pages":[{"title":"RL","href":"/book/reinforcement-learning"}]},{"item":"Embodied Agent Motion","icon":"robot","pages":[{"title":"Embodied Agent Motion","href":"/book/robotics-systems"}]},{"item":"Embodied Policy Learning","icon":"robot","pages":[{"title":"Embodied Policy Learning","href":"/book/physical-ai"}]},{"item":"Prerequisites","pages":[{"title":"Prerequisites","href":"/book/prerequisites"}]}]},{"tab":"Courses","icon":"graduation-cap","menu":[{"item":"Overview","pages":[{"title":"Overview","href":"/courses"}]},{"item":"Introduction to AI","pages":[{"title":"Introduction to AI","href":"/courses/ai"}]},{"item":"DL for Computer Vision","pages":[{"title":"DL for Computer Vision","href":"/courses/cv"}]},{"item":"AI for Robotics","pages":[{"title":"AI for Robotics","href":"/courses/robotics"}]},{"item":"Resources","pages":[{"title":"Resources","href":"/courses/njit-calendar"}]}],"pages":[{"title":"Courses","href":"/courses"}]},{"tab":"Media","icon":"video","pages":[{"title":"Media","href":"/media"}]},{"tab":"AI Industry","icon":"flask","pages":[{"title":"AI Industry","href":"/research"}]},{"tab":"Blog","icon":"pen-nib","pages":[{"title":"Blog","href":"/blog"}]},{"tab":"Careers","icon":"briefcase","menu":[{"item":"Internships","pages":[{"title":"Internships","href":"/careers/virtual-internships"}]}],"pages":[{"title":"Careers","href":"/careers/virtual-internships"}]},{"tab":"About","icon":"user","pages":[{"title":"About","href":"/about"}]}]},"basePath":"","title":"Introduction to diffusion models - aegean.ai","deploymentId":"dpl_4DWa5VHHws8GyZotTfaG5njNqY1w","buildId":"dpl_4DWa5VHHws8GyZotTfaG5njNqY1w","dynamics":[],"chunks":[]}