Generative Models

Diffusion, Score-Based Models & Flow Matching

Denoise noise into data: the diffusion forward process, score matching, and modern sampling via reverse-time dynamics and flow matching.

status: publishedimportance: importantdifficulty 4/5math: graduateread: 22mlive demo
Editorial generative-model illustration of noisy samples following a reverse denoising trajectory toward a structured data manifold.

Concept Structure

Diffusion, Score-Based Models & Flow Matching

01Intuition

Start with the picture, metaphor, or geometric mechanism.

02Math

Make the objects explicit and connect them with notation.

03Code

Mirror the equations with runnable implementation details.

04Interactive Demo

Manipulate the mechanism and watch the idea respond.

2prerequisites
2next concepts
3related links

Learning map

Diffusion, Score-Based Models & Flow Matching
BeforeMaximum LikelihoodNow4/4 sections readyTryManipulate one control and predict the visible change.NextFlow Matching & Rectified Flows

Object flow

4/4 sections readyAsk about thisResearch room
ConceptDiffusion, Score-Based Models & Flow MatchingGenerative Models
3 sources attachedLocal snapshot ready
concept:generative-models/diffusion

Conceptual Bridge

What should feel connected as you move through this page.

Carry inMaximum Likelihood

Bring the mental model from Maximum Likelihood; this page will reuse it instead of restarting from zero.

Work hereDiffusion, Score-Based Models & Flow Matching

Denoise noise into data: the diffusion forward process, score matching, and modern sampling via reverse-time dynamics and flow matching.

Carry outFlow Matching & Rectified Flows

The next edge should feel earned: use the demo prediction here before following Flow Matching & Rectified Flows.

Test the linkManipulate one control and predict the visible change.Then continue to Flow Matching & Rectified Flows
01

01

Intuition

Build the mental picture first so the rest of the page has something to attach to.

Section prompt

Diffusion models generate by starting from noise and repeatedly denoising.

The forward process is easy: take a data vector, such as an image representation, and add a little noise, again and again, until it becomes almost pure Gaussian noise.

The reverse process is the learning problem: train a network that, given a slightly-noised sample, parameterizes reverse or noise-removal updates toward cleaner, data-like samples. Sampling repeatedly applies learned reverse updates.

02

02

Math

Translate the story into symbols, assumptions, and a derivation you can inspect.

Section prompt

A common discrete-time forward process (DDPM-style) is:

q(xtx0)=N ⁣(αˉtx0, (1αˉt)I),q(x_t\mid x_0) = \mathcal N\!\big(\sqrt{\bar\alpha_t}\,x_0,\ (1-\bar\alpha_t)I\big),

where αˉt=s=1tαs\bar\alpha_t = \prod_{s=1}^t \alpha_s and αs=1βs\alpha_s = 1-\beta_s for a noise schedule βs\beta_s.

Equivalently, you can sample:

xt=αˉtx0+1αˉtϵ,ϵN(0,I).x_t = \sqrt{\bar\alpha_t}\,x_0 + \sqrt{1-\bar\alpha_t}\,\epsilon,\quad \epsilon\sim\mathcal N(0,I).

Training often uses the noise-prediction loss:

L=Ex0,t,ϵϵϵθ(xt,t)2.\mathcal L = \mathbb E_{x_0,t,\epsilon}\,\big\|\epsilon - \epsilon_\theta(x_t,t)\big\|^2.

The "score" view connects denoising to the gradient of log-density xlogpt(x)\nabla_x\log p_t(x). Under the Gaussian DDPM or VP corruption above, a learned noise predictor can be converted into an approximate score estimate:

sθ(xt,t)xtlogpt(xt)    ϵθ(xt,t)1αˉt.s_\theta(x_t,t) \approx \nabla_{x_t}\log p_t(x_t) \;\propto\; -\frac{\epsilon_\theta(x_t,t)}{\sqrt{1-\bar\alpha_t}}.

Flow matching is a separate continuous-vector-field view and is only a forward pointer here.

03

03

Code

Keep the implementation aligned with the notation so the algorithm is legible.

Section prompt
import numpy as np

T = 1000
beta = np.linspace(1e-4, 0.02, T)
alpha = 1.0 - beta
alpha_bar = np.concatenate([[1.0], np.cumprod(alpha)])  # alpha_bar[0]=1 (no noise)

x0 = np.array([1.0, -1.0])
for t in [0, 10, 100, 500, 1000]:
    eps = np.random.randn(*x0.shape)
    xt = np.sqrt(alpha_bar[t]) * x0 + np.sqrt(1.0 - alpha_bar[t]) * eps
    print(f"t={t:>3}  xt={np.round(xt, 3)}  noise_std={np.sqrt(1.0 - alpha_bar[t]):.3f}")
04

04

Interactive Demo

Use direct manipulation to connect the explanation to a moving system.

Section prompt

This first lab isolates the DDPM forward process. Scrub tt to watch

xt=αˉtx0+1αˉtϵx_t=\sqrt{\bar\alpha_t}x_0+\sqrt{1-\bar\alpha_t}\epsilon

push a two-blob toy distribution toward a near-Gaussian noise cloud. Before checking, predict whether a fixed structure-match proxy crosses its threshold early, in the middle, or late. Score matching and flow matching are separate mechanisms and will be handled in their own focused labs.

Live Concept Demo

Explore Diffusion, Score-Based Models & Flow Matching

The stage is code-native and interactive. Use it to test the explanation against the mechanism.

difficulty 4/5graduatecode-aligned
Demo Prediction Checkpoint

Manipulate one control and predict the visible change.

Commit to what Diffusion, Score-Based Models & Flow Matching should make visible before reading the result.

After The First Pass

Turn the concept into an inspected object.

Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.

Mechanism Storyboard

