Stochastic Interpolants & Generalized Paths

Unifying diffusion and flow matching through stochastic interpolants: general interpolation frameworks, time-dependent noise injection, bridge processes, and the connection between SDE and ODE generation.

Advanced

Table of Contents

  1. Learning Objectives
  2. Notation
  3. Core Intuition
  4. The Interpolant Framework
  5. Deriving the Velocity Field
  6. Adding Noise: Stochastic Interpolants
  7. Score Function from Interpolants
  8. SDE vs ODE Sampling
  9. Bridge Processes
  10. Unifying Diffusion and Flow Matching
  11. Common Pitfalls
  12. Summary
  13. Exercises

Learning Objectives

  1. Define a stochastic interpolant and derive its velocity field.
  2. Show how noise injection creates an SDE formulation alongside the ODE.
  3. Connect bridge processes to conditional generation.
  4. Prove that diffusion models are a special case of the interpolant framework.
  5. Choose between SDE and ODE sampling based on quality-speed tradeoffs.

Notation

  • It=αtx1+βtx0+σtϵ\mathbf{I}_t = \alpha_t\mathbf{x}_1 + \beta_t\mathbf{x}_0 + \sigma_t\boldsymbol{\epsilon} — stochastic interpolant
  • αt,βt,σt\alpha_t, \beta_t, \sigma_t — interpolation coefficients
  • bt(x)b_t(\mathbf{x}) — drift field
  • σt\sigma_t — diffusion coefficient (noise level at time tt)

Core Intuition

Stochastic interpolants generalize both flow matching and diffusion: define any smooth path between p0p_0 and p1p_1 — deterministic (ODE/flow) or stochastic (SDE/diffusion) — and derive the corresponding training objective. This unification reveals that diffusion and flow matching are the SAME framework with different choices of interpolation coefficients and noise schedules.

Stochastic Interpolants

I(t) = (1-t)p₀ + tp₁ + σ(t)ε
Time t
0.50
Noise σ
0.30
Explore: Stochastic interpolants bridge distributions with controllable noise σ(t). σ→0 gives deterministic paths; σ>0 unifies diffusion and flow matching frameworks.

The Interpolant Framework

General interpolant (Albergo & Vanden-Eijnden, 2023):

It=αtx1+βtx0,(1)\mathbf{I}_t = \alpha_t \mathbf{x}_1 + \beta_t \mathbf{x}_0, \tag{1}

with boundary conditions:

  • α0=0,β0=1\alpha_0 = 0, \beta_0 = 1I0=x0\mathbf{I}_0 = \mathbf{x}_0 (noise).
  • α1=1,β1=0\alpha_1 = 1, \beta_1 = 0I1=x1\mathbf{I}_1 = \mathbf{x}_1 (data).

Linear: αt=t,βt=1t\alpha_t = t, \beta_t = 1-t (standard flow matching).

Trigonometric: αt=sin(πt/2),βt=cos(πt/2)\alpha_t = \sin(\pi t/2), \beta_t = \cos(\pi t/2) (VP-SDE equivalent).

Polynomial: αt=t2,βt=(1t)2/Zt\alpha_t = t^2, \beta_t = (1-t)^2 / Z_t with appropriate normalization.


Deriving the Velocity Field

The conditional velocity field for the interpolant:

ut(xx0,x1)=α˙tx1+β˙tx0.(2)u_t(\mathbf{x}|\mathbf{x}_0, \mathbf{x}_1) = \dot{\alpha}_t\mathbf{x}_1 + \dot{\beta}_t\mathbf{x}_0. \tag{2}

For linear interpolation: ut=x1x0u_t = \mathbf{x}_1 - \mathbf{x}_0 (constant velocity — straight line).

For trigonometric: ut=π2cos(πt/2)x1π2sin(πt/2)x0u_t = \frac{\pi}{2}\cos(\pi t/2)\mathbf{x}_1 - \frac{\pi}{2}\sin(\pi t/2)\mathbf{x}_0 (curved path with varying speed).

Training:

L=Et,x0,x1[vθ(It,t)(α˙tx1+β˙tx0)2].(3)\mathcal{L} = \mathbb{E}_{t, \mathbf{x}_0, \mathbf{x}_1}\left[\|v_\theta(\mathbf{I}_t, t) - (\dot{\alpha}_t\mathbf{x}_1 + \dot{\beta}_t\mathbf{x}_0)\|^2\right]. \tag{3}

Adding Noise: Stochastic Interpolants

Add noise to the interpolant:

It=αtx1+βtx0+σtϵ,ϵN(0,I).(4)\mathbf{I}_t = \alpha_t\mathbf{x}_1 + \beta_t\mathbf{x}_0 + \sigma_t\boldsymbol{\epsilon}, \quad \boldsymbol{\epsilon} \sim \mathcal{N}(0, \mathbf{I}). \tag{4}

Boundary conditions: σ0=σ1=0\sigma_0 = \sigma_1 = 0 (exact at endpoints).

Why add noise?

  1. Smooths the conditional distribution pt(xx0,x1)p_t(\mathbf{x}|\mathbf{x}_0, \mathbf{x}_1).
  2. Helps with mode coverage.
  3. Enables SDE formulation for improved sample quality.

Conditional velocity (with noise):

