TL;DR
This paper introduces Flow Map Matching (FMM), a new theoretical framework for learning "two-time flow maps" of generative models. FMM provides a unified approach to fast sampling, enabling generative models to produce high-quality samples with significantly fewer computational steps, achieving comparable quality to existing methods but 10-20 times faster.
What Problem Does This Paper Address?
Generative models like diffusion models are known for their excellent sample quality but suffer from computationally expensive inference due to the need for many steps of numerical integration. While consistency models have emerged to speed up generation to one or a few steps, a solid theoretical understanding of their design and how they relate to other fast sampling methods has been lacking. This paper aims to bridge this gap by providing a unified mathematical framework, Flow Map Matching (FMM), that explains and extends existing fast sampling techniques, offering a principled way to learn efficient generative models.
Methods
The core of FMM is learning the "two-time flow map," denoted as $X_{s,t}$, which directly maps a sample at time $s$ to a sample at time $t$ within a generative process. This bypasses the need for step-by-step integration of an underlying differential equation. The paper proposes two main training strategies:
- Distillation: Learning the flow map $X_{s,t}$ by "distilling" knowledge from a pre-trained velocity field $b_t$. This is achieved through two novel loss functions:
- Lagrangian Map Distillation (LMD): Based on the Lagrangian formulation of the flow map, this loss directly minimizes the difference between the predicted flow map's time derivative and the known velocity field.
- Eulerian Map Distillation (EMD): Based on the Eulerian formulation, this loss minimizes a related objective involving the spatial gradient of the flow map.
- Direct Training (Flow Map Matching - FMM): Learning the flow map $X_{s,t}$ directly without requiring a pre-trained velocity field. This involves a loss function that enforces both the forward mapping ($X_{s,t}$) and its invertibility ($X_{t,s}$), ensuring consistency across time.
The framework is built upon the theory of stochastic interpolants, which provide a flexible way to define the generative process. FMM is shown to unify and extend existing methods like consistency models, consistency trajectory models, and progressive distillation.
Datasets
The paper evaluates its methods on:
- 2D Checkerboard Dataset: Used for illustrative purposes and to analyze the geometric properties of the learned maps.
- CIFAR-10: A standard image dataset for evaluating generative models.
- ImageNet-32x32: A higher-resolution image dataset used for more challenging generation tasks.
Key Insights and Ideas
- The Power of the Two-Time Flow Map: Learning the direct mapping $X_{s,t}$ between any two time points $s$ and $t$ is more powerful than just learning instantaneous velocity fields. This allows for arbitrary step sizes during generation, offering a direct trade-off between speed and quality.
- Unified Framework: FMM provides a unifying theoretical lens through which various fast sampling techniques (consistency models, progressive distillation) can be understood and related. This suggests that these methods are not fundamentally different but rather different ways of learning aspects of the same underlying flow map.
- Lagrangian vs. Eulerian Distillation: The paper finds that Lagrangian distillation (LMD) generally performs better than Eulerian distillation (EMD), especially when dealing with discontinuous target distributions. This is hypothesized to be due to the avoidance of spatial gradients in the LMD loss, which can be problematic for learned maps.
- Direct Training is Viable: The FMM loss for direct training demonstrates that it's possible to learn high-quality generative models without relying on a pre-trained teacher model, offering a more self-contained approach.
- Post-Training Flexibility: The learned two-time flow map allows for post-training adjustment of sampling steps, giving practitioners the ability to systematically trade accuracy for computational efficiency.
Key Results
- Speedup: FMM achieves sample quality comparable to flow matching but reduces generation time by a factor of 10-20.
- CIFAR-10 & ImageNet-32x32 Performance:
- LMD and PFMM (Progressive Flow Map Matching) produce effective samples with very few steps (1-4 steps), significantly outperforming standard stochastic interpolants (SI) which require many steps for comparable quality.
- LMD consistently outperforms EMD in terms of training speed and final loss/FID.
- FMM (direct training) shows competitive performance, especially when allowed multiple steps.
- 2D Checkerboard: Visualizations show that FMM and its variants can handle complex target distributions, though challenges remain in precisely matching discontinuous boundaries. LMD is shown to be distributionally more correct (lower KL-divergence) than EMD, though EMD better preserves the teacher's coupling.
Limitations and Future Work
- Training Stability: While FMM offers a principled framework, the paper notes that guaranteeing the stability and attractiveness of critical points in the Eulerian estimation objective (Proposition 3.12) can be challenging.
- Architectural Improvements: The authors suggest future work will investigate improving the neural network architecture and training procedures to further reduce the number of steps and improve convergence for direct training.
- Handling Discontinuities: The paper acknowledges that precisely handling discontinuities in the target distribution remains a challenge, as seen in the 2D checkerboard experiments.
- Generalization: While tested on image datasets, exploring FMM's performance on other modalities like audio or video could be a future direction.
Summary updated