U1.4 From Discrete Steps to Forward and Reverse Dynamics
Builds on6 notes
- M2.3Navigation Updates Every 30 Seconds: Euler's Method and Its Error
- M3.0Where Is the Walker After an Hour? From Random Walks to Brownian Motion
- M3.1Flow Plus Fluctuations: Stochastic Differential Equations
- M3.3Random Walkers in a Valley: Langevin Dynamics and Stationarity
- M2.2Change in the Crowd = Inflow − Outflow: The Continuity Equation
- M3.2A Thousand Leaves in a Noisy River: The Fokker–Planck Equation
Reversing one frame does not yet give fast playback
Our reverse Gaussian generates one state per network call. A thousand forward levels originally meant a thousand sequential reverse calls. Can we accelerate generation?
How can we change the playback speed while preserving the desired distributions?
Recall DDPM’s sampling update [1]:
The true reverse conditional is generally a mixture over possible clean origins, rather than a single Gaussian.
DiscussionQ1
Why not replace with a much earlier and sample a Gaussian centered using the predicted clean image?
The true large-step reverse law is
a mixture of conditional Gaussians over possible clean origins.
Suppose a blurry observation could come from a clean point on either side. For a small reverse step, the branch centers remain close. A larger step separates them. Substituting their mean preserves the center but may discard substantial variance.
How much uncertainty does the single-Gaussian approximation omit?
Show the reasoning
Take two equally likely origins and . If the reverse mean’s clean-data coefficient is , their branch centers differ from the mean by , giving variance
The omitted variance grows quadratically with the clean-data coefficient, which can become substantial over a large jump.
More generally, the conditional mean is affine in . Let its coefficient be and its within-branch covariance be . Total variance gives
Substituting the clean conditional mean gets the center right. The variance contains both within-branch spread and spread between branch means. The plug-in Gaussian omits the latter.
Away from singular boundary regimes, an adjacent-step coefficient is , so the omitted term is higher order. Large jumps can separate modes substantially, making one Gaussian a poor representation.
A correct mean does not capture separated reverse branches. Large steps can make the omitted variance substantial.
Acceleration therefore requires more than enlarging an adjacent update. What part of the construction did training leave unspecified?
Did the denoiser ever observe how the whole Markov chain was connected?
Did training observe complete trajectories?
Write the simple denoising objective again:
Each example samples one clean image, one time, and one noise. Intermediate states are never calculated. Training observes noisy snapshots:
It does not observe a whole path from the forward joint.
Aerial photographs of a dispersing crowd at several times show how many people occupy each street, without identifying the same person across photographs. Many cross-time assignments could fit the same snapshots.
Keep the snapshots, but redefine their cross-time pairing.
Preserve snapshots while redrawing their connections
During generation we only know . The reverse law we want to model has the form
The denoiser already estimates the clean posterior mean. To construct a new connection, first ask the easier question: if both and were known, how could we generate ?
Different choices of define different pairings.
These pairings must preserve the required noisy marginals.
The clean-data law is fixed, and
so preserving suffices. Integrating out must recover
We need a directly sampleable conditional satisfying that constraint.
Given the origin and present state, recover a reusable Gaussian marker:
Here denotes the accumulated standardized residual at time , not the individual transition noise from the earlier DDPM notation. Its conditional law given is standard Gaussian.
To preserve noise variance at , reuse part of this marker and fill the remaining variance with fresh independent Gaussian noise.
Choose , draw independent , and define
The second term reuses the residual and the third adds new randomness. This changes the coupling; the original Markov chain does not generally share the same residual across times.
Independence makes the total noise variance
The mean and variance therefore recover the original conditional marginal:
Given both and , only the newly drawn remains random, so
The new forward/inference joint is generally non-Markovian, because this conditional still depends directly on . This does not mean the reverse network needs the entire sampling history.
SupplementWhy can we reuse the denoiser?
Substitute the clean-data identity into the conditional mean and define
The target conditional and reverse model then take the forms
The new variational objective again decomposes into transition KL terms, plus boundary terms:
Their Gaussian covariances agree; their means differ only through the true versus predicted noise. Hence
The schedule-dependent coefficient is positive, giving
Thus these variational objectives reduce to weighted denoising MSE. The ordinary Gaussian-KL derivation assumes positive ; deterministic sampling is considered as a limit.
Positive time weights leave the ideal fixed-time predictor unchanged.
Training determines an optimal denoiser for each snapshot without uniquely determining the cross-time joint. The same denoiser can therefore be reused, although finite-step plug-in sampling is still approximate.
Follow the new connections backward
Generation cannot inspect . Instead use the denoiser’s prediction
Substitute the clean-data identity and replace hidden noise by its prediction:
The update now needs only the current state, its predicted noise, and optional fresh noise.
To check that this includes DDPM, set and choose
Using the schedule identities, the coefficients simplify to
and the update becomes
the familiar DDPM update. Preserving marginals does not require choosing only that coupling.
Setting instead gives
This is deterministic given the current state and score estimate. Infinitesimal steps lead to the ODE described below.
We are not asserting that DDPM’s hidden noise is identical at two times. We have defined a new joint. After reaching , we evaluate the network again rather than retaining the first prediction forever.
Given the initial noise draw, the entire trajectory is now deterministic. Song, Meng, and Ermon [2] call this construction a Denoising Diffusion Implicit Model (DDIM).
We may choose a shorter timestep subsequence
and generate along its reverse order.
NotationThe usual eta parametrization
The literature commonly writes
gives deterministic DDIM. With the full adjacent schedule, recovers DDPM posterior variance. On a skipped schedule, it defines a stochastic shortened sampler rather than the original full chain.
Compare the two routes
Interactive demo. Both panels use the same exact mixture score and initial samples. Adjust and the number of steps. Removing fresh noise smooths trajectories; reducing steps reveals finite-step errors. Equal ideal marginals do not guarantee identical finite-step endpoints, and deterministic paths can still bend.
The exact-score setting removes neural estimation error. The lab adds learned scores to examine that separate source of error.
Move from a fixed grid to continuous time
DDIM can skip scheduled levels. To separate distribution evolution from the computational grid entirely, we turn to continuous dynamics.
Refine the timestep toward zero and identify the limiting rule.
Write corruption as continuous motion
Divide a unit time interval into pieces of width . Noise per step must shrink with the interval, so replace discrete by .
The forward transition becomes
where is fresh Gaussian noise. For small ,
subtracting the current state gives
The noise scales as because independent variances add. After steps, total variance remains order one. Scaling noise by would make its accumulated variance vanish.
Define
a Brownian increment. Passing to the continuous limit gives
The drift shrinks toward the origin and the diffusion injects Gaussian noise, retaining the same forward construction without a fixed grid.
Drift describes systematic motion; diffusion describes injected randomness. For VP,
The score alone does not determine reverse dynamics. It gives a local log-density gradient, while the forward noise intensity determines how strongly that information enters the reverse rule.
How does the score reverse time?
Under suitable regularity, Anderson [3] gives a reverse-time SDE with a score correction:
The forward drift and noise scale combine with the learned score. Here time runs backward, so the sign of must be interpreted accordingly.
Song and colleagues [4] give a deterministic ODE with the same single-time marginals under exact scores and suitable regularity:
The score coefficient in the ODE is half the reverse-SDE coefficient.
NotationThe general forward and reverse equations
The equations above substitute the VP schedule. More generally, for a linear forward drift,
the reverse SDE and probability-flow ODE are
denotes the process followed backward, is the learned score, and is reverse-time Brownian motion. A general nonlinear drift can be written ; here suffices.
For VP, and . Other forward processes change these coefficients while retaining the structure. U2.4 develops a common interpolation framework.
SupplementWhere did half the score correction go?
In the Fokker–Planck equation (M3.2), diffusion can be rewritten as a divergence:
This lets us represent diffusion through a score-dependent drift. Removing stochastic diffusion while adjusting drift preserves density evolution.
Substitution combines the terms into
The velocity is the probability-flow ODE field. This is a continuity equation: density changes through incoming and outgoing mass flux .
The equal marginals follow from the same density-evolution equation, rather than identical sample paths. U2.1 uses this logic to construct a velocity for a prescribed path.
U2.4 extends this exchange into a family of stochastic samplers.
Compare the three constructions:
| Forward SDE | Reverse SDE | PF-ODE | |
|---|---|---|---|
| Direction | |||
| Marginals | Same path, reversed | Same path, reversed | |
| Individual trajectory | Random | Random | Deterministic given its start |
| Discrete connection | Forward corruption | DDPM | Deterministic DDIM |

