Skip to content
AI360Xpert
Beta

Reverse-Time SDEs

Running a noising diffusion backwards generates data from noise. The reverse drift subtracts the score, turning pure Gaussian samples into the data distribution step by step.

Fifty reverse steps shrink noise of variance 1.0 into data clustered within 0.12 of the mean
Fifty reverse steps shrink noise of variance 1.0 into data clustered within 0.12 of the mean

Why Does This Exist?

Forward noising destroys structure: data plus growing Gaussian noise ends at pure noise with the data forgotten. Generation needs the inverse trip from noise to data, but naive time reversal of paths is not an SDE with the same noise: the backwards drift must compensate for the information the forward run discarded. Without that compensation, backward simulation drifts off-manifold into grey soup.

Anderson's reverse-time formula gives the correction: run time backwards with drift f−g2∇log⁡ptf - g^2 \nabla \log p_t (forward drift minus volatility squared times score, the gradient of the log density). Learned scores plug in, and discretised reversals become DDPM and score-SDE samplers. Diffusion processes give the forward mixing; Fokker-Planck tracks its marginals whose scores steer the return.

Prerequisite in one paragraph. You need the forward SDE dx=f dt+g dWdx = f\,dt + g\,dW with marginals ptp_t and the score ∇log⁡pt\nabla \log p_t pointing toward higher density. Time reversal exchanges initial and terminal laws. Background is in Brownian motion and stochastic differential equations.

Think of It Like This

Rewinding a film of ink in water

Play ink dispersing in water backwards and blobs reform: spread wisps gather, drift reverses, diffusion un-spreads. The rewind works only because each frame remembers the concentration gradient: ink flows back up the slope it slid down. Delete the gradient and the rewind just jitters.

The score is that gradient memory. Reverse SDEs rewind noise into data by climbing the log-density slope at each noise level while fresh backward noise keeps diversity. The probability-flow ODE is the same rewind with noise muted for speed.

Where the analogy stops: films rewind deterministically while reverse SDEs stay stochastic with backward Brownian motion. Learned scores also err, and errors compound down the slope the film never misremembers.

How It Actually Works

Forward dx=f(x,t) dt+g(t) dWtdx = f(x,t)\,dt + g(t)\,dW_t with marginals ptp_t reverses as dx=[f(x,t)−g(t)2∇xlog⁡pt(x)] dt+g(t) dWˉtdx = [f(x,t) - g(t)^2 \nabla_x \log p_t(x)]\,dt + g(t)\,d\bar{W}_t running backwards, where Wˉ\bar{W} is backward Brownian motion. The −g2∇log⁡pt-g^2 \nabla \log p_t term pulls toward density ridges, countering forward spread. The deterministic probability-flow ODE dx=[f−12g2∇log⁡pt] dtdx = [f - \frac{1}{2}g^2 \nabla \log p_t]\,dt shares the marginals with half the pull and no noise.

Worked example

Forward OU dx=−x dt+2 dWdx = -x\,dt + \sqrt{2}\,dW from data mean 3.03.0 reaches N(0,1)N(0,1) noise by t=3t = 3. Reverse from N(0,1)N(0,1) with true score ∇log⁡pt(x)=−(x−mt)/vt\nabla \log p_t(x) = -(x - m_t)/v_t (Gaussian conditional mean mtm_t, variance vtv_t) over 5050 Euler steps of 0.060.06 returns mean 2.942.94 and variance matching data within 0.020.02: error 0.060.06 on the mean, diagram 0.120.12 with learned-score slack. Each step moves about 0.06×(x+score pull)0.06 \times (x + \text{score pull}) plus 0.06≈0.245\sqrt{0.06} \approx 0.245 noise, the pull dominating early and noise relatively larger late, which is why schedules spend steps near t=0t = 0.

Score error ε\varepsilon per step accumulates like TεT\varepsilon: ε=0.01\varepsilon = 0.01 over 5050 steps allows 0.50.5 drift, so Lipschitz and step-count control matter as much as score MSE.

Watch Out For

Reversing with the forward drift sign unchanged

Running ff instead of f−g2∇log⁡ptf - g^2\nabla \log p_t backwards double-counts spread: paths explode outward from noise instead of condensing. Samples look over-dispersed with variance near 2.02.0 instead of data variance, a signature of the missing pull.

Fix: subtract the full g2g^2 score in the SDE, half in the ODE. Verify one Gaussian round trip before learned scores.

Using too few steps near zero noise

Scores blow up like 1/σt1/\sigma_t near t=0t = 0 while steps stay coarse: discretisation error dominates exactly where detail forms. Fifty uniform steps blur fine structure that 200200 with a dense low-noise grid resolve.

Fix: schedule densely near zero (strided, cosine or learned grids). Count low-noise steps separately.

The Quick Version

  • Reverse SDEs generate by running forward noising backwards with drift minus volatility squared times score.
  • Fifty steps from unit noise return within 0.12 of the data mean with matched variance in the example.
  • The probability-flow ODE halves the pull and drops noise while keeping marginals.
  • Score errors accumulate linearly in steps, so step count and Lipschitz control matter.
  • Never reuse forward drift signs and never starve low-noise steps.