ut(Itx0,x1)=α˙tx1+β˙tx0+σ˙tϵ.(5)u_t(\mathbf{I}_t|\mathbf{x}_0, \mathbf{x}_1) = \dot{\alpha}_t\mathbf{x}_1 + \dot{\beta}_t\mathbf{x}_0 + \dot{\sigma}_t\boldsymbol{\epsilon}. \tag{5}

Score Function from Interpolants

The score at time tt:

xlogpt(x)=1σt2E[σtϵIt=x]=xE[αtx1+βtx0It=x]σt2.(6)\nabla_\mathbf{x}\log p_t(\mathbf{x}) = -\frac{1}{\sigma_t^2}\mathbb{E}[\sigma_t\boldsymbol{\epsilon} | \mathbf{I}_t = \mathbf{x}] = -\frac{\mathbf{x} - \mathbb{E}[\alpha_t\mathbf{x}_1 + \beta_t\mathbf{x}_0 | \mathbf{I}_t = \mathbf{x}]}{\sigma_t^2}. \tag{6}

This connects to the denoising score matching objective: predict the noise ϵ\epsilon that was added.


SDE vs ODE Sampling

ODE (deterministic): Solve dx/dt=vθ(x,t)d\mathbf{x}/dt = v_\theta(\mathbf{x}, t). Same sample for same initial noise.

SDE (stochastic): Add noise during sampling:

dx=[vθ(x,t)+σt22logpt(x)]dt+σtdWt.(7)d\mathbf{x} = \left[v_\theta(\mathbf{x}, t) + \frac{\sigma_t^2}{2}\nabla\log p_t(\mathbf{x})\right]dt + \sigma_t d\mathbf{W}_t. \tag{7}

Quality tradeoff:

  • ODE: Faster (fewer steps), deterministic, slightly lower quality.
  • SDE: Slower, stochastic, better mode coverage (noise corrects errors).
  • In practice: ODE with 20-50 steps ≈ SDE with 100-200 steps in quality.

Bridge Processes

Diffusion bridge: A process conditioned to start at x0\mathbf{x}_0 and end at x1\mathbf{x}_1:

dxt=x1xt1tdt+σdWt.(8)d\mathbf{x}_t = \frac{\mathbf{x}_1 - \mathbf{x}_t}{1-t}dt + \sigma d\mathbf{W}_t. \tag{8}

Uses:

  • Image-to-image translation (start at source, end at target).
  • Inpainting (bridge from masked to unmasked).
  • Style transfer.

Connection to interpolants: A Brownian bridge is a stochastic interpolant with specific αt,βt,σt\alpha_t, \beta_t, \sigma_t.


Unifying Diffusion and Flow Matching

VP-SDE (DDPM) as a stochastic interpolant:

  • αt=αˉt\alpha_t = \sqrt{\bar{\alpha}_t}, βt=0\beta_t = 0, σt=1αˉt\sigma_t = \sqrt{1-\bar{\alpha}_t}.
  • Special case: x0\mathbf{x}_0 is not the noise endpoint but ϵ\boldsymbol{\epsilon}.

Flow matching (linear) as interpolant:

  • αt=t\alpha_t = t, βt=1t\beta_t = 1-t, σt=0\sigma_t = 0.
  • Deterministic (no noise injection during interpolation).

Unified training: Same network architecture, same training procedure. Only the coefficients (αt,βt,σt)(\alpha_t, \beta_t, \sigma_t) differ.

Implication: There's no fundamental distinction between "diffusion models" and "flow models" — they're different scheduling choices in the same framework.


Common Pitfalls

Pitfall 1. Using the linear interpolant for tasks that need the VP-SDE schedule. For high-resolution image generation, the VP schedule's aggressive noise injection at early times helps with mode coverage.

Pitfall 2. Confusing the noise in the interpolant (σtϵ\sigma_t\boldsymbol{\epsilon}) with the sampling noise (SDE). The interpolant noise is for training; the SDE noise is for inference.

Pitfall 3. Not matching the sampling schedule to the training schedule. If trained with linear interpolation, sample with the corresponding ODE — not with the VP-SDE sampler.


Summary

  • Stochastic interpolants unify diffusion and flow matching.
  • General form: It=αtx1+βtx0+σtϵ\mathbf{I}_t = \alpha_t\mathbf{x}_1 + \beta_t\mathbf{x}_0 + \sigma_t\boldsymbol{\epsilon}.
  • Velocity field derived analytically from the interpolant coefficients.
  • SDE vs ODE: Trade speed for quality via noise during sampling.
  • Bridge processes extend to conditional generation (image translation).
  • Diffusion and flow matching are the SAME framework, different (α,β,σ)(\alpha, \beta, \sigma).

Exercises

Exercise 1. Derive the conditional velocity for the trigonometric interpolant αt=sin(πt/2)\alpha_t = \sin(\pi t/2), βt=cos(πt/2)\beta_t = \cos(\pi t/2).

Exercise 2. Show that the VP-SDE objective ϵθϵ2\|\epsilon_\theta - \epsilon\|^2 is equivalent to a stochastic interpolant velocity matching loss (derive the reparameterization).

Exercise 3. For a Brownian bridge with σ=0.1\sigma=0.1: derive the drift and compare to the deterministic interpolant.

Exercise 4. Prove that ODE and SDE sampling converge to the same marginal p1p_1 in the limit of infinite steps.

Exercise 5. Design a custom interpolant schedule (αt,βt,σt)(\alpha_t, \beta_t, \sigma_t) optimized for text-to-image generation. Justify your choices.