Figure: equal marginals, different paths. Equality concerns the population distribution, not whether a particular initial point reaches the same endpoint.
In the VP continuous limit, DDPM connects to the reverse SDE and deterministic DDIM to the PF-ODE. Exact numerical forms depend on coordinates. The network supplies the score, dynamics specify motion, and the numerical method approximates it on a grid.
A sampler combines dynamics and a numerical method
Choose reverse dynamics, then a timestep grid and solver. The number of computational steps is a numerical choice.
Keep two errors separate: Gaussian approximation of a mixture reverse kernel, and numerical discretization of continuous dynamics. They have different definitions even when larger steps worsen both.
Equal continuous-time marginals do not imply equal finite-step quality. Euler freezes velocity within a step; SDE solvers also approximate drift and stochastic effects. The balance between score error and numerical error determines the practical comparison.
Gaussian corruption, a Gaussian prior, and a schedule are design choices. U2.0 asks how to construct paths with more freedom.
Check your understanding
References
- Ho, J., Jain, A., Abbeel, P. Denoising Diffusion Probabilistic Models. NeurIPS 2020.
- Song, J., Meng, C., Ermon, S. Denoising Diffusion Implicit Models. ICLR 2021.
- Anderson, B. D. O. Reverse-time diffusion equation models. 1982.
- Song, Y., et al. Score-Based Generative Modeling through Stochastic Differential Equations. ICLR 2021.
- Lai, C.-H., et al. The Principles of Diffusion Models. 2025, Section 4.1.