TL;DR
Generating images with diffusion and flow models usually requires dozens of slow mathematical steps. "Reflow" distillation speeds this up by teaching a student model to take straighter shortcuts, but matching individual paths doesn't guarantee the final overall distribution of generated images will actually look right. This paper introduces MA-Reflow, a mathematical regularizer that directly aligns the student's output probability distributions with the teacher's—boosting few-step image quality without needing any extra neural networks or unstable adversarial training.
What Problem Does This Paper Address?
Diffusion and Continuous Normalizing Flow (CNF) models generate data by gradually nudging random noise along curved trajectories defined by an Ordinary Differential Equation (ODE). Following tight curves takes many tiny steps, making generation slow.
A popular speedup strategy is reflow-based distillation (such as Rectified Flow or Piecewise Reflow / PeRFlow). Here, a fast "student" model learns to connect the start and end points of a slow "teacher" model's trajectories using straight lines (or piecewise straight segments), allowing generation in just a few steps.
However, the authors uncover a fundamental blind spot in this paradigm: matching trajectories does not uniquely determine the final data distribution. Because neural networks have finite capacity, velocity matching is never 100% perfect. Under imperfect matching, two student models can achieve the exact same trajectory-matching error ($L^2$ loss) yet produce completely different probability distributions at the end—meaning one student generates noticeably worse images than the other.
Methods
To fix this under-determination, the authors propose MA-Reflow (Marginal-Alignment Reflow). Instead of replacing trajectory matching, they add a marginal-alignment regularizer on top of standard Piecewise Reflow (PeRFlow).
While standard reflow partitions the generation timeline into $K$ windows and straightens paths within each window, MA-Reflow adds a Kullback–Leibler (KL) divergence penalty at the end of every window to ensure the student's induced probability density matches the teacher's.
What is novel here is how they compute this distributional alignment without training auxiliary critic or discriminator networks (unlike GANs or Distribution Matching Distillation):
- Tracking Density via Calculus: As a sample moves through the student's velocity field, how much the probability density expands or contracts is governed by the divergence (the trace of the Jacobian) of that velocity field—a classic physics result known as the Liouville equation. They track this log-density change by solving an augmented ODE, estimating the divergence cheaply via Hutchinson's trace estimator and finite differences.
- Frozen Teacher Scores: Computing the gradient of the KL loss requires knowing the "score" (the gradient of the log-density) of the target distribution. Conveniently, the frozen teacher model already encodes this exact score via standard diffusion-flow math.
- Localized Training: Rather than unrolling the student from pure noise all the way to window $k$ (which is computationally expensive), each window starts from a standard, pre-defined reference noisy image. To save even more compute, the regularizer is only evaluated once every $m$ training steps (e.g., every 9th update).
Datasets
No new datasets are introduced; the authors rely on standard community benchmarks:
- Training: LAION-Aesthetics v2 5+ (for text-to-image backbones SD 1.5 at $512\times512$ and SDXL at $1024\times1024$), and CelebA-HQ (for supplemental Latent Flow Matching experiments).
- Evaluation: MS-COCO (2014 and 2017 validation sets) for image quality and text alignment, alongside GenEval to test compositional text-to-image generation.
Key Insights and Ideas
- Errors live in the derivatives: Why can two models have the same $L^2$ velocity error but produce different distributions? Because probability density evolution depends on the spatial derivative (divergence) of the velocity field. Standard $L^2$ loss only checks pointwise velocity values, leaving spatial derivatives unconstrained. One student might shift the mean of a distribution while another inflates its variance, both incurring the exact same MSE.
- Local fixes guarantee global alignment: Initializing each training window with a reference noisy image instead of the student's previous output feels like a risky shortcut. However, the authors prove a telescoping Total Variation (TV) bound (Theorem 2), demonstrating mathematically that minimizing these localized, window-by-window KL penalties strictly upper-bounds the distributional gap at the final generated image.
Key Results
Initialized from converged PeRFlow checkpoints and fine-tuned for 5K steps ($K=4$ windows), MA-Reflow consistently improves 4-step generation:
- Stable Diffusion v1.5: On COCO-2014, MA-Reflow drops the 4-step FID (lower is better) from PeRFlow's 12.01 down to 10.66, beating strong baselines like PCM (11.70) and ProReflow-II (10.70). On COCO-2017, FID improves from 23.81 to 22.76 while CLIP score rises from 30.24 to 31.03.
- Stable Diffusion XL (SDXL): Under 4-step sampling, MA-Reflow improves over PeRFlow across all five benchmarks—boosting CLIP score (33.44 $\rightarrow$ 34.14), ImageReward (0.804 $\rightarrow$ 0.897), HPSv2 (0.298 $\rightarrow$ 0.321), PickScore (22.38 $\rightarrow$ 22.88), and GenEval (0.550 $\rightarrow$ 0.579).
- Training Overhead: Because the augmented ODE is only solved periodically, total fine-tuning time on SDXL is roughly $1.94\times$ that of standard PeRFlow (160 GPU hours on 2$\times$H200 GPUs), with zero overhead at inference time.
Limitations and Future Work
- Untested Configurations: While the math applies to single-window vanilla reflow ($K=1$), alternative noise schedules, and newer backbones with higher-dimensional latent spaces, empirical testing was left to future work due to compute limits.
- Requires a Velocity Field: Because MA-Reflow relies on integrating divergence along a continuous ODE path, it cannot be directly plugged into distillation methods that jump between time steps without defining a continuous velocity field, such as Consistency Models.
Summary updated