Skip to content
AI360XpertBeta

Diffusion Processes

Continuous Markov paths with drift plus noise. Their generators, time scales and stationary laws decide how fast samplers mix and how diffusion models noise data.

Two Langevin paths from opposite starts 8 apart shrink to a gap of 2.94 at time 1 and 1.08 at time 2, then wander jointly inside the stationary width
Two Langevin paths from opposite starts 8 apart shrink to a gap of 2.94 at time 1 and 1.08 at time 2, then wander jointly inside the stationary width

Why Does This Exist?

Langevin sampling, diffusion noising, and stochastic optimisation all run diffusions of the form dX=−∇V dt+2 dWdX = -\nabla V\,dt + \sqrt{2}\,dW, where VV is the potential shaping the landscape, ∇V\nabla V its gradient (drift direction), and dWdW is Brownian noise. Practitioners set step counts, noise scales, and temperatures by feel. Without mixing theory those choices are blind: too few steps leave bias, too many waste compute, and the wrong temperature targets the wrong law.

Diffusion process theory gives the dials. The generator encodes local motion, the stationary density is proportional to exp⁡(−V)\exp(-V), and curvature (convexity of VV) sets exponential contraction rates. Coupling arguments turn curvature into wall-clock mixing times. Stochastic differential equations define the paths and Fokker-Planck tracks their densities; here the focus is the long-run behaviour samplers live on.

Prerequisite in one paragraph. You need the Markov property (the future depends only on now) and the stationary density π∝exp⁡(−V)\pi \propto \exp(-V), meaning the long-run law puts mass where VV is low. Strong convexity means VV curves upward at least quadratically. Background is in Markov chains and Brownian motion.

Think of It Like This

Two leaves in a funnel with shaking

Drop two leaves on opposite rims of a funnel and shake the table. Both slide down, jitter sideways, and soon swirl together at the neck. After merging they move jointly: same region, same spread, past starts forgotten. Steeper funnels merge faster; flat trays never merge.

Diffusions couple the same way. Drift funnels paths together, noise shakes them, and curvature is steepness. The merged law is stationarity; the merge time is mixing.

Where the analogy stops: leaves collide physically while couplings are mathematical joint constructions. Multimodal potentials are multi-funnel trays where crossings take exponential time, which one funnel hides.

How It Actually Works

Langevin diffusion dX=−∇V dt+2 dWdX = -\nabla V\,dt + \sqrt{2}\,dW has stationary law π∝e−V\pi \propto e^{-V} and generator Lf=−∇V⋅∇f+ΔfLf = -\nabla V \cdot \nabla f + \Delta f, where LfLf gives the expected local rate of change of any test function ff and Δf\Delta f is its Laplacian (sum of second derivatives, the noise contribution). If VV is α\alpha-strongly convex, meaning its curvature is at least α\alpha everywhere, two coupled paths sharing the same noise contract as:

E[∥Xt−Yt∥2]≤e−2αt E[∥X0−Y0∥2]E[\lVert X_t - Y_t \rVert^2] \le e^{-2\alpha t}\,E[\lVert X_0 - Y_0 \rVert^2]

In plain words: the mean squared gap shrinks exponentially at rate 2α2\alpha. The distance halves every ln⁡2/(2α)\ln 2/(2\alpha) time units.

Worked example

Take V(x)=x2/2V(x) = x^2/2, so α=1.0\alpha = 1.0 (standard Gaussian target). Starts at −4-4 and +4+4 sit 88 apart. Contraction gives RMS gap 8e−t8e^{-t}: at t=1t = 1, 8×0.368=2.948 \times 0.368 = 2.94; at t=2t = 2, 8×0.135=1.088 \times 0.135 = 1.08, inside the stationary standard deviation 1.01.0. Halving time ln⁡2/2≈0.347\ln 2/2 \approx 0.347 units, shown as 0.35 in the diagram. By t=2t = 2 the starts are forgotten and both paths wander in N(0,1)N(0, 1) jointly. Discretised Langevin with step 0.010.01 needs about 200200 steps to mirror this (200×0.01=2200 \times 0.01 = 2 time units) — the sampler budget the theory predicts.

A double-well VV with barrier 88 instead mixes in about e8≈2981e^8 \approx 2981 units: same SDE form, exponentially slower from multimodality.

Code

Every number in the worked example, recomputed directly:

import math
gap0 = 8.0  # starts at -4 and +4for t in (1, 2):    print(t, round(gap0 * math.exp(-t), 2))  # -> 1 2.94, 2 1.08
print(round(math.log(2) / 2, 3))  # -> 0.347  halving time at alpha = 1.0print(round(math.exp(8)))         # -> 2981  double-well crossing timescale

Watch Out For

Assuming convexity mixing on multimodal targets

The e−2αte^{-2\alpha t} rate needs global strong convexity. Mixture targets with separated modes mix by rare barrier crossings, not contraction. Quoting the 0.35 halving time on a two-moon posterior promises 200-step mixing while true runs need millions.

Fix: check modality first. Multimodal targets need tempering, mode-hopping, or exponential-time honesty.

Confusing stationary with converged at finite time

Stationary π\pi is the infinite-time limit. At t=0.5t = 0.5 the gap is still 8e−0.5≈4.858e^{-0.5} \approx 4.85, far from N(0,1)N(0, 1), and sampler averages carry transient bias. Reporting them as stationary samples understates error.

Fix: burn past several halving times (here 22 units) before collecting. Diagnose with coupled gaps, not eyeballed traces.

The Quick Version

  • Langevin diffusions target exp⁡(−V)\exp(-V) with the generator tracking local expected change.
  • Strong convexity 1.01.0 halves coupled distances every 0.350.35 units; opposite starts merge by 22 units.
  • Gaps shrink 8 to 2.94 at time 1 and 1.08 at time 2, inside the stationary width of 1.0.
  • Discretised runs need about 200 steps of 0.010.01 to mirror that mixing.
  • Multimodal barriers replace contraction with exponential crossing times near 29812981 units at barrier 88.
  • Burn past several halving times before treating draws as stationary.