Sequential Flow Straightening for Generative Modeling

Jongmin Yoon, Juho Lee

Continuous-time generative models, like diffusion and flow-based models, have revolutionized AI-driven synthesis. However, their reliance on Ordinary Differential Equation (ODE) solvers often makes sampling a slow, computationally expensive process. A new paper, "Sequential Flow Straightening for Generative Modeling," introduces a clever technique to speed things up without sacrificing quality.

TL;DR

Sequential Reflow (SeqRF) accelerates generative model sampling by segmenting the ODE trajectory into multiple time intervals and straightening the probability flow within each segment. This approach significantly reduces global truncation errors, allowing for high-quality image synthesis in as few as six steps.

What Problem Does This Paper Address?

Generative models like Stable Diffusion work by gradually transforming simple Gaussian noise into complex data (like an image) along a path defined by an ODE. To generate an image, we use a numerical ODE solver to step along this path.

The bottleneck is curvature. If the ODE trajectory is highly curved, numerical solvers accumulate significant "global truncation error" (GTE) unless they take many tiny steps (high Number of Function Evaluations, or NFE). Existing "reflow" methods try to solve this by learning a linear, straight path between the noise and the final data. However, even these "straightened" paths can still exhibit high curvature over the long journey from noise space to image space, leading to exploding errors when trying to sample quickly (at low NFE).

Methods

The authors propose Sequential Reflow (SeqRF). Instead of trying to straighten the entire trajectory at once, SeqRF adopts a "divide and conquer" strategy:

  1. Time Segmentation: The entire ODE trajectory (from $t=0$ to $t=1$) is divided into $K$ segments.
  2. Segmented Training: The model is trained to straighten the flow within each specific segment. It learns the joint distribution between data points at the start and end of these shorter time intervals.
  3. Sequential Reflow: By traversing these partial, straighter paths, the accumulated global truncation error is drastically reduced compared to traversing one long, potentially curved path.
  4. Distillation (Optional): After training with SeqRF, the model can be further "distilled" so that each segment can be traversed in a single solver step. This allows the total NFE to match the number of segments $K$.
The conceptual difference: SeqRF (bottom rows) segments the path to mitigate the accumulation of truncation error (represented by triangles) compared to standard Reflow (top row).

Datasets

The researchers evaluated SeqRF on three standard image generation benchmarks:

  • CIFAR-10: $32 \times 32$ images of common objects.
  • CelebA: $64 \times 64$ cropped and resized celebrity face images.
  • LSUN-Church: $256 \times 256$ images of outdoor church scenes.

They utilized the NCSN++ architecture for their experiments, ensuring comparisons were made against established baselines.

Key Insights and Ideas

  • Curvature is the Sampling Killer: The paper provides a theoretical framework (Theorems 2 and 4) proving that GTE grows superlinearly with the curvature of the trajectory and the length of the time interval.
  • Error Bounding through Segmentation: By increasing the number of segments $K$, the global truncation error is suppressed by an order of $K^{1-p}$ (where $p$ is the solver's order). This provides a mathematical guarantee that segmentation helps.
  • Variance Reduction: Training on joint distributions from segmented time domains (rather than independent noise/data pairs) improves training stability and helps the model more efficiently learn optimal transport mappings.
Figure 3: The global truncation error over NFE in CIFAR-10 dataset, compared to the oracle Euler-480 step solver. Our SeqRF methods, shown in blue and red lines, deploy lower global truncation errors.

Key Results

SeqRF achieves state-of-the-art performance, particularly in the "low-NFE" regime where speed is critical:

  • Superior Quality at Speed: On CIFAR-10, SeqRF achieved a remarkable FID of 3.19 with only 6 sampling steps (using distillation). This outperforms standard diffusion solvers like DDIM and DPM-Solver, as well as previous flow-matching techniques.
  • Surpassing Baselines: As shown in Figure 1, SeqRF (black stars) consistently reaches lower FID scores at lower NFEs than competing methods.
  • Scalability: The method showed strong results even on higher-resolution datasets like LSUN-Church ($256 \times 256$), demonstrating its potential for large-scale generative tasks.
Figure 1: The overall generation result in CIFAR-10 dataset, comparing our method to existing diffusion and flow-based model solvers. The black starred points stand for our proposed SeqRF method.

Limitations and Future Work

  • Dataset Bias: The authors acknowledge that the CelebA dataset contains inherent biases (e.g., more white individuals and more males), which generative models can inadvertently learn and amplify.
  • Societal Impact: While technically beneficial, faster and more accurate generative models increase the risk of misuse, such as the creation of Deepfakes.
  • Future Directions: The authors suggest extending SeqRF to other domains like image-to-image translation and latent generative models to handle even larger-scale datasets.

Summary updated

BibTeX
@misc{yoon2024sequential,
  author = {Jongmin Yoon and Juho Lee},
  title = {{Sequential Flow Straightening for Generative Modeling}},
  year = {2024},
  eprint = {2402.06461},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.06461},
}
Figure