Bring the mental model from Maximum Likelihood; this page will reuse it instead of restarting from zero.
Generative Models
Score Matching & Score-Based Generative Models
Learn the score field grad_x log p(x) without normalizing constants. Denoising score matching turns diffusion training into simple regression on noise.

Concept Structure
Score Matching & Score-Based Generative Models
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learning map
Score Matching & Score-Based Generative ModelsConceptual Bridge
What should feel connected as you move through this page.
Learn the score field grad_x log p(x) without normalizing constants. Denoising score matching turns diffusion training into simple regression on noise.
The next edge should feel earned: use the demo prediction here before following Flow Matching & Rectified Flows.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
If a probability distribution is a landscape, then is a height map, and the score
is the vector field that points "uphill" toward higher density.
Score-based generative modeling is the idea: instead of learning directly (which requires a normalizing constant), learn the gradient of the log-density. With estimated time-dependent scores and a specified reverse-time SDE/ODE or Langevin-style sampler, you can move points from noise toward data-like samples.
In Gaussian-noising diffusion parameterizations, predicting noise at each noise level is often equivalent, up to a known scale, to estimating a score.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
The score function and score matching
For a non-normalized model , the data-gradient score ignores the constant :
This avoids evaluating the normalizing constant, but is hard to implement directly because the derivative-based objective still includes the divergence term.
Denoising score matching (diffusion-friendly)
Add Gaussian noise. The conditional target, noise-prediction scale, and reverse-time dynamics share the same learned score field:
Denoising score matching trains:
So predicting noise is equivalent (up to scaling) to predicting the score:
The conditional DSM target is the label for one known clean source; the marginal score field averages over possible clean sources.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
rng = np.random.default_rng(0)
x = rng.normal(loc=1.5, scale=1.0, size=(5,))
sigma = 0.7
eps = rng.standard_normal(x.shape)
xt = x + sigma * eps
score_from_eps = -eps / sigma
score_from_xt = -(xt - x) / (sigma**2) # same quantity
print("x: ", np.round(x, 3))
print("xt: ", np.round(xt, 3))
print("max|diff|:", float(np.max(np.abs(score_from_eps - score_from_xt))))
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Use the demo to see the score field and how diffusion "noise prediction" corresponds to a scaled score estimate.
Live Concept Demo
Explore Score Matching & Score-Based Generative Models
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Score Matching & Score-Based Generative Models 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
Learn the score field grad_x log p(x) without normalizing constants. Denoising score matching turns diffusion training into simple regression on noise.

Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Score Matching & Score-Based Generative Models should make visible.
Visual Inquiry
Make the image answer a mathematical question
Learn the score field grad_x log p(x) without normalizing constants. Denoising score matching turns diffusion training into simple regression on noise.
Which visible object should carry the first intuition?
Pick the cue that should make Score Matching & Score-Based Generative Models easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Introduces score matching for models where the normalizing constant is intractable.
Open sourceGrounds denoising score matching as learning to recover clean structure from noisy samples; publisher DOI is 10.1162/NECO_a_00142.
Open sourceConnects learned score fields to reverse-time stochastic dynamics for generation.
Open sourceClaim Review
Learn the score field grad_x log p(x) without normalizing constants. Denoising score matching turns diffusion training into simple regression on noise.
Claims without a substantive review badge still need exact source-support review.
hyvarinen-2005-score-matching, vincent-2011-denoising-score, song-2020-score-sde
Use equation, code, and demo objects to check whether the source support is operational.
Hyvarinen supports score matching for continuous non-normalized models because the data score removes Z(theta). Vincent supports the Gaussian DSM target (x-x_tilde)/sigma^2 and DSM/SM equivalence. Song supports reverse SDE sampling and probability-flow ODE dynamics from estimated time-dependent scores. Local math/code/demo cover the score, DSM scaling, conditional-vs-marginal distinction, and reverse bridge.
Sources: Estimation of Non-Normalized Statistical Models by Score Matching, A Connection Between Score Matching and Denoising Autoencoders, Score-Based Generative Modeling through Stochastic Differential EquationsChecks the score, Gaussian conditional DSM label under x_tilde=x+sigma epsilon, and estimated-score reverse SDE/probability-flow ODE bridge. Does not claim exact solvers, conditional labels equal marginal scores, high-dimensional quality, or full DDPM/ELBO training.A bounded review summary is present; still check caveats and exact source scope.Hyvarinen supports non-normalized score matching: the data-gradient score removes Z(theta) and the implicit objective uses squared score plus divergence terms. Vincent supports the Gaussian conditional DSM target (x-x_tilde)/sigma^2 = -epsilon/sigma and DSM/SM equivalence. Song supports estimated time-dependent scores in reverse SDE sampling and probability-flow ODEs. Local math, code, and demo align with this bounded mechanism without pre-reveal target leakage.
Reviewer: codex+oracle+codex-5.3; reviewed 2026-05-08Source support candidates
paper 2005Estimation of Non-Normalized Statistical Models by Score MatchingIntroduces score matching for models where the normalizing constant is intractable.
paper 2011A Connection Between Score Matching and Denoising AutoencodersGrounds denoising score matching as learning to recover clean structure from noisy samples; publisher DOI is 10.1162/NECO_a_00142.
paper 2020Score-Based Generative Modeling through Stochastic Differential EquationsConnects learned score fields to reverse-time stochastic dynamics for generation.
Practice Loop
Try the idea before it explains itself
Learn the score field grad_x log p(x) without normalizing constants. Denoising score matching turns diffusion training into simple regression on noise.
Before touching the demo, predict one visible change that should happen in Score Matching & Score-Based Generative Models.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
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.Open the draft below to save one note and next action in this browser.
Score Matching & Score-Based Generative Models
What is the smallest example that makes Score Matching & Score-Based Generative Models click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:generative-models/score-matching.
- Source ids to inspect: hyvarinen-2005-score-matching, vincent-2011-denoising-score, 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
- 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
I am working in Continuous Function's research reading room. Object: concept - Score Matching & Score-Based Generative Models Object key: concept:generative-models/score-matching Context: Generative Models Anchor id: concept/concept-notebook/generative-models/score-matching Open question: What is the smallest example that makes Score Matching & Score-Based Generative Models click without losing the math? Evidence to inspect: - Source ids to inspect: hyvarinen-2005-score-matching, vincent-2011-denoising-score, 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.
concept/concept-notebook/generative-models/score-matching
concept:generative-models/score-matching