Papers
Topics
Authors
Recent
Search
2000 character limit reached

Rectified Flow Framework

Updated 22 May 2026
  • Rectified Flow is a generative modeling framework that formulates distribution transformation as a neural ODE problem, creating nearly straight trajectories between base and target distributions.
  • It uses a reflow procedure and encoder-flow techniques to reduce integration errors, align synthetic couplings with real data, and enhance sample fidelity.
  • The framework provides theoretical guarantees for exact marginal matching and optimal transport, enabling efficient one-step inference for tasks like image synthesis and scientific modeling.

Rectified Flow Framework

Rectified Flow is a class of generative modeling and transport algorithms that formulate distribution transformation as a neural ordinary differential equation (ODE) learning problem with the goal of achieving nearly straight deterministic trajectories between a simple base distribution and a complex target distribution. The framework supports efficient sampling, enables theoretically grounded straight path couplings, and provides a flexible substrate for recent advances in high-fidelity image synthesis, restoration, scientific modeling, and controlled data transport. It achieves this by learning time-indexed velocity fields that match straight-line transport between paired (base, target) samples, leading to globally straight or nearly straight paths in configuration space and correspondingly low integration error even with a single Euler step.

1. Mathematical Principles and Core Objective

The foundational mathematical object of rectified flow is the straight-line interpolation between distributions. Given a base distribution π0\pi_0 (e.g., N(0,I)N(0, I)) and a target (data) distribution π1\pi_1, the model defines a trajectory for each coupled pair (X0,X1)(X_0, X_1) by

Xt=tX1+(1−t)X0,t∈[0,1].X_t = t X_1 + (1-t) X_0,\quad t \in [0,1].

A time-dependent neural velocity field vθ(x,t)v_\theta(x, t) is optimized to match the instantaneous displacement vector, targeting

vref=X1−X0,v_\mathrm{ref} = X_1 - X_0,

through the least-squares regression loss

LRF(θ)=E(X0,X1)∼γ,  t∼p(t)[∥vref−vθ(Xt,t)∥2].L_{\mathrm{RF}}(\theta) = \mathbb{E}_{(X_0, X_1) \sim \gamma,\,\,t \sim p(t)} \left[\| v_\mathrm{ref} - v_\theta(X_t, t) \|^2 \right].

The optimal flow yields ODE solutions whose marginals at t=1t=1 exactly match π1\pi_1. Theoretical results guarantee marginal preservation at every N(0,I)N(0, I)0 for the learned flow, and the deterministic coupling N(0,I)N(0, I)1 becomes increasingly straight with recursive application of the rectification step (Liu et al., 2022, Liu, 2022, Dai et al., 14 Jul 2025).

2. Straightness and "Reflow"

ODE-based generative models based on rectified flow initially produce curved inference trajectories when trained on independent random couplings. To achieve nearly straight trajectories, rectified flow models employ a procedure called "Reflow":

  • Pre-train a flow model N(0,I)N(0, I)2 on independent data-noise pairings.
  • Using N(0,I)N(0, I)3, map base distribution samples N(0,I)N(0, I)4 through the learned ODE to obtain "model images" N(0,I)N(0, I)5.
  • Define deterministic (now model-induced) couplings N(0,I)N(0, I)6, and train the next flow N(0,I)N(0, I)7 to fit straight-line velocities along these pairs over all N(0,I)N(0, I)8.
  • Iterate as necessary; a small number of reflow steps suffices in practice.

This process straightens ODE trajectories, making a single Euler step adequately accurate for synthesis and reducing the cost of inference by orders of magnitude compared to standard score-based diffusion models (Liu et al., 2022, Armegioiu et al., 3 Jun 2025, Zhang et al., 28 Nov 2025). However, classic reflow has notable limitations: a distribution gap can emerge because "model images" used for couplings deviate from real images, and excessive reflow cycles accumulate errors, resulting in trajectory degradation and inference "lock-in" to generated modes (Dai et al., 14 Jul 2025).

3. Architectures, Variants, and Recent Innovations

3.1 Encoder-Flow Joint Models and Noise Optimization

