---
title: 'Rectified MeanFlow: Fast, Efficient One-Step Generation'
url: https://www.emergentmind.com/topics/rectified-meanflow
type: topic
---

# Rectified MeanFlow: Fast, Efficient One-Step Generation

Rectified MeanFlow is a generative modeling framework that integrates the trajectory-straightening mechanism of Rectified Flow with the efficient one-step sampling paradigm of MeanFlow. By learning the mean velocity field along rectified, nearly straight probability paths using only a single reflow iteration and employing a loss truncation heuristic, Rectified MeanFlow enables fast, high-quality sample generation with significantly reduced computational cost. The approach has demonstrated state-of-the-art empirical performance across multiple image resolutions and task domains, establishing its position among leading “fastforward” generative modeling strategies [2511.23342].

## 1. Background: Probability Flow ODEs and Sampling Challenges

Generative modeling via continuous-time probability flow ODEs involves transporting a simple prior distribution, typically Gaussian $p(\mathbf z)=\mathcal N(0,I)$, to a complex data distribution $p(\mathbf x)$ over a unit interval $t \in [0,1]$, governed by
\[
d\mathbf x_t = v(\mathbf x_t, t)\,dt.
\]
The instantaneous velocity field $v(\mathbf x,t)$ can vary abruptly, necessitating numerous small integration steps for accurate path tracking via numerical solvers (Euler, Runge-Kutta, etc.), each incurring costly network evaluations and potential Jacobian–vector products. This often results in tens to hundreds of neural network calls per sample, adversely affecting efficiency [2511.23342].

## 2. Trajectory Straightening: Rectified Flow Principle

Rectified Flow straightens sample paths by iteratively “reflowing” couplings between data and prior. Starting from a learned flow $v^k_\theta$ and its associated couplings $(\mathbf x,\mathbf z)\sim p^{k-1}_{xz}$, backward ODE sampling produces new pairings for retraining. With each reflow iteration, the transport paths become increasingly straight, formally measured by the curvature
\[
\kappa(t) = \|\partial_t^2 \mathbf z_t\| = \bigl\|\partial_t v(\mathbf z_t, t)\bigr\|,
\]
where $\mathbf z_t = (1-t)\mathbf x + t\mathbf z$. Ideal straightness ($\kappa(t)\equiv 0$) is approached by re-sampling and training on progressively less curved couplings [2511.23342].

## 3. MeanFlow: Fastforward Generation via Mean Velocity Fields

MeanFlow achieves one-step generative sampling by directly learning the time-averaged velocity,
\[
\bar v(\mathbf x) = \mathbb{E}_{t \sim U[0,1]}[v(\mathbf x, t)].
\]
Given $\bar v$, one can deterministically generate samples by
\[
\mathbf x_0 = \mathbf z - \bar v(\mathbf z),
\]
bypassing all ODE integration. The mean velocity is approximated by a neural network, $s_\theta(\mathbf x) \approx \bar v(\mathbf x)$, trained by regressing onto Monte Carlo-averaged instantaneous velocities. However, learning $\bar v$ directly on highly curved flow paths induces unstable gradients and slow convergence [2511.23342].

## 4. Rectified MeanFlow: Unified Framework and Training

Rectified MeanFlow overcomes MeanFlow’s noisy supervision by applying it on couplings sampled from a single reflow step, resulting in trajectories with substantially reduced curvature variance. The training sequence is:

1. **Pretrain 1-rectified flow $v^1_\theta$** on independent couplings $(\mathbf x, \mathbf z)$.
2. **Generate rectified couplings** via backward ODE under $v^1$.
3. **Apply the truncation heuristic**: discard the top $k\%$ pairs by $\|\mathbf x - \mathbf z\|$ to remove residual high-curvature cases.
4. **Train a MeanFlow network** $u_\theta(\mathbf x, r, t)$ using the simplified objective:
   \[
   L(\theta) = \mathbb{E}_{(\mathbf x, \mathbf z), r<t}\Big\|\,u_\theta(\mathbf z_t, r, t) - [v^1(\mathbf z_t, t) - (t-r)\tfrac d{dt}u_\theta(\mathbf z_t, r, t)]\Big\|_2^2,
   \]
   with the path parameterization $\mathbf z_t = (1-t)\mathbf x + t\mathbf z$ and time derivative via JVP.

