Flow Matching / Rectified Flow
Flow Matching2023 · Meta AI / FAIR & UT AustinStraight-line ODE probability transport between Gaussian noise and data
Intuition & Key Idea
ELI5 GuideWhy this model was invented and how it transforms generation
"Moves random noise particles straight into realistic images or audio along smooth, optimal straight-line paths, cutting generation steps down by 80%."
A high-speed bullet train traveling along a straight, direct railway track — compared to standard diffusion which wanders down a random zigzagging mountain path.
Constant velocity vector fields minimize transport cost.
Fast numerical ODE solvers (Euler, Midpoint, RK4) advance rapidly.
Straight lines make 1-step student distillation trivially accurate.
The dominant modern standard for state-of-the-art visual generation.
1. Initialize Initial Condition x(0) ~ 𝒩(0, I)
Draw sample x(0) from standard normal distribution at time t = 0.
Unlike diffusion which counts backward from T to 0, Flow Matching integrates forward from 0 to 1.
Flow Matching transports probability mass along straight-line vector fields dx/dt = v_θ(x, t). Because the ODE path has zero curvature, simple numerical solvers (like Euler) reach the data distribution in far fewer steps.
GPU Memory Hierarchy & HBM Traffic for this Step
HBM ↔ SRAM on-chipWeights are loaded from High-Bandwidth Memory (HBM) into Streaming Multiprocessor (SM) registers and SRAM cache for computation.
Active Tensor Dimensions & Memory Shapes
The modern standard for state-of-the-art vision and audio generation (powers Stable Diffusion 3, Flux.1, and Voicebox), offering simpler mathematical foundations and faster sampling than classical diffusion.
Training Objective:Conditional Flow Matching Loss: 𝔼_{t, x_0, x_1}[ ||v_θ(x_t, t) - (x_1 - x_0)||^2 ]
Inference Bottleneck:O(K) Euler/Heun ODE steps (as few as 4–20 steps)
Foundational & Breakthrough Papers for Flow Matching / Rectified Flow
Flow Matching for Generative Modeling
Lipman, Chen, Ben-Hamu, Nicklas, Le (Meta AI / Weizmann)
Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow
Liu, Gong, Liu (UT Austin)
Scaling Rectified Flow Transformers for High-Resolution Image Synthesis (SD3)
Esser et al. (Stability AI)