distillation / lessons / 06 · rectified flow & the map lesson 6 / 6

Rectified flow & the decision map

Lessons 03–05 amortize the integral of a curved teacher ODE. A different idea: make the ODE straight in the first place, so one Euler step is already exact. Then the whole diffusion-distillation field on one map.

The other lever: change the path, not just the solver

Every method so far accepts the teacher’s curved probability-flow trajectory (generative lesson 16) and works hard to leap across its bends — progressive distillation strides across two steps, consistency models jump to the origin, DMD matches the distribution. But the difficulty was the curvature: a straight trajectory needs no leaping, because Euler’s method is exact on a straight line. So instead of distilling a curved path into few steps, re-train the path to be straight.

Rectified flow and the reflow operation

Rectified flow (Liu et al. 2022) defines the generative process as flow matching along the straight-line interpolation between noise and data (generative lesson 05): xt = (1−t)·x0 + t·ε, with the network regressing the constant velocity ε − x0. But individual sample paths still bend, because many straight noise→data lines cross, and the learned velocity at a crossing is the average of the conflicting directions — a curved effective trajectory.

The fix is reflow, and it is a distillation operation. Generate paired data with the current model: sample noise z, run the full sampler to get its image x = \text{sampler}(z). Now re-train a new flow on these (z, x) pairs — but pairing each noise with the specific image it actually produces. Because the endpoints are now coupled, the straight lines between them stop crossing, so the new model’s trajectories are straighter. Repeat (2-reflow, 3-reflow) and the paths approach perfectly straight, at which point one Euler step reproduces the multi-step output. InstaFlow reflows Stable Diffusion to a genuinely one-step generator.

The intuition: untangle the threads, then one snip

Picture noise points on the left, data points on the right, joined by elastic threads. Flow matching pulls every point along the local average of all threads passing nearby — where threads cross, that average bends, so a sample follows a curved route. Reflow re-pairs each noise point with the exact data point its own route reached, then re-lays the threads. Re-paired threads cross far less, so the new local-average field is nearly straight. Do it again and the threads are parallel — now a single straight snip from any noise point lands on its data point. You distilled by removing the curvature, not by jumping across it.

Reflow is why SD3 (generative lesson 22) chose a rectified-flow objective: it starts from a path that is already much straighter than DDPM’s, so it is cheaper to distill toward few-step, and the v-like velocity target is well-behaved at both endpoints. Straightness is a head start on distillation.

The whole field on two axes

Every diffusion distiller is one choice on each of two axes: what target the student matches, and whether the path is curved or straightened.

methodWHAT it matchesHOW (loss)WHERE / pathsteps
Progressive distillationteacher’s 2-step output (a trajectory point)L2 (v-pred)teacher DDIM, curved; serial halving4–8
Consistency (CD/CT) · LCMthe trajectory’s origin x₀ from anywhereL2 / LPIPS + EMA targetcurved PF-ODE; one run1–4
CTMany-t-to-any-s jumpL2 + adversarial optioncurved; one run1–∞
SDS / VSDthe output distribution (teacher score as force)score gradientdistribution, no fixed pathopt. loop
DMD / DMD2the output distribution (sreal − sfake)KL via score difference (+GAN)distribution1–4
ADD / Turbo / LADDrealism + manifoldGAN + score distillationdistribution1–4
Rectified flow / reflowits own (noise, sample) pairsflow-matching L2straightens the path1–4

The decision map

If you…reach forwhy
want a quick, robust 4–8-step win with minimal riskprogressive distillationsimplest, stable, just L2 against your own teacher
need 2–4 steps on a Stable Diffusion checkpoint, portableLCM / LCM-LoRAone training run, ships as an adapter (generative lesson 23), guidance folded in
want the best 1-step quality and can afford adversarial trainingDMD2 or ADD/Turbodistribution matching + GAN beat L2’s blur ceiling
are designing the base model from scratchrectified flow + reflow (SD3-style)start straight so few-step is cheap downstream
train without any teacherconsistency training (iCT)builds the few-step sampler from the forward process alone
have no logits, only the teacher’s imagesreflow / black-box pairsneeds only (noise, generated image) pairs

Back to the three knobs

The framework from lessons 01–02 survived the whole journey, re-read for a teacher that is a sampler rather than a token distribution:

Interactive · curved teacher vs. reflowed straight path

Left state: the teacher’s sample trajectories bend (crossing straight-line couplings averaged into a curve), so a 1-step Euler leap (dashed) misses the data. Hit reflow: the endpoints get re-paired to what each path actually reached, the trajectories straighten, and the same 1-step leap now lands on the moons. The endpoint-gap KPI is the payoff of straightening.

Reflow straightens the path so one step lands
Blue = multi-step trajectories. Dashed gray = the 1-step Euler leap from each start. Hit “Reflow” to re-pair endpoints and straighten; the 1-step leaps snap onto the data. “Reset” restores the curved teacher.
reflow rounds
0
mean 1-step endpoint gap
mean path curvature
Takeaway · end of the diffusion arc
Curved-path methods distill by leaping across the bend (progressive → consistency → distribution-matching → adversarial, each fewer-step and higher-quality at rising cost); rectified flow attacks the curvature itself, re-pairing (noise, sample) endpoints via reflow until the path is straight enough that one Euler step is exact. The lesson-02 knobs all carried over: WHAT climbed a ladder from trajectory-point to full distribution, HOW fell back to L2 then re-earned a distributional loss via the score and a re-hired GAN, and WHERE kept its off-policy/on-policy meaning. Pick by your constraint — quick win (progressive), portable SD adapter (LCM-LoRA), best 1-step (DMD2/Turbo), or design-it-straight (rectified flow).