Typically, one reflow suffices to stabilize training. The truncation step further reduces loss variance and targets the elimination of the worst-case, high-curvature pairs, with optimal $k=10\%$ [2511.23342].

## 5. Theoretical Rationale and Interplay of Components

By straightening paths in advance (rectification), the outputs $v^1(\mathbf z_t, t)$ and their time-averaged counterparts become closely aligned and low in variance, which supports efficient MeanFlow training. The combination of (i) straightened couplings and (ii) mean velocity field modeling circumvents the requirement for perfect trajectory linearity, as MeanFlow remains robust once the overall curvature is reduced. Thus, Rectified MeanFlow creates a synergy between geometric simplification (rectification) and efficient field estimation (MeanFlow), yielding improved sample quality and faster convergence [2511.23342].

## 6. Algorithmic Workflow

### Training Procedure

```python
# Train 1-rectified flow
for i in range(T_flow):
    x = sample_data()
    z = sample_prior()
    t = uniform(0, 1)
    z_t = (1-t)*x + t*z
    target = z - x
    theta -= eta * grad(norm(v_theta(z_t, t) - (z-x))**2)
# Freeze v^1

# Coupling generation and truncation
couplings = []
for i in range(N):
    x = sample_data()
    z = solve_backward_ODE(x, v^1)
    d = norm(x-z)
    couplings.append((x, z, d))
q = percentile(couplings, 100-k)
RectifiedSet = [pair for pair in couplings if pair[2] <= q]

# Train MeanFlow on rectified set
for j in range(T_MF):
    x, z = sample(RectifiedSet)
    r, t = sample_times()
    z_t = (1-t)*x + t*z
    u_tgt = v^1(z_t, t) - (t-r)*JVP_time(u_phi(z_t, r, t))
    phi -= eta * grad(norm(u_phi(z_t, r, t) - stopgrad(u_tgt))**2)
# Output: trained model u_phi
```

### One-Step Sampling

```python
z = sample_prior()
x_hat = z - u_phi(z, r=0, t=1)
return x_hat
```

## 7. Empirical Performance

Rectified MeanFlow exhibits superior sample quality and training efficiency relative to previous one-step and rectified flow distillation methods, as evidenced by class-conditional FID scores on ImageNet:

| Resolution   | Backbone (CFG/Autoguidance) | 2-rectified flow++ FID | Prior best one-step FID | Re-MeanFlow FID |
|--------------|-----------------------------|------------------------|------------------------|-----------------|
| 64×64        | EDM2-S, Autoguidance        | 4.31                   | ≈2.88                  | **2.87**        |
| 256×256      | SiT-XL, CFG                 | –                      | 3.43                   | **3.41**        |
| 512×512      | EDM2-S, Autoguidance        | –                      | 3.32 (AYF)             | **3.03**        |

Training efficiency (ImageNet-64): GPU-hours reduced by 2.9× vs AYF and 26.6× vs. 2-rectified flow++. FLOPs remain lowest among comparably accurate one-step models [2511.23342].

## 8. Extensions, Practical Applications, and Broader Impact

Rectified MeanFlow principles have been adapted to image enhancement scenarios, notably in FlowIE [2406.00508]. There, rectified flows establish linear many-to-one mappings from noise to high-quality images, conditioned via adapters leveraging coarse restorations. Second-order explicit midpoint integration reduces inference to 4–5 steps, resulting in over 10× speedup compared to diffusion-based methods, while maintaining or improving visual fidelity across tasks such as blind super-resolution, colorization, inpainting, and dehazing. Ablations confirm that the mean-value update imparts measurable improvements over Euler schemes, underscoring the generality and practical utility of the rectified meanflow approach in real-world enhancement pipelines.

## 9. Related Advances and Optimization Considerations

Recent developments explore the decomposition and optimization dynamics of MeanFlow, as in AlphaFlow [2510.20771], which addresses the gradient conflict between trajectory flow matching and consistency, leading to curriculum-based convex objectives that further improve convergence and overall sample quality. Improved MeanFlow (iMF) [2512.02012] reformulates the training loss for network-independence and introduces flexible explicit guidance, achieving even higher single-step FID on ImageNet by combining multi-token conditioning and streamlined architectures.

---

Rectified MeanFlow establishes a synthesis between geometric trajectory straightening and fastforward velocity field modeling, facilitating efficient, high-fidelity one-step generation with broad empirical and applied success [2511.23342, 2406.00508].

Source: https://www.emergentmind.com/topics/rectified-meanflow