See the idea move before the page explains it

Denoise noise into data: the diffusion forward process, score matching, and modern sampling via reverse-time dynamics and flow matching.

Prediction open01 / Intuition
Editorial generative-model illustration of noisy samples following a reverse denoising trajectory toward a structured data manifold.
Prediction lens

Start with the picture, metaphor, or geometric mechanism.

Commit first

Before reading further, choose the kind of change Diffusion, Score-Based Models & Flow Matching should make visible.

Visual Inquiry

Make the image answer a mathematical question

Denoise noise into data: the diffusion forward process, score matching, and modern sampling via reverse-time dynamics and flow matching.

4/4 stages readyLive demo connected
Prediction

Which visible object should carry the first intuition?

Commit first

Pick the cue that should make Diffusion, Score-Based Models & Flow Matching easier to reason about before the page gives the answer.

Source Grounding

Canonical references for the mechanism on this page.

paper · 2015Deep Unsupervised Learning using Nonequilibrium ThermodynamicsSohl-Dickstein et al.

Early diffusion framing: a gradual noising process paired with learned reverse dynamics.

Open source
paper · 2020Denoising Diffusion Probabilistic ModelsHo, Jain, and Abbeel

Grounds DDPM forward noising equations and simplified epsilon-prediction training; the page demo uses the forward noising equation.

Open source
paper · 2020Score-Based Generative Modeling through Stochastic Differential EquationsSong et al.

Connects score-based modeling, diffusion processes, and reverse-time SDE sampling.

Open source

Claim Review

Denoise noise into data: the diffusion forward process, score matching, and modern sampling via reverse-time dynamics and flow matching.

Status1 substantive review recorded

Claims without a substantive review badge still need exact source-support review.

Sources3 references

sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde

Witnesses4 local objects

Use equation, code, and demo objects to check whether the source support is operational.

Substantively reviewedDiffusion can be taught as gradual corruption plus learned reverse denoising: Sohl-Dickstein frames forward diffusion/reversal; Ho supplies q(x_t|x_0), reparameterized x_t, and epsilon-prediction MSE; Song Score SDE supplies the score-based reverse-time sampling bridge.Claim metadata: source checked

Sohl-Dickstein supports iterative forward corruption plus learned reverse diffusion. Ho supports the DDPM closed-form q(x_t|x_0), reparameterized x_t sample, and simplified L_simple epsilon-prediction MSE. Song supports estimating time-dependent scores and using the reverse-time SDE/numerical solvers as the score-based reverse-sampling bridge. Local math/code/demo witness DDPM forward noising only.

Sources: Deep Unsupervised Learning using Nonequilibrium Thermodynamics, Denoising Diffusion Probabilistic Models, Score-Based Generative Modeling through Stochastic Differential EquationsExported math refs cover only q(x_t|x_0) and reparameterized x_t. Code/demo isolate forward noising/backward replay, not a trained sampler. Excludes guidance, latent diffusion, sampler variants, flow matching, production image quality, and broad modality claims.A bounded review summary is present; still check caveats and exact source scope.

Sohl-Dickstein supports iterative forward corruption plus learned reversal; Ho supports DDPM q(x_t|x_0), reparameterized x_t, and L_simple epsilon-MSE; Song grounds reverse-time SDE sampling from time-dependent scores. Local math/code/demo witness only forward noising; epsilon-MSE and Score-SDE mechanics are source-supported, not locally simulated.

Reviewer: codex+oracle+codex-5.3; reviewed 2026-05-08

Practice Loop

Try the idea before it explains itself

Denoise noise into data: the diffusion forward process, score matching, and modern sampling via reverse-time dynamics and flow matching.

Readiness0/3 checks ready
Predict

Before touching the demo, predict one visible change that should happen in Diffusion, Score-Based Models & Flow Matching.

Hint 1

Reveal when your model needs a nudge.

Hint 2

Reveal when your model needs a nudge.

Hint 3

Reveal when your model needs a nudge.

Object research drawerClose
ConceptDiffusion, Score-Based Models & Flow MatchingGenerative Models
Code witness comparisonDiffusion, Score-Based Models & Flow Matching code witness 1T = 1000Prediction before revealDiffusion, Score-Based Models & Flow Matching interactive demoManipulate one control and predict the visible change.
Grounded room questionWhat is the smallest example that makes Diffusion, Score-Based Models & Flow Matching click without losing the math?Local snapshot ready

Research Room

Attach the question to an exact object

Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.
Next local actionNo local draft saved yet

Open the draft below to save one note and next action in this browser.

conceptGenerative Models

Diffusion, Score-Based Models & Flow Matching

Anchored question

What is the smallest example that makes Diffusion, Score-Based Models & Flow Matching click without losing the math?

Local action draftNo local draft saved yetExpand only when ready to capture one local next action
Local action draft

This draft stays locally in this browser for concept:generative-models/diffusion.

No local draft saved.
Evidence to inspect
  • Source ids to inspect: sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde
  • Definition, prerequisite, and contrast concept links
  • The equation or code witness that makes the concept operational
  • One demo state that shows the invariant instead of a slogan
What would resolve this
  • The learner can state the mechanism in their own words
  • The learner can name the prerequisite that would repair confusion
  • The learner can predict how the mechanism changes under one perturbation
Grounded AI handoff

I am working in Continuous Function's research reading room. Object: concept - Diffusion, Score-Based Models & Flow Matching Object key: concept:generative-models/diffusion Context: Generative Models Anchor id: concept/concept-notebook/generative-models/diffusion Open question: What is the smallest example that makes Diffusion, Score-Based Models & Flow Matching click without losing the math? Evidence to inspect: - Source ids to inspect: sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.

Open source object
concept/concept-notebook/generative-models/diffusion concept:generative-models/diffusion