Math recap: the Wiener process
A standard Wiener process on is a continuous-time stochastic process satisfying:- Independent increments: for , , independent of the path up to time
- Continuous paths
Brownian motion in motion
Eight particles start at the origin and trace independent random walks. The trail behind each particle is its history: short trajectories stay near the origin on either side, and the cloud widens the longer the walk runs.Eight Brownian trajectories
Eight particles released from the origin, each undergoing an independent random walk over 500 steps with and . The colored end-dots mark each trajectory’s final position; the black dot at the origin marks the common start.Code
Code

Snapshot grid of the Wiener process
200 fresh particles released from the origin, snapshotted at , the step indices the DDPM tutorial uses for its forward-noising visualization. These are Wiener snapshots at those indices, not DDPM marginals. The cloud spreads with variance proportional to , whereas the DDPM marginal variance saturates, as the drift section below shows.Code
Code

Diffusion flux from unbiased steps
Put particles on a line with spacing . In each time step , every particle moves one site to the left or one site to the right, with probability one half each. The mean step is zero, so no particle prefers a direction. Now count the particles that cross the bond between site and site in one step. Of the particles at site , about step right. Of the particles at site , about step left. On average, the net number crossing from left to right is Where the density falls from left to right, and the net crossing is positive. Mass moves down the gradient even though every step is unbiased. To take the continuum limit, write for particles with density . For small the net crossing per step becomes . Each step has variance . Brownian motion with noise scale (the above) has , so , and the net crossing per step is . The diffusion flux is therefore Fick’s law, Take particles started from a smooth, decreasing profile (a logistic step on ) with and , so that . Draw the random steps for every bond and compare the net crossing count with .Code
Code
Code
Code

Adding a drift
A drift adds a second way to move mass. The stochastic differential equation moves each particle by on average, on top of the random part. The drift carries density with the local velocity , so it adds the flux . The total flux is the sum of the two terms, The next section turns this flux into an equation for . First, the drift acting on paths. The running example uses and , so . This is the Ornstein-Uhlenbeck process. Started from a point , its position at time is Gaussian with mean and variance . The mean decays to zero and the variance rises to 1, which is the variance of . The position has the same distribution as with at each fixed . This holds at each fixed separately: reusing a single for every would not give Ornstein-Uhlenbeck paths. Paths are built step by step from the exact transition Simulate 20000 paths from and compare the sample mean and variance at four times with the exact values.Code
Code
Code
Code

Connection back to diffusion
Continuous-time diffusion frames the forward process as the SDE where is exactly the Brownian motion above. The variance-preserving SDE used by DDPM picks and , so the variance stays bounded. Only the transition is Gaussian. The marginal remains a mixture at every finite and approaches a Gaussian only as grows. The discrete chain of the DDPM tutorial is the exact Ornstein-Uhlenbeck transition of the drift section, not an Euler-Maruyama approximation of it. A DDPM step equals with . Step therefore sits at Ornstein-Uhlenbeck time , where . The forward process is Brownian motion plus a drift. The reverse direction uses the score. The network estimates , and the score at step is with . This equals the Ornstein-Uhlenbeck at . The reverse-time drift follows from this score, and deterministic DDIM is the probability flow ODE limit. The two sections above give the total flux with : a drift term that carries density and a diffusion term that spreads it. The next section, Fokker-Planck and the probability flow ODE, uses conservation of mass to turn into the Fokker-Planck equation.References
- Anderson. Reverse-time diffusion equation models. Stochastic Processes Appl. 1982.
- Song et al. Score-Based Generative Modeling through Stochastic Differential Equations. ICLR 2021. arxiv.org/abs/2011.13456
- Karatzas & Shreve. Brownian Motion and Stochastic Calculus. Springer 1991. (textbook)
Found an error on this page? Report an issue.

