Part XIII — Generative Models: VAEs, Flow Matching, Score Models & Diffusion Transformers · Chapter 8

Continuous-time flow matching

Hook

A diffusion model's noise schedule — how much noise to add at each of dozens or hundreds of steps — is its own small research problem, tuned separately from the model itself. What if the path from noise to data were just... a straight line?

Intuition
x_t = 1.500 at t = 0.50 — velocity = 7 (same at every t)

Drag tt along the path. The velocity readout never changes — a straight line has exactly one slope, everywhere along it, which is the entire simplification this chapter is built on.

Formalize

Flow matching defines the path between a noise sample x0x_0 and a data sample x1x_1 as a straight line, and trains a model to predict that line's velocity:

xt=(1t)x0+tx1,dxtdt=x1x0x_t = (1-t)x_0 + tx_1, \qquad \frac{dx_t}{dt} = x_1 - x_0
  • xtx_t — the point on the path between noise and data at time tt.
  • x0x_0 — the noise sample, the path's starting point (at t=0t=0).
  • x1x_1 — the data sample, the path's endpoint (at t=1t=1).
  • tt — the time parameter, ranging from 00 (pure noise) to 11 (data).
  • dxt/dtdx_t/dt — the velocity along the path: the quantity a neural network is trained to predict.
  1. Velocity is constant along the path

    It doesn't depend on tt at all — it's the same number at t=0.01t=0.01 as at t=0.99t=0.99.

  2. Trained as a plain regression target

    A neural network vθ(xt,t)v_\theta(x_t, t) is trained to regress directly onto x1x0x_1 - x_0 for many sampled pairs — a plain regression target, not a multi-step noise-removal problem.

  3. No schedule, no reverse-process approximation

    There's no schedule to design and no approximation of a reverse diffusion process — just "given where you are and what time it is, which way is data?"

Play

A single Euler step and fifty small ones land in the exact same place. That's not true for a curved path (diffusion's reverse process genuinely curves, which is why it needs many small steps to trace accurately) — it's only true because this path is perfectly straight, with zero curvature to approximate away.

Worked example

Three independent (noise, data) pairs, evaluated at t=0.5t=0.5:

  1. Pair (-2, 5)

    x0.5=0.5(2)+0.5(5)=1.5x_{0.5} = 0.5(-2) + 0.5(5) = 1.5. Velocity =5(2)=7= 5-(-2)=7.

  2. Pair (3, -7)

    x0.5=0.5(3)+0.5(7)=2x_{0.5} = 0.5(3) + 0.5(-7) = -2. Velocity =73=10= -7-3=-10 — a different pair, a completely different constant velocity.

  3. Pair (0, 4)

    x0.5=0.5(0)+0.5(4)=2x_{0.5} = 0.5(0) + 0.5(4) = 2. Velocity =40=4= 4-0=4.

Checkpoint

Find the (x0, x1) pair, among the three candidates, whose position at t = 0.5 is negative.

Pick a pair to try it
Summary
xt=(1t)x0+tx1,vθ(xt,t)x1x0x_t = (1-t)x_0 + tx_1, \qquad v_\theta(x_t, t) \approx x_1 - x_0

Each individual pair's path is a straight line with one velocity — but a real flow-matching model sees many noise-data pairs during training, and at a given (x,t)(x,t) different pairs' paths can pass nearby with different velocities. What the model actually learns is the average velocity across every pair consistent with being at xx at time tt, which is no longer perfectly straight in general — the simplification this chapter isolates is the per-pair target, not the learned field as a whole. The next chapter asks what happens if, instead of one endpoint reached by integrating many small steps, a model is trained to jump straight from anywhere on a path to its endpoint in one shot.