To overcome reflow limitations, new architectures integrate an encoder alongside the flow (velocity field):

  • The encoder N(0,I)N(0, I)9, given a real image Ï€1\pi_10, outputs Ï€1\pi_11 parameterizing an optimized base sample Ï€1\pi_12, Ï€1\pi_13.
  • The optimized pair Ï€1\pi_14 minimizes deviation from ideal straight-line velocity along the ODE trajectory ("optimized coupling"), aligning the distribution of generated paths with real data ("noise optimization via reparameterization").
  • Training loss jointly regularizes velocity matching and the encoder (with a KL penalty).
  • VRFNO further introduces a historical velocity term---feeding the model's own previous prediction as auxiliary input---which theorem 2 shows strengthens trajectory discriminability, disambiguating states that would otherwise appear nearly indistinguishable in high dimensions (Dai et al., 14 Jul 2025).

3.2 Alternative Objective Structures

Consistency and cumulative velocity fields, as in IR-Flow, are used in a discriminative-to-generative restoration context:

  • Velocity predictors are trained to point from current state Ï€1\pi_15 directly toward source Ï€1\pi_16, not merely along the tangent, producing "cumulative velocity" (Fan et al., 21 Apr 2026).
  • Additional losses enforce multi-step consistency, ensuring high-fidelity restoration in tasks like denoising and deraining in as few as one or two ODE steps.

MeanFlow and its rectified extension Re-MeanFlow further model the time-averaged velocity over the ODE trajectory, improving one-step distillation especially after pre-straightening with a single reflow (Zhang et al., 28 Nov 2025).

Variational Rectified Flow Matching (V-RFM) introduces a latent variable to capture ambiguity in local flow directions, supporting multi-modal vector-field transport—a crucial innovation for highly multi-modal generative tasks, and leading to improved FID and likelihoods across toy and real datasets (Guo et al., 13 Feb 2025).

4. Theoretical Guarantees and Analytical Results

  • Marginal matching: The ODE's solution preserves the law of the straight interpolant (Theorem 3, (Dai et al., 14 Jul 2025); main theorem, (Liu et al., 2022); functional extension, (Zhang et al., 12 Sep 2025)).
  • Trajectory separation: In high-dimensional spaces, the probability of trajectory crossing is exponentially small, and velocity difference is a more sensitive discriminant between trajectories than state difference (Theorems 1 and 2, (Dai et al., 14 Jul 2025)).
  • Optimal transport: Rectified flow (and its convex-cost specialization "c-rectified flow") provides an "interior point" ODE-based solution to the Monge–Kantorovich problem, exactly preserving marginals and monotonically reducing arbitrary convex transport costs (multi-objective for the standard RF, targeted for c-rectified) (Liu, 2022).
  • Functional extension: The framework generalizes to infinite-dimensional Hilbert spaces, enabling rigorous rectified-flow generative processes for function-valued data, and removing technical measure-theoretic obstacles present in prior flow-matching formulations (Zhang et al., 12 Sep 2025).

5. Algorithmic Overview and Key Procedures

Step Reflow Prototype Encoder-Flow (VRFNO, VRF)
Coupling construction Model-generated pairs π1\pi_17 Encoder-generated π1\pi_18 based on real images
Training loss π1\pi_19 (X0,X1)(X_0, X_1)0 + KL
Trajectory auxiliary None Historical velocity injection
Few-step/one-step sampling Euler, (X0,X1)(X_0, X_1)1 Euler (straighter paths, better coverage)
Distribution gap Inherent, accumulates with repeated reflow Mitigated via noise optimization
Data diversity Limited by (X0,X1)(X_0, X_1)2 pairs and storage Encoder learns optimized noise for every real example

In a prototypical RF setting, training involves repeatedly sampling (X0,X1)(X_0, X_1)3, drawing (X0,X1)(X_0, X_1)4, computing (X0,X1)(X_0, X_1)5, and applying regression to match (X0,X1)(X_0, X_1)6 to (X0,X1)(X_0, X_1)7. VRFNO, IR-Flow, and BCRF variants incorporate encoder-based or real-data-driven construction of couplings, loss terms for optimal noise and curvature, and modifications for discriminative/generative hybrid tasks.

6. Applications and Empirical Results

