Introduction
Generative modeling has seen a paradigm shift with the advent of Diffusion Models and Flow Matching. These frameworks learn to transform a simple source distribution, such as Gaussian noise, into a complex target distribution, like natural images. Rectified Flow Matching (RFM) emerged as a powerful variant, aiming to connect noise and data via straight-line trajectories. However, RFM often struggles with "velocity ambiguity"—a phenomenon where multiple paths intersect, forcing the model to learn an average velocity that results in inefficient, curved trajectories.
This paper introduces Variational Rectified Flow Matching (V-RFM). By incorporating a latent variable to disentangle overlapping paths, V-RFM produces straighter flows, leading to higher sample quality and superior performance with fewer integration steps.
The Challenge: Velocity Ambiguity
In standard RFM, the model is trained to minimize a Mean Squared Error (MSE) loss between the predicted velocity and the target direction. While intuitive, this approach fails when paths from different noise-data pairs intersect at the same point in space and time.
Consider two paths: one from noise $A$ to image $B$, and another from noise $C$ to image $D$. If these paths cross, the model at that intersection is presented with two distinct "ground truth" directions. Due to the nature of MSE, the model learns the average of these directions. This averaging effect transforms intended straight lines into curves. Curved paths are computationally expensive to follow, requiring more steps from numerical solvers (higher Number of Function Evaluations, or NFE), and often lead to "blurry" results as the model fails to resolve distinct modes in the velocity field.
Methodology: Variational Path Selection
To resolve this ambiguity, the authors propose treating the velocity field as a conditional distribution rather than a deterministic function.
1. Latent Path Selection
V-RFM introduces a latent variable $z$ that acts as a "path selector." The velocity function is redefined as $v(x_t, t, z)$. This allows the model to represent multiple valid directions at any given point, conditioned on the specific latent $z$.
2. Variational Training
The training process utilizes a variational approach similar to Variational Auto-Encoders (VAEs). An encoder (recognition model) $q_\phi(z|x_0, x_1, x_t, t)$ is introduced to infer the correct latent $z$ based on the start point, end point, and current position. The model is then optimized to maximize a variational lower bound (ELBO) on the velocity likelihood, effectively teaching the model to associate specific latents with specific trajectories.
3. Inference
During inference, the encoder is no longer needed. A latent $z$ is sampled once from a standard Gaussian prior and held constant throughout the generation process. By fixing $z$, the model "locks in" to a specific, straight trajectory, avoiding the averaging trap that plagues standard RFM.
Experimental Evaluation
The authors evaluated V-RFM across several benchmarks to test its versatility and scaling:
- Synthetic Data: Visualizations on 1D and 2D datasets confirmed that V-RFM successfully disentangles intersecting paths.
- MNIST: Experiments showed that the latent space $z$ captures meaningful semantic variations, such as digit style, independent of the initial noise $x_0$.
- CIFAR-10: A standard benchmark used to measure image quality (FID) and diversity.
- ImageNet (256x256): Large-scale testing using the Scalable Interpolant Transformer (SiT-XL) architecture as the backbone.
Key Insights
The core contribution of V-RFM is the recognition that multi-modality exists within the instructions for generation, not just the final output. By modeling the velocity field as a Gaussian mixture via the latent $z$, the model can navigate complex distributions more effectively.
Furthermore, the "straightness" of the paths in V-RFM is a critical advantage. Straighter paths are inherently easier for ODE solvers to follow, which explains why V-RFM maintains high performance even at very low NFE (e.g., 5 to 10 steps).
Results
V-RFM demonstrates significant improvements over baseline RFM:
- ImageNet Performance: When applied to the SiT-XL architecture, V-RFM achieved an FID of 14.6 at 400k training steps, a notable improvement over the 17.2 FID achieved by the standard SiT-XL.
- Efficiency: On CIFAR-10, V-RFM variants achieved FIDs around 13.2 with only 10 integration steps, whereas the baseline remained at 14.3.
- Convergence: The variational formulation allows the model to reach higher quality levels faster during the training process compared to standard flow matching.
Limitations and Future Directions
While V-RFM offers clear benefits, it introduces some training overhead due to the additional encoder and latent variable parameters. Additionally, the current implementation uses a simple Gaussian prior for $z$. The authors suggest that exploring conditional or learned priors could further enhance performance, though it would increase optimization complexity.
Finally, the authors note that V-RFM is orthogonal to techniques like Consistency Models. While Consistency Models excel at single-step generation, they do not explicitly address velocity multi-modality. Combining variational path selection with consistency constraints represents a promising avenue for future research.
Summary updated