Particles, densities and principles
In the dynamic transport section every particle followed a velocity field, and its path was smooth. In the Brownian motion section particles moved at random, and the density still changed smoothly in time. This section asks whether deterministic dynamics can reproduce the densities of a random process. The answer needs three levels of description kept apart.
This section works at the first two levels and ends with a measurement at the third: the kinetic action of the density path. The next section supplies the principle that diffusion follows.
The running example
The data distribution is the Gaussian mixture of the probability transport chapter, with weights , means and standard deviations . The forward process is the Ornstein-Uhlenbeck process of the Brownian motion section, so the drift is , the noise level is and the diffusion coefficient is . At each fixed , has the same distribution as with independent of . The density is therefore again a mixture of three Gaussians. Component keeps its weight, has mean and has variance . This statement holds in distribution at each time separately, so paths below are built step by step, as in the drift part of the Brownian motion section. Because is a mixture in closed form, so are its time derivative and its score . The quantile function comes from bisection on the closed-form CDF. Everything else on this page is numerical, and each place says how it was computed: particle paths come from integrator steps, distances between samples and densities from Monte Carlo, and actions from quadrature on a grid.The horizon
The Ornstein-Uhlenbeck process reaches only as . Its distance to that limit shrinks at a known rate: The horizon is the smallest whole number at which this bound falls below . The bound and the computed distance at each whole up to follow.Diffusion time and transport time
This page uses the diffusion convention: data at and noise at . The probability transport chapter ran the other way, from noise at to data at . The two clocks are related by The transport chapter’s , the noise, is here, and its , the data, is here. Every figure on this page puts data on the left and noise on the right, so the transport chapter’s figures read in the opposite direction. The DDPM and DDIM sections use the variance-preserving SDE . With the clock it becomes the Ornstein-Uhlenbeck process used here, so every result on this page carries over to those sections after a change of clock.The Fokker-Planck equation
Conservation of mass gives an equation for by the interval argument of the dynamic transport section. Let be the rate at which mass crosses from left to right. The mass in changes only through the two ends, so This holds for every interval, so at every point. Conservation alone says nothing about what is. The Brownian motion section supplied that: the drift carries mass with flux , and unbiased random steps carry mass down the gradient with the Fick flux . Their sum gives the Fokker-Planck equation, For the Ornstein-Uhlenbeck process it reads . The closed-form should satisfy this equation. On the left, the analytic time derivative is taken through the moving means and variances of the components. On the right, the -derivatives are analytic too. The integrated residual and the total mass are computed on , at and .Drift, score and probability flow velocity
Pull out of the total flux: The flux now has the form of the continuity equation, with the velocity The Fokker-Planck equation is the continuity equation for this field. Particles that follow the ordinary differential equation from samples of therefore have density at every time, the same as the particles of the SDE. This ODE is the probability flow ODE (Song et al., 2020). Three different quantities appear here.
In deterministic transport the drift and the velocity are the same thing. With noise they differ by times the score. For a mixture, the score is a weighted sum of the component scores, with weights equal to the probability that came from each component. Computed this way it stays finite far in the tails, where itself is too small to divide by.
The same velocity has a second description. At each fixed time, has the distribution of with and . A point on this interpolation moves with velocity . Average that velocity over all pairs that pass through at time :
Within one component, , and are jointly Gaussian, so the conditional means of and are linear in . Weighting them by the component probabilities gives in closed form. Below, is compared with at and , wherever .
Equilibrium
The simplest case shows the difference between drift and velocity. For the score is , so The density stands still while each particle keeps moving under . At every point the drift flux , which points toward the origin, cancels the diffusive flux , which points away from it. The rotation field of the velocity fields section is the deterministic analogue: there too the particles move while a rotationally symmetric density stays still. Two quantities confirm this: the general score function evaluated on , and the velocity of the mixture path at , where equals to within .
Same marginals, different couplings
The SDE and the probability flow ODE are two members of a family. For every , Its drift flux is and its diffusive flux is . Since , they add up to for every . The flux is the same, so the Fokker-Planck equation is the same, and every member started from has the same density at every time. The value gives the forward SDE and gives the probability flow ODE. The simulation starts 2000 samples of and moves the same samples under , and . For each step uses the exact Ornstein-Uhlenbeck transition. For the other two, each step is an Euler-Maruyama step of length with the exact score. If the marginals agree, the empirical distance from the particles to the closed-form should be about as small as the distance of 2000 independent exact samples of . That second distance, averaged over 20 draws, is the sampling baseline: the distance that sampling alone produces.

Running the flow backward
The probability flow ODE is deterministic, so it can be run from back to . Start from samples of , integrate backward with 400 fourth-order Runge-Kutta steps, and the samples should arrive distributed as the mixture . This is the deterministic sampler of diffusion models. A generative model starts from instead of and learns the score instead of computing it; here both are exact, so only the integrator can introduce error. The DDIM section uses the same idea. Deterministic DDIM () is a discretization of the probability flow ODE of the variance-preserving SDE, in the clock defined in the section on diffusion time.
Kinetic action of the density path
The dynamic transport section measured a path by its kinetic action. On this page the action belongs to the density path and its velocity . It does not belong to Brownian trajectories, which are nowhere differentiable. The discrete estimate for the forward SDE grows like , without limit as the step shrinks. One exact step of the forward SDE, started from samples of at , shows the growth.The endpoint map is the optimal map
The probability flow keeps particles in order, so its endpoint map is the increasing map . The 1D mixture section showed why an order-preserving flow ends at the optimal map on the line. Below, the flow is integrated forward from 99 quantile levels in , the endpoints are compared with , and the integration is repeated with half the step.The excess, exactly
Write for the quantile function of . The particle at level sits at , so . The change of variable turns into , and the action becomes The geodesic between and moves every quantile at constant speed, , and (Santambrogio, 2015). Expand the square below and use : The excess action is the mean squared gap between the quantile speed and the constant geodesic speed. It is zero only when every quantile moves at constant speed. Numerically, is evaluated on 1000 midpoint levels in and 801 times, spaced more densely near , and comes from central differences. The integrals cover only. Both and are truncated to the same range, so the inequality and the identity hold for the truncated quantities as well.

From velocity to free energy
Diffusion does not take the geodesic, so the principle of least action does not explain the path it follows. The velocity appears again in the next section, as the gradient of a free energy. That section shows that the Ornstein-Uhlenbeck path is the steepest descent of that free energy in the Wasserstein geometry.Numerical checks
The checks below list the integrated Fokker-Planck residual and the mass at each check time, and the distances for the three values of beside their sampling baseline. They also compare the finite-difference quantile speed with the exact velocity away from , and give the path-length split. With the length of the path of quantile , the Cauchy-Schwarz inequality in and then the triangle inequality give The first gap is positive when a quantile moves at uneven speed. The second is positive when a quantile reverses direction along the way.References
- Albergo, M., Boffi, N., Vanden-Eijnden, E. (2023). Stochastic interpolants: A unifying framework for flows and diffusions. arXiv [cs.LG]. DOI
- Benamou, J., Brenier, Y. (2000). A computational fluid mechanics solution to the Monge-Kantorovich mass transfer problem. Numer. Math. (Heidelb.). DOI
- Santambrogio, F. (2015). Optimal transport for applied mathematicians – calculus of variations, PDEs and modeling.
- Song, Y., Sohl-Dickstein, J., Kingma, D., Kumar, A., Ermon, S., et al. (2020). Score-based generative modeling through stochastic differential equations. arXiv [cs.LG]. DOI
Found an error on this page? Report an issue.

