Introduction
Sampling from a diffusion model is the solution of the probability-flow ODE. In the convention of this task, , the network returns , and
Every network evaluation costs the same, and the question is how to turn a very small number of them into an image: where to query the network, how to combine what it returned, whether the update may leave the span of those returns, how the network should be conditioned at each query, and which of these choices to fit to the model.
The field's answers fall into three families. Training-free multistep solvers reuse past evaluations with fixed coefficients, in the exponential-integrator, pseudo-numerical and predictor-corrector lines of work [1, 2, 3, 4], with coefficients informed by empirical model statistics [5], or by combining past and future scores [6]. Learned solvers keep the network fixed and fit the discretisation [7], dynamic weights on the gradients [8], other parts of a fast ODE sampler [9], or an update that leaves the linear span of the evaluations [10]. A third route, taken by MTEO [11], one of this task's baselines, fits the network's conditioning itself: step-wise, layer-wise time embeddings distilled from reference trajectories.
The difficulty is structural. Integrating the ODE exactly from to gives
where is a probability density on with its mass near . A first-order step replaces by , and a linear multistep solver replaces it by a fixed combination of past 's. Either way the output is, up to a vanishing multiple of the initial noise, a linear combination of posterior means. For Gaussian data with a mode of variance , the posterior mean is , while the exact step multiplies that mode by . For a large step, with , the quantity the step actually needs scales like while the posterior mean scales like : a large step must carry frequencies that are still noise-dominated, and the posterior mean suppresses exactly those. That is the blur of few-step sampling, and no choice of fixed scalar coefficients over posterior means removes it.
Method
We propose the conditioned Markov solver (CMS). Its central idea is to stop treating the network as a fixed posterior-mean oracle and to fit, for every evaluation, the conditioning that makes the network return the quantity its own step needs.
The secant denoiser, and why the update is Markov
Call on the interval the secant denoiser of step . With , it is the target that makes a first-order step exact,
and because the probability-flow ODE is deterministic, is a function of the current state alone. An evaluation whose conditioning has been fitted for step can therefore learn to output it. This changes the role of history. If the update also carries a term in , the quantity the conditioned network must produce becomes minus a multiple of ; that target depends on the path the solver took to reach , and a network conditioned only by a few per-step offsets has to undo that path implicitly. The target is still formally a function of , since the map from the initial noise to is generically invertible, but it is a much harder one. History helps a linear solver because there the network is fixed; with conditioned evaluations it gets in the way. We therefore keep the update in DDIM form, the exponential-integrator update for , with evaluations, one per step.
The update
Our step from at level to level is
where is the conditioned network output at step , is a learned log-scale on the state coefficient, and are history residuals. All of , and the filter parameters start at zero, so at initialisation the update is exactly DDIM. The history residuals are learned only in the end-to-end phase and are free to stay near zero.
def _step(P, t, i, x, Ds):
r = t[i + 1] / t[i]
h = 1 - r
y = (r * torch.exp(P["dx"][i].double())) * x
acc = Ds[i]
for j in range(i + 1):
acc = acc + P["dw"][i, j].double() * Ds[j]
acc = h * acc
if "spec" in P:
y = _filt(y, P["spec"][i, 0])
acc = _filt(acc, P["spec"][i, 1])
return y + accand are spectral filters that multiply each Fourier coefficient by a per-channel gain , where are hat functions interpolating 8 radial-frequency bands. They are motivated by the Gaussian calculation above: the exact step is a frequency-dependent multiplication of the state, while DDIM uses one scalar for all frequencies. A filter lets the state coefficient depend on frequency, which takes the update out of the span of at a cost of 64 numbers per step for the two filters together.
def _filt(x, theta):
"""x [n, C, h, w] float64; gain exp(theta) per radial band and channel (theta [>=C, bands])."""
hat = _hat(x.shape[-2], x.shape[-1], theta.shape[-1], x.device)
g = torch.exp(torch.einsum("cb,bhw->chw", theta.double()[: x.shape[1]], hat))
return torch.fft.irfft2(torch.fft.rfft2(x, norm="ortho") * g, s=x.shape[-2:], norm="ortho")Per-evaluation conditioning
Each evaluation receives its own additive offsets on the time-embedding input of every block of
the network that consumes the time embedding, and, for a model sampled with classifier-free guidance,
an offset on the unconditional prompt embedding as well. The query level is , with
a learned log-offset. When per-evaluation offsets for every step would exceed the interface's limit
on fitted parameters, the later evaluations share the last offset slot. The evaluations are placed on
a time-uniform grid with , obtained from the task's grid(K, "time_uniform", 2.0), and the
first evaluation is at .
A closed-form first interval for noise-prediction networks
For a network that natively predicts noise, , so any error in is multiplied by in , and an evaluation at says very little about . For such networks without prompt guidance, and only when , we skip that evaluation and integrate the first interval in closed form with the Gaussian flow of the model's own sample statistics. Per Fourier mode, with the mean of the teacher's samples and their per-mode power,
and the evaluations then start at . The jump is used only if exceeds 1.5 times the next grid level (or ), and its statistics are counted against the parameter limit. Networks that output through a preconditioned parameterisation keep their first evaluation at , where it acts as a layout generator.
def _teleport(P, z, T, t1):
"""Gaussian flow from (T, T z) to level t1 per Fourier mode: x = mu + sqrt((lam + t1^2)/(lam + T^2)) (T z - mu)."""
lam = P["tp_lam"].double() # [C, h, w//2+1] per-mode data power (model samples)
mu = P["tp_mu"].double() # [C, h, w] mean image
g = torch.sqrt((lam + t1 ** 2) / (lam + T ** 2))
X = torch.fft.rfft2(z.double() * T - mu, norm="ortho") * g
return mu + torch.fft.irfft2(X, s=z.shape[-2:], norm="ortho")
def _rollout(P, t, z, den, names, text):
if "tp_lam" in P:
x = _teleport(P, z, float(P["tp_T"][0]), t[0])
else:
x = z.double() * t[0]
Ds = []
for i in range(len(t) - 1):
tq = (t[i] * torch.exp(P["qs"][i].double())).float()
Ds.append(den(x.float(), tq, **_cond(P, i, names, text)).double())
x = _step(P, t, i, x, Ds)
return x.float()Fitting: stage-wise, then end to end
Fitting runs once per model and budget. A teacher, a multistep DPM-Solver++ [3] of order 3 (order 2 for the guided model) run on a log-uniform refinement of our grid, gives the teacher's state at every one of our levels for a bank of the model's own noise draws.
Phase 1 fits the conditioning of each evaluation in turn. Starting from the student's own state after the previous fitted steps, it minimises the relative squared error between the step's output and the teacher's state at the next level. With the step parameters still at zero, this regresses onto , the secant from the student's state to the teacher's next state. The learning rate decays geometrically across stages, from 0.03 to 0.02 for the guided model and for unconditional pixel models and from 2e-2 to 2e-3 otherwise; a stage stops at its epoch cap, after 8 consecutive epochs of less than 0.2% relative improvement, or at its share of the fitting deadline.
tq = t[i].float().to(dev)
tgt_scale = float(st[:nt, i + 1].float().pow(2).mean()) + 1e-8
prev, pat, ep = None, 0, 0
while ep < c["ep"] and pat < 8 and el() < stage_end(i):
perm = torch.randperm(nt, generator=gen).to(dev)
tot = 0.0
for j in range(0, nt, c["sbs"]):
b = perm[j:j + c["sbs"]]
kw = {"temb": {n: prm[0][q] for q, n in enumerate(names)}}
if text:
kw["uncond"] = prm[1]
Di = den(x_cur[b].float(), tq, rows=b, **kw, **fp).double()
xn = _step(P, t, i, x_cur[b], [D[b] for D in Ds] + [Di])
loss = (xn - st[b, i + 1].double()).pow(2).mean() / tgt_scale
opt.zero_grad(set_to_none=True)
loss.backward()
opt.step()
tot += float(loss) * len(b)
cur = tot / nt
if prev is not None:
pat = pat + 1 if (prev - cur) / max(prev, 1e-12) < 2e-3 else 0
prev = cur
ep += 1
with torch.no_grad():
P["phi"][s] = prm[0].detach()
if text:
P["unc"][s] = prm[1].detach()
kw = _cond(P, i, names, text)
Ds.append(torch.cat([den(x_cur[j:j + c["sbs"]].float(), tq, rows=ar(j, min(j + c["sbs"], nt)), **kw, **fp).double()
for j in range(0, nt, c["sbs"])]))
x_cur = _step(P, t, i, x_cur, Ds)Phase 2 fine-tunes all parameters end to end on the endpoint. With the Inception features and for paired noise draws in a batch of size , the loss is
The second term is what makes the loss track the metric. Writing ,
so weights the bias , which is FID's mean term, by , and the per-sample variance, which is largely irreducible and is not what FID measures, by only . Because the features are paired, the estimate of the bias has low variance. Losses on Fréchet distances in a representation space are a recent line of work in their own right [12]; ours is the paired, mean-only part, added to a per-sample regression. Phase 2 uses Adam with a learning rate of 1e-3 on the embedding offsets and 5e-3 on the query-level, step and filter parameters, gradient clipping at 1.0, and a cosine schedule whose progress is the larger of the iteration fraction and the elapsed fraction of the time left, so it is fully annealed even when the deadline arrives first.
for it in range(iters):
prog = max(it / iters, (el() - e2e_t0) / e2e_T)
if prog >= 1.0:
break
for g, b0 in zip(opt.param_groups, base_lrs):
g["lr"] = b0 * (0.05 + 0.95 * 0.5 * (1 + math.cos(math.pi * prog)))
b = torch.randint(0, ntr, (c["ebs"],), generator=gen).to(dev)
e = feat(_rollout(P, t, z[b], rows_den(b), names, text)) - ft[b]
loss = e.pow(2).mean() + c["meanw"] * e.mean(0).pow(2).mean()
opt.zero_grad(set_to_none=True)
loss.backward()
torch.nn.utils.clip_grad_norm_([P[kk] for kk in learn], 1.0)
opt.step()
if (it + 1) % every == 0:
print(f"e2e {it + 1} loss {loss.item():.4f} el {el():.0f}s", flush=True)
# only the annealed endpoint of phase 2 competes with the stage-wise snapshot (intermediate e2e states are not annealed)
v = val_loss()
print(f"e2e final val {v:.5f} (stage-wise {best_v:.5f}) el {el():.0f}s", flush=True)
if v < best_v:
best_v, best = v, {k: vv.detach().clone() for k, vv in P.items()}Held-out bank samples, scored with the same paired-plus-mean measure, decide between only two
candidates: the stage-wise snapshot and the final annealed end-to-end snapshot. The end-to-end one is
taken only if it scores strictly lower. If fitting fails after the stage-wise phase has finished, distill returns the
stage-wise snapshot; if it fails earlier, or the fitted levels do not match the requested budget, sample falls
back to training-free DPM-Solver++ on the same grid.
Results
| Method | ① | ② | ③ | ④ |
|---|---|---|---|---|
| FID ↓ | FID ↓ | FID ↓ | FID ↓ | |
| Claude Opus 5.5 | 3.935 | 4.008 | 14.13 | 15.02 |
| iPNDM | 45.97 | 55.39 | 17.50 | 16.17 |
| PFDiff | 38.73 | 45.38 | 19.49 | 15.14 |
| LD3 | 38.03 | 42.22 | 16.29 | 14.36 |
| DyWeight | 17.90 | 16.96 | 15.51 | 15.04 |
| AMED | 26.37 | 29.61 | 16.48 | 14.76 |
| SpanLift | 13.18 | 14.25 | 14.77 | 15.03 |
| MTEO | 5.650 | 5.040 | 14.29 | 14.61 |
| DPM-Solver++ | 19.41 | 16.78 | ||
| UniPC-3 | 19.38 | 16.77 | ||
| DEIS-tAB3 | 42.37 | 21.65 | 14.65 |
- ① FFHQ 64×64 · 3 network evaluations
- ② ImageNet 64×64 (class-conditional) · 3 network evaluations
- ③ Text-to-image, Stable Diffusion v1.5 · 512 px · COCO captions · 5 guided evaluations
- ④ Text-to-image, Stable Diffusion v1.5 · 512 px · COCO captions · 8 guided evaluations
On FFHQ64/3NFE and IN64/3NFE CMS is clearly ahead of every baseline with a reported value: an FID of 3.935 on FFHQ64/3NFE against 5.650 for the strongest baseline, MTEO [11], and 4.008 on IN64/3NFE against 5.040 (MTEO [11]). The learned-coefficient and learned-timestep methods are much further behind there, for example 17.90 for DyWeight and 38.03 for LD3 on FFHQ64/3NFE, and the training-free multistep solvers further still (45.97 for iPNDM).
On SD1.5/5NFE CMS is ahead of every baseline, but narrowly: 14.13 against 14.29 for MTEO [11], with SpanLift next at 14.77.
On SD1.5/8NFE CMS is behind four baselines: 15.02 against 14.36 for LD3, 14.61 for MTEO, 14.65 for DEIS-tAB3 and 14.76 for AMED-Plugin. It is level with DyWeight (15.04) and SpanLift (15.03), and ahead of the remaining baselines with a reported value. On SD1.5/5NFE and SD1.5/8NFE the leading baselines lie much closer together than on FFHQ64/3NFE and IN64/3NFE, and so does CMS.
How we got here
CMS was narrowed down by failures more than it was assembled, and the failures shaped every part of it. All figures in this section are our own development measurements, on development samples and references, quoted as recorded during the work; they are not comparable with the table above.
- We started from the strongest baseline we could reproduce. We read and ran the baselines first. Per-step time-embedding optimisation [11] was far ahead of the learned linear solvers on our smallest development model (development FID 4.74, against 9.03 for LD3 and 9.24 for AMED at the same moderate budget). Our own re-implementation of that recipe, DDIM steps with stage-wise fitted offsets, reached 4.76, which validated our fitting code. Our analysis at that point listed what such a solver leaves on the table: blur from regressing the last step onto the teacher, a myopic stage-wise fit with no global refinement, an uninformative first evaluation, unused history and a fixed schedule.
- Our first design added history, and it failed badly. We combined the per-step offsets with an order-2 exponential-integrator multistep base, an analytic first step and a learned schedule. With stage-wise fitting alone it reached a development FID of 23.3 at the tightest budget we compared, and the order-2 base with conditioned steps gave 7.89 against 4.76 for the DDIM base at a moderate budget. The secant-denoiser argument of Section 2 is our explanation of that failure: history makes each step's target path-dependent. An analytic first step did not clearly improve on evaluating the conditioned network at either, so the pixel models keep that evaluation.
- Spectral filters came from the Gaussian calculation. On a purely linear learned solver, with only about twenty scalars, multiplicative filters took the development FID from 8.84 to 8.22, and the log-gain parameterisation we kept reached 7.86; an additive form was worse, at 10.89. Once the steps were conditioned the filters mattered little: removing them in a late ablation gave 5.02, within noise of the full method. We kept them because they cost almost nothing.
- The end-to-end phase, and then its bias term, each brought a clear gain. On top of the stage-wise init, end-to-end fine-tuning on paired Inception features moved our development FID at the tightest budget we compared from about 5.85 to 5.48, and adding the feature-mean term took it to 5.04. Fitting end to end without the stage-wise init gave 7.03, so the stage-wise phase is the initialisation the end-to-end phase needs. Late ablations at a moderate budget confirmed both pieces: 4.71 without the end-to-end phase and 4.65 without the mean term, against 4.41 to 4.55 for the full method.
- The grid was settled by a sweep. Time-uniform with gave 4.97, against 5.11 for , 5.42 for the polynomial grid with , 5.50 for a log-SNR grid and 5.87 for . Wherever we compared with an alternative on another model family, it won again, so one grid serves all of them.
- End-to-end fitting first appeared to hurt at larger budgets, and the cause was the schedule. At a larger budget our first full version gave 5.04, worse than stage-wise fitting alone at 4.39. Diagnostics showed the end-to-end samples had lost high-frequency energy. The phase had been cut off by the fitting deadline before its cosine schedule annealed; making the schedule deadline-aware brought the same case to 4.21. For the same reason the held-out choice now compares only the stage-wise snapshot with the final annealed one: on another development model, letting it pick an intermediate, un-annealed snapshot gave 7.01 where the final snapshot gave 6.27.
- On a diverse model, more stage-wise fitting made samples worse. On one development model, 20 epochs per stage gave about 6.3 against about 7.2 with 60, because with limited capacity the regression drifts toward an averaged, low-energy solution; on our smallest model the direction was the opposite. The epoch caps in our configuration differ by model family for this reason. Losses on band energy did not repair the averaging (5.17 against 4.96 on our smallest model), and a closed-form spectral equalisation of the outputs left development FID essentially unchanged, which told us the energy deficit is a symptom of the averaging, not its cause.
- Several further ideas were tested and dropped. Input-adaptive conditioning, in which a pooled feature of the previous evaluation feeds the next evaluation's offsets, gave 4.98 and 5.01 against 4.96. We also dropped learnable grid levels in the end-to-end phase, an exponential moving average of the end-to-end parameters, larger batches, other learning rates, a longer teacher, local-flow stage targets, held-out early stopping of the stages and larger banks, each because it showed no gain beyond noise or was superseded by a simpler choice. Self-conditioning through the time embedding and per-sample query times were set aside in reasoning: the former can pass only a per-channel summary of the previous output, which the state already contains, and the latter is redundant with learned conditioning.
- The closed-form first interval is gated by evidence. On pixel models trained to output through a preconditioned parameterisation, the Gaussian jump changed development FID by at most about 0.2, inconsistently in sign across models and replicates, so it is not used there. On the unguided noise-prediction model in our development set it lowered development FID by about 1.0 to 1.5 at the tightest budget we compared; the gain shrank as the budget grew and reversed at our largest budget. That is the reason for the gate.
- The guided model wanted a longer, slower stage fit. For the model sampled with classifier-free guidance, the end-to-end phase was essential (development FID 37.48 without it, against about 30.5 with it), and a longer stage-wise fit with the slow learning-rate decay brought it to about 28.0. Our reading is that the prompt narrows each step's target and the unconditional-embedding offsets add capacity, so there is little averaging to fear. Extending the slow decay to unconditional pixel models gave a small gain on our smallest model (about 4.84 against 4.98, roughly one to two times our fit-to-fit spread of about 0.15) and a clearer one on a second unconditional model (4.94 to 5.03 against 5.24 to 5.44); on the diverse model it hurt (7.49 against 6.78), which is why that model keeps the fast decay.
- Failure handling was learned the hard way. An out-of-memory error during the end-to-end phase once made the fitting fall back to the training-free solver and lose the stage-wise fit. Fitting now returns the stage-wise snapshot when a failure comes after the stage-wise phase, and uses the training-free fallback only when it comes earlier.
Limitations
- SD1.5/8NFE is not won. CMS is behind four baselines on SD1.5/8NFE, and its lead on SD1.5/5NFE is small. Our contribution is clearest on FFHQ64/3NFE and IN64/3NFE.
- We distil a teacher, so its distance to the data is built into the target. Both phases pull the solver toward a DPM-Solver++ teacher's samples. Where the teacher itself sits away from the reference statistics, matching it more closely is not the same as improving FID. In our development work on the guided model, a per-step time-embedding fit many times longer than ours came out below the teacher's own FID, and our solver reached that level only after we lengthened its stage-wise phase; our loss has no term that aims past the teacher.
- The method needs a fitting phase. Every model and budget needs its own fit against a teacher bank, under a deadline. Because the fit is time-limited it is not exactly repeatable; in development, a fresh fit moved FID by about 0.15 at the tightest budget we compared, against about 0.06 for a new sample set with the same fit.
- Part of the configuration is tuned, not derived. The epoch caps, the learning-rate decay and the gate on the closed-form first interval branch on properties of the model (its conditioning, whether it is latent, its native parameterisation, its resolution), and were chosen from development evidence. They are rules over model families rather than per-setting constants, but we have no theory that fixes them.
- Not every component is shown to matter. The spectral filters were neutral once the steps were conditioned, and the history residuals stay small. We cannot say from the measured results whether the closed-form first interval was active on any setting, so its contribution there is unmeasured.
- Shared offsets at large budgets. When the parameter limit does not allow one offset slot per evaluation, the later evaluations share one, which weakens the per-step conditioning that the method rests on.
References
- Qinsheng Zhang, Yongxin Chen (2023). Fast Sampling of Diffusion Models with Exponential Integrator. ICLR.
- Luping Liu, Yi Ren, Zhijie Lin et al. (2022). Pseudo Numerical Methods for Diffusion Models on Manifolds. ICLR.
- Cheng Lu, Yuhao Zhou, Fan Bao et al. (2025). DPM-Solver++: Fast Solver for Guided Sampling of Diffusion Probabilistic Models. Machine Intelligence Research.
- Wenliang Zhao, Lujia Bai, Yongming Rao et al. (2023). UniPC: A Unified Predictor-Corrector Framework for Fast Sampling of Diffusion Models. NeurIPS.
- Kaiwen Zheng, Cheng Lu, Jianfei Chen et al. (2023). DPM-Solver-v3: Improved Diffusion ODE Solver with Empirical Model Statistics. NeurIPS.
- Guangyi Wang, Yuren Cai, Lijiang Li et al. (2025). PFDiff: Training-Free Acceleration of Diffusion Models Combining Past and Future Scores. ICLR.
- Vinh Tong, Trung-Dung Hoang, Anji Liu et al. (2025). Learning to Discretize Denoising Diffusion ODEs. ICLR.
- Tong Zhao, Mingkun Lei, Liangyu Yuan et al. (2026). DyWeight: Dynamic Gradient Weighting for Few-Step Diffusion Sampling.
- Zhenyu Zhou, Defang Chen, Can Wang et al. (2024). Fast ODE-based Sampling for Diffusion Models in Around 5 Steps. CVPR.
- Sihyeon Kim, Seunghun Lee, Vikas Singh et al. (2026). Learning to Solve Generative ODEs Beyond the Linear Span.
- Yuren Cai, Guangyi Wang, Zongqing Li et al. (2026). Three Creates All: You Only Sample 3 Steps.
- Jiawei Yang, Zhengyang Geng, Xuan Ju et al. (2026). Representation Fréchet Loss for Visual Generation.