Concept notebookChecking saved investigationReading browser-local route memory before showing a continuation.

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.

published · difficulty 4/5 · 22 min read

01

01

Intuition

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

PredictName the object in plain language, then predict what should change.Leave with one reusable mental picture before notation appears.

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.

Section prompt

Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.

02

02

Math

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

InspectTrack the same object through the notation and check each symbol.Leave with the invariant the equations preserve.

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),q(xtx0)=N(αˉtx0, (1αˉt)I),

where αˉt=s=1tαs\bar\alpha_t = \prod_{s=1}^t \alpha_sαˉt=s=1tαs and αs=1βs\alpha_s = 1-\beta_sαs=1βs for a noise schedule βs\beta_sβ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).xt=αˉtx0+1αˉtϵ,ϵ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.L=Ex0,t,ϵϵϵθ(xt,t)2.

The "score" view connects denoising to the gradient of log-density xlogpt(x)\nabla_x\log p_t(x)xlogpt(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}}.sθ(xt,t)xtlogpt(xt)1αˉtϵθ(xt,t).

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

Section prompt

Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.

03

03

Code

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

TraceMatch variables to symbols before reading the implementation.Leave with a runnable witness for the math.
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}")
Section prompt

Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.

04

04

Interactive Demo

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

ManipulateChange one control and predict the visible response before reveal.Leave with the observed invariant or a repaired model.

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 inquiry checkpoint

Manipulate one control and predict the visible change.

01Choose lensTrace a quantity
02ObserveDemo state pending
03GroundName the equation, invariant, or control that explains it.
04CarryNext: Flow Matching & Rectified Flows

Choose what to inspect in Diffusion, Score-Based Models & Flow Matching. This shared fallback is an observation guide, not evidence of learning.

Loading interactive demo...

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

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

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.

Section prompt

Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.

4/4 sections ready

Concept: Diffusion, Score-Based Models & Flow Matching

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

BeforeMaximum LikelihoodNow4/4 sections readyTryManipulate one control and predict the visible change.NextFlow Matching & Rectified Flows
Object contextGenerative Models
ConceptLearner lens

Diffusion, Score-Based Models & Flow Matching

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

Mode questionCan I say the mechanism back in one sentence before I reveal anything?

Start with the prediction checkpoint, then compare the reveal to the mental model.

Take this move

Study modes

Keep the object fixed; change the lens.

Route back through the notebook

Carry the same object through intuition, math, code, and demo.

4/4 sections ready
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.

After The First Pass

Turn the concept into an inspected object.

The lower panels are one second act: keep the object fixed, inspect it visually, check source boundaries, practice transfer, then attach the research question.
ConceptDiffusion, Score-Based Models & Flow MatchingGenerative Models

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.

Demo notes 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 readyDemo notes 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.

Object - ConceptDiffusion, Score-Based Models & Flow MatchingQuestion

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

concept:generative-models/diffusion
Boundary

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

Check

Open the closest source note before trusting the local explanation.

Evidence

3 selected-object sources shown first; 3 references total.

Next move

Audit the claim boundary, then ask from the same selected object.

selected object source · paper · 2015Deep Unsupervised Learning using Nonequilibrium ThermodynamicsSohl-Dickstein et al.
Located CF editorial boundary

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

Used here as

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 epsil...

Caveat

Exported 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 va...

Open source
selected object source · paper · 2020Denoising Diffusion Probabilistic ModelsHo, Jain, and Abbeel
Located CF editorial boundary

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

Used here as

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 epsil...

Caveat

Exported 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 va...

Open source
selected object source · paper · 2020Score-Based Generative Modeling through Stochastic Differential EquationsSong et al.
Located CF editorial boundary

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

Used here as

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 epsil...

Caveat

Exported 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 va...

Open source

Claim Review

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

Object - ConceptDiffusion, Score-Based Models & Flow MatchingQuestion

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

concept:generative-models/diffusion
Boundary

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

Check

Treat every claim as provisional until source support and a local witness agree.

Evidence

1 structured claim check on this concept.

Next move

Run the prediction or practice transfer before asking for a grounded review.

