Is there a difference between rectified flow and flow matching?
Rectified flow and flow matching are distinct but closely related concepts within the generative modeling framework that seeks to learn continuous-time normalizing flows or stochastic differential equations. The core difference lies in their foundational objectives and the specific mechanisms they employ to construct a probability path between a simple noise distribution and a complex data distribution. Flow matching provides a general, simulation-free objective for training continuous normalizing flows by regressing a vector field against a conditional target field defined by a chosen probability path. Crucially, it does not prescribe the specific form of this path, offering flexibility. Rectified flow, in contrast, is a specific *instance* of a flow matching model that makes a deliberate and consequential choice for this path: it employs *straight* paths, meaning the probability path is defined by linear interpolation between noise and data samples. This choice is not merely a parameterization but a strategic design with significant implications for model behavior and performance.
The mechanism of rectified flow is defined by its commitment to linear interpolation paths. Given a data sample \( x_1 \) and a noise sample \( x_0 \), the path is \( x_t = (1 - t)x_0 + t x_1 \). The flow matching objective then trains a neural network to predict the constant vector field \( x_1 - x_0 \) that generates this straight line. The "rectification" procedure is a further iterative refinement where a trained model is used to generate new paired data, and the model is retrained on these straighter trajectories, progressively encouraging the learned flow to become more linear. This directly targets a primary inefficiency in many diffusion or flow models: curved or meandering trajectories that require many discrete steps for accurate simulation. Flow matching, in its general form, does not inherently possess this rectification mechanism or enforce straight paths; it could utilize Gaussian conditional paths like those in diffusion models or other non-linear schemes. Therefore, rectified flow is a specific methodology that operates under the broad umbrella of the flow matching objective, optimizing for trajectory straightness.
The practical implications of this distinction are substantial. By enforcing straighter paths, rectified flow models inherently promise more efficient sampling. A perfectly linear flow can be accurately simulated in a single step, though practical models achieve high-quality results with far fewer steps (e.g., 1 to 4) compared to the hundreds or thousands potentially required by standard diffusion models. This represents a direct trade-off: rectified flow sacrifices the theoretical flexibility of an arbitrary probability path for the engineering benefits of fast sampling and simpler dynamics. Flow matching, as a broader framework, retains the ability to model more complex, curved paths which may in some contexts provide a better fit for certain data geometries, but at the cost of typically requiring more integration steps for accurate generation. Thus, the relationship is hierarchical: flow matching is the general training paradigm, while rectified flow is a specific and influential sub-class that prioritizes and iteratively refines trajectory linearity to achieve its performance characteristics.