Back to Blog
diffusion-modelsflow-modelsresearch

From Diffusion Models to Flow Matching: The Evolution

How the field evolved from score-based diffusion to flow matching — understanding the mathematical thread connecting these approaches.

ML for Everyone TeamMay 15, 202615 min read

A Brief History

The journey from diffusion models to flow matching represents one of the most elegant simplifications in modern generative modeling. Let's trace the mathematical evolution.

Score-Based Diffusion (2020-2021)

The key insight: if you can estimate the score function \nabla_x \log p_t(x) at each noise level, you can generate samples by running a reverse-time SDE:

dx = [f(x,t) - g(t)^2 \nabla_x \log p_t(x)]\, dt + g(t)\, d\bar{w}

This works beautifully but requires careful noise schedule design and many sampling steps.

The ODE Perspective (2022)

Song et al. showed that every diffusion SDE has a corresponding probability flow ODE:

dx = \left[f(x,t) - \frac{1}{2}g(t)^2 \nabla_x \log p_t(x)\right] dt

This opened the door to deterministic sampling and connections to normalizing flows.

Flow Matching (2023+)

Flow matching simplifies everything dramatically. Instead of learning a score function through denoising, you directly learn a velocity field that transports noise to data:

\frac{dx}{dt} = v_\theta(x, t)

The training objective becomes:

\mathcal{L} = \mathbb{E}_{t, x_0, x_1} \|v_\theta(x_t, t) - (x_1 - x_0)\|^2

where x_t = (1-t)x_0 + tx_1 is a simple linear interpolation.

Why Flow Matching Wins

  • Simpler training: No noise schedules, no score matching tricks
  • Straighter paths: Linear interpolation creates nearly straight trajectories
  • Fewer steps: Straight paths need fewer ODE solver steps
  • Flexible: Works with any source distribution, not just Gaussian noise
  • The Unifying View

    All these approaches are instances of learning transport maps between distributions. The mathematics of optimal transport provides the unifying framework — and understanding it deeply reveals why certain design choices work better than others.