Why Can a Standard Diffusion Model Not Take One Step?
Motivation
Velocity \neq displacement: A velocity network \mathbf{u}_{\boldsymbol\theta}(\mathbf{x}_t, t) predicts the instantaneous tangent d\mathbf{x}_t/dt at time t, not the chord to t = 0.
Curved trajectories cause tangent overshoot: Even with the exact field \mathbf{u}_t, a 1-step Euler jump from t = 1 follows \mathbf{u}_1(\mathbf{x}_1) = \mathbf{x}_1 - \mathbb{E}[\mathbf{x}_0] and collapses all samples onto the global mean \mathbb{E}[\mathbf{x}_0].
Two routes to 1–4 steps: Straighten or integrate trajectories via Reflow / Flow Maps, or match densities directly via DMD / ADD.
Quantifying Few-Step Euler Failure on the Exact Field
1, 2, 4, and 10 Euler Steps on the 2D Mixture
Running Euler’s method on the exact mixture velocity mix.velocity from 20{,}000 Gaussian starts establishes the baseline that few-step generators must beat:
1 Euler step: Collapses 100\% of starts onto (-0.5, -0.7) in the empty valley between modes (weights[1, 0, 0], 100\% strays).
2 Euler steps: Separates into three clusters, but leaves \approx 25\% strays and severely distorts mode weights to [0.64, 0.22, 0.14] (vs. [0.50, 0.30, 0.20]) because the first half-step pulls all points toward (-0.5, -0.7), closest to mode 1.
4 vs. 10 Euler steps: Strays remain at \approx 6.5\% at 4 steps before dropping to \approx 2\% at 10 steps (\approx 1\% in true data).
Why independent chords curve the ODE: Independently drawn segments (1-t)\mathbf{x}_0 + t\boldsymbol\epsilon cross everywhere, forcing non-crossing marginal ODE trajectories to bend around intersections.
Reflow (Liu, Gong & Liu, 2022): Pairs noise \mathbf{z} with teacher ODE endpoints \hat{\mathbf{x}}_0 = \Phi_{1 \to 0}(\mathbf{z}) to obtain nearly non-crossing chords, though it requires full synthetic dataset generation and inherits teacher errors.
Flow Maps and the Average Velocity Field
Learning the ODE Solution Instead of Its Derivative
Instead of straightening trajectories by re-pairing data, we can train a network to output the flow map\Phi_{t \to s}(\mathbf{x}_t)—the exact point where the ODE trajectory through (\mathbf{x}_t, t) arrives at time s \le t:
Average velocity \bar{\mathbf{u}}(\mathbf{x}_t, s, t): The time-averaged velocity along the curved trajectory over [s, t].
Boundary condition at zero step (s \to t): As s \to t, the average velocity collapses to the instantaneous velocity: \bar{\mathbf{u}}(\mathbf{x}_t, t, t) = \mathbf{u}_t(\mathbf{x}_t)
One-step & multi-step sampling: A single evaluation \mathbf{x}_1 - \bar{\mathbf{u}}(\mathbf{x}_1, 0, 1) jumps straight from noise to data.
Worked Example: Exact Flow Map on 1D Gaussian Data
Why Average Velocity Preserves Spread While Euler Collapses
Exact quantile preservation: For x_0 \sim \mathcal{N}(2, 0.5^2) with k_t = \sqrt{0.25(1-t)^2 + t^2}, the 1D ODE preserves the standardized z-score from t=1(k_1 = 1) to s=0(k_0 = 0.5).
1-Step Euler jump (u_1(x) = x - 2): Lands at x - (x - 2) = \mathbf{2}, collapsing variance to zero.
Three Differential Identities Characterizing Flow Maps
Compositional, Lagrangian, and Eulerian Formulations
1. Compositional (Semigroup):\Phi_{r \to s}(\Phi_{t \to r}(\mathbf{x}_t)) = \Phi_{t \to s}(\mathbf{x}_t), using two student passes at r and no derivatives (Progressive Distillation, Shortcut Models).
2. Lagrangian (Moving endpoint s):\partial_s \Phi_{t \to s}(\mathbf{x}_t) = \mathbf{u}_s(\Phi_{t \to s}(\mathbf{x}_t)), evaluating velocity \mathbf{u}_s at the landing point \Phi_{t \to s}(\mathbf{x}_t).
3. Eulerian (Moving start t):\partial_t \Phi_{t \to s} + (\nabla_{\mathbf{x}}\Phi_{t \to s})\mathbf{u}_t = \mathbf{0}, evaluating velocity \mathbf{u}_t at the start point \mathbf{x}_t via 1 forward-mode JVP (Consistency Models, MeanFlow).
Fixed endpoint s = 0 (Song et al., 2023): Enforces f_{\boldsymbol\theta}(\mathbf{x}_t, t) = \Phi_{t \to 0}(\mathbf{x}_t) along every trajectory with boundary condition f_{\boldsymbol\theta}(\mathbf{x}_0, 0) = \mathbf{x}_0.
Why multi-step sampling requires stochastic re-noising: Because f_{\boldsymbol\theta} only jumps to s = 0, a second step must re-corrupt \hat{\mathbf{x}}_0 to t = 0.5 with fresh noise \boldsymbol\epsilon', losing the deterministic ODE bijection.
Product-rule derivation (Geng et al., 2025): Differentiating (t - s)\,\bar{\mathbf{u}}(\mathbf{x}_t, s, t) = \int_s^t \mathbf{u}_\tau(\mathbf{x}_\tau)\,d\tau with respect to t at fixed s yields an explicit fixed-point target for \bar{\mathbf{u}}.
Single forward-mode JVP: Along d\mathbf{x}_t/dt = \mathbf{u}_t, the total derivative \frac{d}{dt}\bar{\mathbf{u}} = \partial_t\bar{\mathbf{u}} + (\nabla_{\mathbf{x}}\bar{\mathbf{u}})\mathbf{u}_t is one JVP along tangent (\mathbf{u}_t, 1).
2×2 unification: Choosing teacher \hat{\mathbf{u}}_{\boldsymbol\phi} vs. conditional \boldsymbol\epsilon - \mathbf{x}_0 and s = 0 vs. s \le t recovers Consistency Distillation, Flow-Map Distillation, Consistency Training, and MeanFlow.
Mandatory stop-gradient \mathrm{sg}[\cdot]: Freezing \boldsymbol\theta inside the target prevents the student from minimizing variance by collapsing \nabla_{\mathbf{x}}\bar{\mathbf{u}}_{\boldsymbol\theta}.
Implementing Flow-Map Error & Slow Time Embeddings
Avoiding JVP Instability in Time Features
In code, flow_map_error evaluates \bar{\mathbf{u}}_{\boldsymbol\theta} and its directional derivative d\bar{\mathbf{u}}_{\boldsymbol\theta}/dt simultaneously in a single jvp call:
def flow_map_error(u, teacher, x0, eps, s, t):"""Per-example squared error of the average velocity u(x_t, s, t) against the stop-gradient target v - (t - s) du/dt; v from teacher, or eps - x0.""" x_t = d2l.GaussianPath.linear().sample(x0, t, eps)if teacher isNone: v = eps - x0else:with torch.no_grad(): v = teacher(x_t, t) u_t, du_dt = torch.func.jvp(lambda x, r: u(x, s, r), (x_t, t), (v, torch.ones_like(t))) gap = (t - s).reshape(-1, *[1] * (x0.dim() -1)) target = (v - gap * du_dt).detach()return ((u_t - target) **2).flatten(1).sum(1)
Implementing Flow-Map Error & Slow Time Embeddings (cont.)
Avoiding JVP Instability in Time Features
Why flow maps use slow sinusoidal time frequencies (slow = (1e-4, 1.0)):
Differentiating \sin(\omega t) with respect to t multiplies the feature by its angular frequency: \frac{d}{dt}\sin(\omega t) = \omega\cos(\omega t).
Standard diffusion embeddings use \omega up to 64 or 1{,}000, which amplifies JVP gradients inside the target by 64\times to 1{,}000\times and destabilizes consistency training (Lu & Song, 2025). Restricting \omega \le 1.0 keeps time derivatives O(1).
Training Three Few-Step Students on the 2D Mixture
Comparing Distillation vs. Teacher-Free MeanFlow
Using a 20,000-step teacher TimeMLP, we train six random seeds (seeds 2..7) of three student types—consistency(s = 0, teacher), distillation(s \le t, teacher), and MeanFlow(s \le t, no teacher):
consistency, seeds 2 to 7: mean loss of the last 1,000 updates 0.073 to 0.083
distillation, seeds 2 to 7: mean loss of the last 1,000 updates 0.030 to 0.037
MeanFlow, seeds 2 to 7: mean loss of the last 1,000 updates 76.136 to 81.287
Why distilled losses approach 0 while MeanFlow plateaus at \approx 80:
Distilled students regress onto a deterministic function of (\mathbf{x}_t, s, t) supplied by the teacher, reaching \approx 0.03–0.08.
MeanFlow substitutes the noisy per-example conditional velocity \boldsymbol\epsilon - \mathbf{x}_0 into both \mathbf{u}_{\textrm{ref}} and the JVP tangent (\mathbf{u}_{\textrm{ref}}, 1), creating a large irreducible conditional variance floor (\approx 76–85).
Benchmarking Few-Step Students on the 2D Mixture
1, 2, and 4 Evaluations Across Six Training Seeds
We evaluate all 18 trained student networks on 20{,}000 Gaussian starts against 50-step teacher Euler and true data:
Benchmarking Few-Step Students on the 2D Mixture (results)
1, 2, and 4 Evaluations Across Six Training Seeds
Mode-weight error for each of the six seeds, the fraction of stray samples between modes, and the within-mode spread:
Analyzing the Teacher-Free Mode-Contraction Defect
Why a Pretrained Teacher Velocity Is Worth Having
Comparing the six independent seeds of two-time distillation against teacher-free MeanFlow isolates the exact effect of replacing the teacher’s marginal velocity \hat{\mathbf{u}}_t(\mathbf{x}_t) with \boldsymbol\epsilon - \mathbf{x}_0:
Why noisy JVP tangents contract spread: When \boldsymbol\epsilon - \mathbf{x}_0 drives the JVP tangent, high variance in the correction term (t - s)\,d\bar{\mathbf{u}}/dt causes the student to under-fit the curvature correction—partially reverting toward a coarse Euler stride that shrinks mode variance.
Distilling a Few-Step U-Net Student on Fashion-MNIST
Zero-Initialized Gap Conditioning
To distill our 1.2\text{M}-parameter Fashion-MNIST velocity U-Net into a two-time flow map UNetFlowMap, we initialize the student as an exact copy of the teacher and inject the step gap t - s through a zero-initialized linear layer:
class UNetFlowMap(nn.Module):"""u(x, s, t): a velocity U-Net, plus a zero-initialized input for the gap t - s. The caller passes a copy of the teacher's U-Net."""def__init__(self, unet):super().__init__()# the teacher is an EMA copy with gradients off; the student trainsself.unet = unet.requires_grad_(True)self.gap = nn.Linear(unet.emb_dim, unet.emb_dim) nn.init.zeros_(self.gap.weight), nn.init.zeros_(self.gap.bias)def forward(self, x, s, t): gap =self.gap(d2l.time_embedding(t - s, self.unet.emb_dim,self.unet.time_freqs))returnself.unet(x, t, cond=gap)
Distilling a Few-Step U-Net Student on Fashion-MNIST (cont.)
Zero-Initialized Gap Conditioning
Warm-starting at the teacher’s velocity: Because self.gap is initialized to zero, \bar{\mathbf{u}}_{\boldsymbol\theta}(\mathbf{x}_t, s, t) = \hat{\mathbf{u}}_{\textrm{teacher}}(\mathbf{x}_t, t) at step 0.
50% diagonal anchor (s = t): Half of each minibatch sets s = t (where the target is simply the teacher’s instantaneous velocity \hat{\mathbf{u}}_{\textrm{teacher}}) so the student never forgets the tangent field while learning long jumps s < t over 5{,}000 updates.
Teacher Euler vs. Student Jumps on Fashion-MNIST
FD Scaling from 1 to 50 Evaluations
Evaluating the teacher (1 to 50 Euler steps) and two distilled students (seed 2, 3 at 1, 2, 4 jumps) on 1{,}000 shared noise images shows a massive few-step gain:
Trajectory Preservation: Teacher Euler vs. Student
Comparing 50-Step Teacher, 2-Step Teacher, and 1–2 Student Jumps
UNetFlowMap follows the teacher’s deterministic ODE, so each column starts from the same noise \mathbf{z}_i and yields the same garment:
Row 1 vs. Row 2 (Teacher 50 vs. 2 Euler steps): Two Euler steps produce blurry, low-contrast ghosts that often fail to commit to the right garment category.
Row 3 vs. Row 4 (Student 1 vs. 2 jumps): Even a single jump (Row 3) recovers the 50-step teacher’s garment silhouette and shade in every column; two jumps (Row 4) sharpen edges and textures to near-teacher quality.
Distribution Matching Distillation (DMD) and Critics
Matching Marginal Densities Instead of ODE Trajectories
Distribution Matching Distillation (DMD; Yin et al., 2024): Re-noises 1-step fake samples \mathbf{x}_t = (1-t)g_{\boldsymbol\theta}(\mathbf{z}) + t\boldsymbol\epsilon and descends the reverse-KL score difference across noise levels t.
Trade-off vs. Flow Maps: Adding a real-image adversarial critic (ADD / DMD2) can surpass teacher FD in 1 step, but abandons the deterministic ODE trajectory bijection \mathbf{z} \leftrightarrow \mathbf{x}_0.
Test your understanding of flow-map identities and few-step distillation:
Verifying the MeanFlow identity on 1D Gaussians: For x_0 \sim \mathcal{N}(2, 0.5^2) at s = 0, t = 1, we found \bar{u}(x, 0, 1) = 0.5x - 2 and instantaneous velocity u_1(x) = x - 2. According to the MeanFlow identity \bar{u} = u_1 - (1 - 0)\frac{d}{dt}\bar{u}, what must the total derivative \frac{d}{dt}\bar{u}(x_t, 0, t) equal at t = 1?
Why two-step mode weights skew toward the heaviest mode: On our 2D mixture with weights (0.5, 0.3, 0.2), why do 2 Euler steps on the exact velocity field assign weight 0.64 to mode 1 instead of 0.50?
Answers:
By the MeanFlow identity, \frac{d}{dt}\bar{u} = u_1(x) - \bar{u}(x, 0, 1) = (x - 2) - (0.5x - 2) = \mathbf{0.5\,x}. (Directly: along a trajectory \bar{u}(x_t, 0, t) = (x_t - x_0)/t, so \frac{d}{dt}\bar{u} = (u_t - \bar{u})/t = 0.5x at t = 1.)
At t = 1, the first half-step aims every point toward the global data mean \mathbb{E}[\mathbf{x}_0] = (-0.5, -0.7), which lies spatially closest to the heaviest mode (-2.5, -1.5), pushing extra mass into mode 1’s basin of attraction at t = 0.5.
Preserving the noise-to-image pairing at 2 NFE: Among a consistency model (s = 0), a two-time flow map (s \le t), and an adversarially distilled 1-step generator, which model produces a 2-evaluation sample that is still a purely deterministic function of the initial noise \mathbf{z}?
Answer:
Only the two-time flow map (\bar{\mathbf{u}}(\mathbf{x}_t, s, t)): It composes two deterministic jumps \Phi_{0.5 \to 0}(\Phi_{1 \to 0.5}(\mathbf{z})) along the same ODE trajectory, whereas consistency and 1-step generators must inject fresh random noise \boldsymbol\epsilon' at t = 0.5.
Summary: Few-Step Generation Paradigms
Key Takeaways
Method
Network Output & Domain
Training Requirement
Multi-Step Mechanism
Key Strength & Limitation
Euler ODE Solver
Instantaneous \mathbf{u}_t(\mathbf{x}_t)
Standard CFM regression
K tangent steps
Collapses to \mathbb{E}[\mathbf{x}_0] at K = 1; needs 20–50 NFE
Reflow (Rectified Flow)
Instantaneous \mathbf{u}_t(\mathbf{x}_t)
Retrain on teacher pairs (\hat{\mathbf{x}}_0, \mathbf{z})
Straightened Euler steps
Straightens chords, but inherits teacher sample errors