Rectified Flow underpins multiple generative and restoration applications:

  • Image synthesis: State-of-the-art FID and IS scores achieved in both one-step and few-step regimes, especially after incorporating real-image noise optimization and historical velocity (e.g., CIFAR-10, AFHQ results; VRFNO, CAF, and Re-MeanFlow outperform 2-RF and other baselines (Dai et al., 14 Jul 2025, Zhang et al., 28 Nov 2025)).
  • Restoration and inverse problems: IR-Flow and related models bridge the discriminative/generative divide, realizing single/few-step image restoration with distortion-perception trade-offs and out-of-distribution adaptability (Fan et al., 21 Apr 2026).
  • Personalization and control: Anchored classifier guidance (RectifID) and SGPP enable training-free, robust image identity editing, classifier guidance, and inverse problem solutions with theoretical convergence guarantees (Sun et al., 2024, Bansal et al., 5 Mar 2026).
  • Scientific modeling: In the physical sciences, rectified flow efficiently models high-dimensional fluid dynamics, matches empirical statistics of turbulent flow, and does so with (X0,X1)(X_0, X_1)8–(X0,X1)(X_0, X_1)9 ODE steps, compared to Xt=tX1+(1−t)X0,t∈[0,1].X_t = t X_1 + (1-t) X_0,\quad t \in [0,1].0 for equivalent diffusion surrogates (Armegioiu et al., 3 Jun 2025).
  • Biomedical anomaly detection: REFLECT leverages one-step straight transport in VAE latent space for outperforming anomaly localization in unsupervised brain MRI segmentation (Beizaee et al., 4 Aug 2025).
  • Unified multimodal models and drug design: JanusFlow integrates LLMs with rectified flow for vision-language, and FlowSBDD leverages rectified flow for 3D molecular generation, outperforming previous SBDD methods while supporting flexible conditional objectives (Ma et al., 2024, Zhang et al., 2024).

7. Limitations, Open Problems, and Future Directions

While rectified flow achieves substantial efficiency and fidelity improvements, several open challenges persist:

  • Distribution gap and data drift: Reflow-based models relying heavily on synthetic (model-generated) couplings can drift from the target manifold and saturate on previously generated samples (Dai et al., 14 Jul 2025, Seong et al., 29 Oct 2025). Direct incorporation of real image/latent couplings with Slerp or encoder-based noise optimization (VRFNO, BCRF) is a practical mitigation.
  • High curvature and multi-modality: Standard MSE loss on vector fields enforces mode-averaging, which impedes modeling of multi-modal or intersecting velocity fields. Variational extensions (V-RFM) and mean-velocity methods address some of these limitations (Guo et al., 13 Feb 2025, Zhang et al., 28 Nov 2025).
  • Storage, memory, and scaling: Large batch coupling banks (Xt=tX1+(1−t)X0,t∈[0,1].X_t = t X_1 + (1-t) X_0,\quad t \in [0,1].1) and multi-step reflow cycles pose computational and storage challenges, which are alleviated by encoder-driven, reparameterized approaches that only require a single pass per data instance.
  • One-step distillation and small-model training: Naive distillation underperforms for compact student models; SlimFlow demonstrates that annealed reflow and intermediate-field guidance are critical for compressing both inference steps and parameter count without loss of sample quality (Zhu et al., 2024).
  • Functional extension and measure-theoretic issues: Infinite-dimensional generalization is now rigorously supported only for models meeting strong regularity conditions. Further developments could enable high-performance, functional generators for scientific applications (Zhang et al., 12 Sep 2025).

Progress in these domains will likely continue to integrate innovations in trajectory straightening, coupling optimization, and guidable vector field learning, establishing rectified flow as a central framework in deterministic, efficient, and theoretically robust distribution transport.

References:

(Liu et al., 2022, Liu, 2022, Dai et al., 14 Jul 2025, Zhang et al., 28 Nov 2025, Armegioiu et al., 3 Jun 2025, Wang et al., 2024, Zhu et al., 2024, Fan et al., 21 Apr 2026, Seong et al., 29 Oct 2025, Sun et al., 2024, Guo et al., 13 Feb 2025, Ma et al., 2024, Beizaee et al., 4 Aug 2025, Bansal et al., 5 Mar 2026, Zhang et al., 12 Sep 2025, Patel et al., 2024, Zhang et al., 2024).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Rectified Flow Framework.