Midpoint two-step Euler vs. full-step endpoint Heun velocity queries at 2 NFE

Same 2 Function Evaluations, 4.7× Worse Feature Distance

Benchmarking OT-CFM, 2-Rectified-Flow, and Shortcut on procedural optical diffraction/interference patterns (32×3232 \times 32 RGB) using an identical 745,136-parameter MicroDiT backbone and matched update budget exposed a striking reversal at 2 NFE:

Evaluating the exact same OT-CFM weights from identical initial noise, two-step explicit Euler achieved a feature Sliced Wasserstein Distance (SWD, lower is better) of 0.1692, whereas one-step Heun (2nd-order predictor–corrector) degraded to 0.7929—with 31.14% of raw output channels saturating outside [0,1][0, 1] before clipping, compared to 0.012% for Euler.

Mechanism: Full-Step Extrapolation Queries an Out-of-Distribution Endpoint

Writing out both 2 NFE rules side by side pinpoints the failure:

k1=vθ(x0,0),xEuler=x0+12k1+12vθ ⁣(x0+12k1,  12),xHeun=x0+12[k1+vθ(x0+k1,  1)]k_1 = v_\theta(x_0, 0), \qquad x_{\text{Euler}} = x_0 + \frac{1}{2}k_1 + \frac{1}{2}v_\theta\!\left(x_0 + \frac{1}{2}k_1,\; \frac{1}{2}\right), \qquad x_{\text{Heun}} = x_0 + \frac{1}{2}\big[k_1 + v_\theta(x_0 + k_1,\; 1)\big]
  • Two-step Euler advances halfway first, re-querying the network at t=0.5t = 0.5 where noisy interpolation paths overlap densely during training.
  • One-step Heun extrapolates the coarse t=0t = 0 tangent all the way to t=1t = 1 (x0+k1x_0 + k_1). At t=1t = 1, training supervision is concentrated strictly on clean data samples; the crude predictor lands off-manifold where the learned velocity field is poorly constrained, mixing a large endpoint error back in with weight 1/21/2.

Across low-NFE budgets, staying inside well-supported intermediate marginals matters far more than asymptotic solver order:

Objective & Sampler NFE Feature SWD ↓ Operating Sweet Spot
OT-CFM + 1-step Euler 1 0.3287 Naive tangent baseline
2-Rectified-Flow + 1-step Euler 1 0.1985 Sharpest 1-step edge fidelity (0.836)
Shortcut + direct step (d=1d=1) 1 0.1819 Best 1-NFE distribution (-44.7% SWD)
Shortcut + 2 equal steps (d=0.5d=0.5) 2 0.1587 Best 2-NFE point (keep dyadic grid!)
OT-CFM + 4-step uniform Euler 4 0.1436 Best overall 4-NFE distribution

One practical pitfall: because Shortcut trains on dyadic step sizes d∈{1,1/2,1/4,… }d \in \{1, 1/2, 1/4, \dots\}, feeding a non-uniform 2-step schedule at test time worsens SWD from 0.1587 to 0.6466.

torch.compile 3.24× Speedup & BF16 Cast Alignment

On an RTX 4060 Ti (batch = 1, BF16 autocast), compiling the 4-step OT-CFM network via TorchInductor cut steady-state median latency from 29.57 ms to 9.14 ms (3.24× speedup). However, fused kernels bypass eager intermediate BF16 downcasts, pushing worst-case paired trajectory drift to 0.386 RMSE. Enabling explicit cast emulation restores numerical parity (0.386 → 0.119 worst-case, 0.0088 median RMSE) at only a 2.5% latency cost:

compiled_net = torch.compile(
    model,
    backend="inductor",
    fullgraph=True,
    dynamic=False,
    options={"emulate_precision_casts": True},
)

Measured datasets & code: 375-row quality matrix · 600-row CUDA latency log · Precision cast probes · MIT core source ZIP