1 CF editorial source-scope review recorded

Publisher-side editorial review is not independent replication. Claims without it still need exact source-support review. 3 references and 3 local witnesses are available for inspection.

Diffusion 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.
Used here as

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. S...

Local witness
Equation 1
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),
Equation 2
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).
Caveat

Exported 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 matchin...

Review stateCF editorial source-scope reviewClaim metadata: source checkedPublisher-side editorial review only; not independent replication. 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 notebook

Use the idea, then test it somewhere new

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

AttemptNo learning claim inferred
Object - ConceptDiffusion, Score-Based Models & Flow MatchingQuestion

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

concept:generative-models/diffusion
Boundary

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

Check

Use one state from Diffusion, Score-Based Models & Flow Matching to explain what changes, why it changes, and which assumption the explanation needs.

Evidence

No learner move yet; no learning state is inferred.

Next move

Write first, use only the help you need, then try a new case without it.

Explain

Use one state from Diffusion, Score-Based Models & Flow Matching to explain what changes, why it changes, and which assumption the explanation needs.

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.

Grounded object roomClose
Selected object routeAsk from this object; carry one invariant back.sources: sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde
  1. ObjectConceptDiffusion, Score-Based Models & Flow Matching
  2. PredictBefore revealDiffusion, Score-Based Models & Flow Matching prediction
  3. WitnessCompare codeDiffusion, Score-Based Models & Flow Matching code witness 1
  4. RoomAsk groundedChecking local snapshot
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 predictionManipulate 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?Checking local snapshot

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?

Source boundaryInspect source ids: sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sdeStable content-object key attached
Role lenses for this object

These are fixed, deterministic perspectives derived from the selected object. They do not represent people, community contributions, or independent review.

Learner evidence requestAsk what would make "Diffusion, Score-Based Models & Flow Matching" feel predictable rather than familiar.
Assumption

Source ids sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde must support the exact object, not just the surrounding topic.

Source-checking summary

Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion.

Proposed experiment

Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo.

Next action

The learner can state the mechanism in their own words

Evidence4 checks
PredictionChecking carried observation
ActionReady for one action
AILearner handoff ready
Open source object
01PredictionChecking browser-local route memory
02EvidenceChecking for a carried observation
03BoundaryInspect source ids: sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde
04Next moveSave one next action
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
Object-attached 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 Deterministic role lenses for this object: - Boundary: fixed perspectives, not people, community contributions, or independent review - Source-checking summary: Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Teach/transfer move: Turn the mechanism into one sentence that predicts a neighboring concept. - Assumptions: - Source ids sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde must support the exact object, not just the surrounding topic. - The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. - The concept explanation is local atlas prose until checked against its math, code, and source support. - Prerequisite gaps should become a repair route, not a reason to leave the object vague. - Role-lens requests: - Learner: ask for "Ask what would make "Diffusion, Score-Based Models & Flow Matching" feel predictable rather than familiar." | assumption: Source ids sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde must support the exact object, not just the surrounding topic. | next action: The learner can state the mechanism in their own words - Researcher: ask for "Source ids to inspect: sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde" | assumption: The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. | next action: The learner can name the prerequisite that would repair confusion - Experimenter: ask for "Choose one variable or condition to perturb before asking for an explanation." | assumption: The concept explanation is local atlas prose until checked against its math, code, and source support. | next action: The learner can predict how the mechanism changes under one perturbation - Professor: ask for "Find the smallest transferable rule a learner could reuse without the AI." | assumption: Prerequisite gaps should become a repair route, not a reason to leave the object vague. | next action: Teach or transfer: Turn the mechanism into one sentence that predicts a neighboring concept. 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. Current deterministic role lens for this object: - Role lens: Learner - Evidence request: Ask what would make "Diffusion, Score-Based Models & Flow Matching" feel predictable rather than familiar. - Assumption to keep visible: Source ids sohl-dickstein-2015-nonequilibrium, ho-2020-ddpm, song-2020-score-sde must support the exact object, not just the surrounding topic. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Next action: The learner can state the mechanism in their own words

concept/concept-notebook/generative-models/diffusion concept:generative-models/diffusion