Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow

Xingchao Liu, Chengyue Gong, Qiang Liu

2022 · ICLR

Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow

Problem

Framing

Continuous-time generative transport had strong quality but expensive inference, while one-step models lacked a clean ODE view. The paper closes this gap by learning velocity fields that follow straight interpolation directions, then recursively straightening them with reflow. On CIFAR-10, the distilled 2-rectified flow reaches FID 4.85 with one Euler step.

Currently Used Methods

Foundational

Proposed Method

Architecture

The method learns a time-dependent velocity field vθ(z,t)v_\theta(\mathbf{z}, t) for the ODE dZt=vθ(Zt,t)dtd\mathbf{Z}_t = v_\theta(\mathbf{Z}_t,t)dt. For image generation, it uses the DDPM++ U-Net backbone from @songScoreSDE2020; the paper changes the training target, not the backbone.

Verified figure: linear interpolation paths cross, rectified flow rewires them into non-crossing trajectories, and reflow produces nearly straight transport paths between source and target modes.

Loss / Objective

The core objective regresses the velocity on straight-line interpolation directions between paired endpoints.

minv  01E[(X1X0)v(Xt,t)2]dt,Xt=tX1+(1t)X0\min_{v}\; \int_0^1 \mathbb{E}\left[\left\| (\mathbf{X}_1-\mathbf{X}_0) - v(\mathbf{X}_t,t) \right\|^2\right] dt, \qquad \mathbf{X}_t = t\mathbf{X}_1 + (1-t)\mathbf{X}_0

The exact population optimum is

vX(x,t)=E[X1X0Xt=x].v^{X}(\mathbf{x}, t) = \mathbb{E}[\mathbf{X}_1-\mathbf{X}_0 \mid \mathbf{X}_t = \mathbf{x}].

Sampling Rule / Algorithm

After fitting vθv_\theta, sampling solves the learned ODE forward from π0\pi_0; reflow retrains on the induced endpoint coupling.

dZtdt=vθ(Zt,t),Z0π0\frac{d\mathbf{Z}_t}{dt} = v_\theta(\mathbf{Z}_t,t), \qquad \mathbf{Z}_0 \sim \pi_0 Zk+1=RectFlow((Z0k,Z1k)),(Z00,Z10)=(X0,X1).\mathbf{Z}^{k+1} = \mathrm{RectFlow}\big((\mathbf{Z}_0^k, \mathbf{Z}_1^k)\big), \qquad (\mathbf{Z}_0^0, \mathbf{Z}_1^0) = (\mathbf{X}_0, \mathbf{X}_1).

Training Procedure

Evaluation

Datasets

Metrics

Headline results

Results table

Table 2: Domain adaptation accuracy on transferred testing data

MethodERMIRMARMMixupMLDGCORALOurs
OfficeHome66.5 \pm 0.364.3 \pm 2.264.8 \pm 0.368.1 \pm 0.366.8 \pm 0.668.7 \pm 0.369.2 \pm 0.5
DomainNet40.9 \pm 0.133.9 \pm 2.835.5 \pm 0.239.2 \pm 0.141.2 \pm 0.141.5 \pm 0.241.4 \pm 0.1

Ablations

Verified figure: sample trajectories for image generation and face-to-cat transfer across different Euler step counts, showing 2-rectified flow remains high quality even at one step.

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers