Bellman Optimal Step-size Straightening of Flow-Matching Models

Bao Nguyen, Binh Nguyen, Viet Anh Nguyen · DOI

Introduction

Flow-matching models have emerged as a powerful class of generative models, capable of transforming random noise into high-fidelity images by learning a continuous velocity field. However, their practical utility is often limited by two factors: the high number of sampling steps (Function Evaluations or NFEs) required for quality results, and the immense computational cost associated with "straightening" these paths to improve efficiency. The Bellman Optimal Stepsize Straightening (BOSS) technique addresses these challenges, enabling high-quality synthesis in as few as 4–8 steps with a fraction of the training budget required by previous methods.

Methodology

The BOSS approach introduces a two-phase pipeline designed to optimize both the sampling schedule and the model's internal trajectory.

1. Bellman Optimal Stepsizes

Standard sampling typically relies on uniform time steps (e.g., $0, 0.2, 0.4 \dots$), which fails to account for varying curvature in the model's velocity field. BOSS treats step selection as a shortest-path optimization problem. By estimating the local truncation error across a grid of possible timestamps, the authors employ a Dynamic Programming (Bellman) algorithm to identify the sequence of $K$ steps that minimizes total accumulated error.

The dynamic programming framework used to find the optimal sequence of sampling timestamps by minimizing accumulated truncation error.

2. Straightening (The "BOSS" Finetuning)

Once optimal stepsizes are identified, the model is finetuned to align its velocity vectors with the linear paths between those specific timestamps. This "straightening" process is made highly efficient through the use of Low-Rank Adaptation (LoRA), updating only approximately 2% of the model's parameters. This targeted approach allows for massive gains in accuracy during the large "jumps" between sampling steps.

Key Insights

  • Curvature Management: Curvature is highest at the start (initial noise) and end (fine details) of the generation process. BOSS automatically allocates more steps to these high-curvature regions.
  • Suboptimality of Uniform Steps: Simply replacing uniform timestamps with Bellman-optimized ones can cut FID scores in half without any retraining.
  • Transferability: Optimal stepsizes calculated for one dataset (e.g., LSUN-Church) often perform well on others (e.g., CelebA-HQ), suggesting a shared geometric structure across pretrained flow-matching models.
  • Computational Efficiency: While traditional "Reflow" methods may require over 300,000 iterations, BOSS achieves superior results in just 10,000–12,000 iterations, taking roughly 10–14 hours on a single NVIDIA A5000 GPU.

Experimental Results

BOSS was evaluated across several benchmarks, including CIFAR-10 and high-resolution ($256 \times 256$) datasets like CelebA-HQ and LSUN-Church. The results consistently show that Bellman-optimized sampling significantly outperforms uniform sampling across different step counts.

FID vs. Number of Steps (log-scale) across five datasets, demonstrating that Bellman-optimized samplers (solid lines) consistently outperform uniform samplers (dashed lines).

On the CelebA-HQ dataset with only 8 steps, the Bellman-optimized Euler sampler achieved an FID of 49.80, a dramatic improvement over the 109.42 produced by a standard uniform Euler sampler. Furthermore, after BOSS finetuning (6 steps), the model reached an FID of 18.67, nearly doubling the performance of the standard "Distill-6-Reflow" baseline (34.56).

Conclusion and Future Work

BOSS provides a mathematically grounded and computationally accessible path toward real-time, high-fidelity image generation. While it currently requires a brief finetuning stage, it represents a major step forward in reducing the resource barrier for advanced generative modeling. Future research may explore training-free variants, extension to guided models (Classifier-Free Guidance), and the application of these principles to higher-order ODE solvers.

Summary updated

BibTeX
@inproceedings{nguyen2024bellman,
  author = {Bao Nguyen and Binh Nguyen and Viet Anh Nguyen},
  title = {{Bellman Optimal Step-size Straightening of Flow-Matching Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=Iyve2ycvGZ},
}
Figure