Introduction
Sampling from a diffusion model means solving the probability-flow ODE. In the convention of this task, , and the network returns the denoiser , so the ODE is
Each evaluation of is one network call, and the budget allows only a few per image. At that budget the local-truncation arguments behind classical solvers stop holding. A single step across much of the noise range is not small in any useful sense, and the solver's real job is to turn a few expensive, strongly curved measurements of the trajectory into a good endpoint.
The field attacks the problem in three ways. Training-free multistep solvers reuse past evaluations through fixed interpolation weights, either on the derivative, as in pseudo-numerical and exponential-integrator methods [1, 2], or on the data prediction [3, 4], sometimes with model-specific statistics [5]. PFDiff [6] spends each evaluation at a "springboard" point extrapolated from the past score rather than at the current state. Learned solvers fit a few numbers to the model: the time schedule [7], a mean-value direction predictor [8], the multistep weights and time scales [9], or a residual that leaves the linear span of past evaluations [10]. Finally, MTEO [11] fits per-step changes to how the network itself is conditioned. Among the published baselines on this task, MTEO is the strongest on FFHQ64/3NFE, IN64/3NFE and SD1.5/5NFE, and LD3 is the strongest on SD1.5/8NFE.
The question we address is which of these levers is worth fitting when they are fitted together, and in what order.
Method
The solver fits three groups of parameters in three phases and then samples with them. All three phases fit end to end: the fitted solver is run on fresh noise, and its endpoint is compared with the endpoint of a many-step teacher started from the same noise.
The integrator: scalar multistep weights, effective time and springboard queries
Let be the noise levels, with steps. For pixel-space models we integrate on the derivative. After step the solver keeps the derivatives it has measured, , and moves by a fitted combination of the last :
The weights are initialised at the Adams–Bashforth coefficients of order , which is the iPNDM rule [1, 2]. Because a fitted combination no longer sums to one, the solver tracks an effective time, , clamped to , and uses it as the current time of the next step.
We change two things about where the network is queried. Both are fitted per step. The first is a springboard point. With a fitted scalar , the evaluation is taken not at but at
an extrapolation along the previous combined direction. This is PFDiff's idea [6] with a learned distance instead of a fixed one. The second is a query-time scale: the network is told the noise level rather than , clamped to , while the derivative is still formed with . This is the time-scale correction of DyWeight [9]. Both start at zero (, ), so on the derivative path the untrained solver is exactly iPNDM, plus the analytic first step described next where it applies.
When the largest noise level is above 10 (and the model is neither text-conditioned nor a flow model), the first step is analytic. At very high noise the best estimate of is close to zero, so the solver sets , takes , and spends no network call on it. That buys one extra step for the same budget, .
def _run(latents, levels, C, logq, beta, denoise, afs, mode, temb_of=None, uncond_of=None, fp32=False):
if mode == "flow":
return _run_flow(latents, levels, C, logq, beta, denoise, temb_of, uncond_of, fp32)
x = latents * levels[0]; S = len(levels) - 1; H = C.shape[1]
hist = []; t_true = levels[0]; dhat_prev = None
for i in range(S):
tn = levels[i + 1]
tc = t_true if mode == "ab" else levels[i]
if afs and i == 0:
cur = (x / tc) if mode == "ab" else torch.zeros_like(x)
else:
k = i - 1 if afs else i
if dhat_prev is not None:
b = beta[k]; xq = x + b * (tn - tc) * dhat_prev
tq = torch.clamp(tc + b * (tn - tc), min=float(tn) * 0.3, max=float(levels[0]))
else:
xq, tq = x, tc
kw = {}
if temb_of is not None: kw["temb"] = temb_of(k)
if uncond_of is not None: kw["uncond"] = uncond_of(k)
if fp32: kw["fp32"] = True
D = denoise(xq, torch.clamp(tq * logq[k].exp(), min=float(levels[-1]) * 0.5, max=float(levels[0])), **kw)
cur = (xq - D) / tq if mode == "ab" else D
hist.append(cur)
ages = hist[::-1][:H]
hat = sum(C[i, j] * ages[j] for j in range(len(ages)))
if mode == "ab":
x = x + (tn - tc) * hat
t_true = torch.clamp(tc + C[i, :len(ages)].sum() * (tn - tc), min=float(tn) * 0.3, max=float(tc))
dhat_prev = hat
else:
dhat_prev = (x - hat) / tc
a = tn / tc; x = a * x + (1 - a) * hat
return xFor latent models the same loop runs on the data prediction instead. The history being combined is (), and the update is the first-order exponential step
with initialised at DPM-Solver++(2M) [3]. For flow models a third branch integrates in flow time on the velocity , where is the flow time of the scaled query level, with and Adams–Bashforth initialisation. In all three forms the fitted quantities are the same: , and .
def _init_C(levels, mode, device):
S = len(levels) - 1; H = 4 if mode == "ab" else 3
C = torch.zeros(S, H, device=device)
ab = {1: [1.0], 2: [1.5, -0.5], 3: [23/12, -16/12, 5/12], 4: [55/24, -59/24, 37/24, -9/24]}
for i in range(S):
if mode in ("ab", "flow"):
for j, c in enumerate(ab[min(i + 1, H)]): C[i, j] = c
elif i == 0: C[i, 0] = 1.0
else:
tc, tn, tp = float(levels[i]), float(levels[i + 1]), float(levels[i - 1])
r = 0.5 * math.log(tc / tn) / math.log(tp / tc); C[i, 0] = 1 + r; C[i, 1] = -r
return CPhase 1: fitting the integrator to a teacher
Phase 1 fits , and jointly with Adam, a 10% linear warm-up followed by cosine decay, and gradient clipping at 1.0. The teacher is a fourth-order Adams–Bashforth solve with levels, from the same noise. In flow mode it is a flow-time Adams–Bashforth solve, and for the guided latent models it is second order. For pixel models the loss is the squared distance between the Inception features of the student's and the teacher's images, so the solver is fitted in the feature space that FID measures. For latent models it is , where bars denote means over entries and is the pooled DINOv2 feature of the decoded image. If DINOv2 cannot be loaded, the code falls back to the latent MSE alone. Every teacher target (the Inception features for pixel models, the endpoint and its DINOv2 features for latent models) is cached together with the index of its noise draw, so the later phases can reuse it without paying for the teacher again.
def compute_target(z, den):
with torch.no_grad():
zt = _teacher_flow(z, den, grid, tea_steps) if flow else _teacher(z, den, grid, cfg["latent_like"], cfg["tea_order"], tea_steps, fp32 if not latent else False)
if latent:
feat = _dino_feats(decode, zt) if use_dino else None
return zt, feat
return None, inception(((decode(zt) + 1) * 127.5).clamp(0, 255))
def student_loss(z, den, target, temb_of=None, uncond_of=None):
zt, feat = target
zs = _run(z, lv, C, logq, beta, den, afs, mode, temb_of, uncond_of, fp32=fp32 if not latent else False)
if latent:
if use_dino:
return 0.1 * torch.nn.functional.mse_loss(zs.float(), zt.float()) + torch.nn.functional.mse_loss(_dino_feats(decode, zs), feat)
return torch.nn.functional.mse_loss(zs.float(), zt.float())
student = decode(zs)
return torch.nn.functional.mse_loss(inception(((student + 1) * 127.5).clamp(0, 255)), feat)Phase 2: per-step offsets to the network's conditioning
With the integrator frozen, Phase 2 fits a vector that is added to the time embedding of every conditioned block of the network at evaluation . Each evaluation is therefore told not only a fitted noise level but a fitted conditioning, in the spirit of MTEO [11]. For guided text models the code also fits one offset to the unconditional embedding, shared across steps and scaled by a per-step gate. If the full width table of offsets would exceed the parameter cap, the offsets are made low rank, : the basis starts from a fixed random draw and is fitted together with the gates , with its rank set by what the cap leaves. This phase reuses the cached teacher targets. The number of passes over the cache adapts between one and three according to the measured speed of an update, and it is held at one for any model that takes a conditioning input; we explain why in Section 4.
# Phase 2: time-embedding offsets (+ shared uncond offset for text models), on cached teachers.
_st1, _z1, _den1 = fresh(1)
widths = _den1.temb_names()
ushape = _den1.uncond_shape() if text else None
used = int(lv.numel() + C.numel() + logq.numel() + beta.numel() + 2)
groups, temb_of, uncond_of = [], None, None
U = ugate = None
if ushape is not None:
U = torch.nn.Parameter(torch.zeros(*ushape, device=dev))
ugate = torch.nn.Parameter(torch.ones(E, device=dev))
def uncond_of(k, U=U, ugate=ugate): return ugate[k] * U
groups.append({"params": [U, ugate], "lr": 1e-3})
used += int(U.numel() + ugate.numel())
phi = basis = gate = None
if widths:
slices = {}; off = 0
for nm in widths: slices[nm] = (off, off + int(widths[nm])); off += int(widths[nm])
remaining = cfg["cap"] - used - 16
if E * off <= remaining:
phi = torch.nn.Parameter(torch.zeros(E, off, device=dev))
def temb_of(k, phi=phi, slices=slices): return {nm: phi[k, a:b] for nm, (a, b) in slices.items()}
groups.append({"params": [phi], "lr": 5e-3 if cfg["lr"] >= 5e-3 else 1e-3})
else:
R = max(1, remaining // off - 1)
g = torch.Generator(device="cpu").manual_seed(0)
basis = torch.nn.Parameter((torch.randn(R, off, generator=g) * 0.02).to(dev))
gate = torch.nn.Parameter(torch.zeros(E, R, device=dev))
def temb_of(k, basis=basis, gate=gate, slices=slices):
v = gate[k] @ basis
return {nm: v[a:b] for nm, (a, b) in slices.items()}
groups.append({"params": [basis, gate], "lr": 5e-3 if cfg["lr"] >= 5e-3 else 1e-3}) if groups and cache:
_spu = (time.time() - t_start) / max(1, u_done)
_one = -(-len(cache) // cfg["accum"])
_max_ep = 1 if info.get("conditioning") not in (None, "none") else 3
_epochs = int(max(1, min(_max_ep, (t_start + budget - time.time()) / max(_one * _spu * 0.85, 1e-9))))
updates2 = _epochs * _one
opt, sched, allp = make_opt(groups, updates2)
dl2 = t_start + budgetPhase 3: a joint polish, then sampling
Phase 3 unfreezes everything for one pass over the cache. The learning rates are the Phase 1 rate for and , for , and the Phase 2 rate for the offsets. All three phases watch the clock, and each returns its current parameters when its deadline passes rather than failing. A final guard drops the offset tables if the returned dictionary would exceed the parameter cap. At sampling time the solver rebuilds the closures that inject the offsets and runs the integrator once, with exactly one network call per non-analytic step.
if cache and groups:
for p_ in (C, logq, beta): p_.requires_grad_(True)
g3 = [{"params": [C], "lr": cfg["lr"] * 0.1}, {"params": [logq], "lr": cfg["lr"] * 0.03},
{"params": [beta], "lr": cfg["lr"] * 0.1}] + [{"params": g["params"], "lr": g["lr"] * 0.2} for g in groups]
opt, sched, allp = make_opt(g3, _one)
idx = 0
for u in range(_one):
if time.time() > dl2 and u > 0: break
opt.zero_grad(set_to_none=True)
for _ in range(cfg["accum"]):
st, n, zt_c, feat_c = cache[idx % len(cache)]; idx += 1
z, den = make_batch(n, index=list(range(st, st + n)))
tgt = (None if zt_c is None else zt_c.to(dev).float(), None if feat_c is None else feat_c.to(dev))
(student_loss(z, den, tgt, temb_of, uncond_of) / cfg["accum"]).backward()
torch.nn.utils.clip_grad_norm_(allp, 1.0); opt.step(); sched.step()
out["C"], out["logq"], out["beta"] = C.detach(), logq.detach(), beta.detach()The noise levels themselves are not fitted. Pixel-space models and latent models that are neither text-conditioned nor flow models use the polynomial schedule with , and text-conditioned latent models and flow models use the model's own discrete timesteps. The exception is a hard-coded table of levels taken from the GITS schedule, which the code uses for text-conditioned latent models (not flow models) whose largest noise level matches the table's.
Results
| Method | ① | ② | ③ | ④ |
|---|---|---|---|---|
| FID ↓ | FID ↓ | FID ↓ | FID ↓ | |
| Muse Wonder Full | 5.133 | 4.852 | 15.17 | 13.32 |
| 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 our solver is ahead of every published baseline. It reaches an FID of 5.133 on FFHQ64/3NFE, against 5.650 for the strongest baseline, MTEO [11]. On IN64/3NFE it reaches 4.852, against 5.040 (MTEO [11]). The comparison that matters on these two settings is with the learned solvers, because the training-free ones are far behind: iPNDM, the rule our integrator starts from, has 45.97 on FFHQ64/3NFE. The margin over MTEO is modest. Our solver keeps MTEO's lever, fitted conditioning, and adds the fitted springboard integrator underneath it. The gap to DyWeight (17.90 on FFHQ64/3NFE), whose fitted weights and time scales resemble our Phase 1, is much larger.
On SD1.5/8NFE our solver has the best FID in the table, 13.32 against 14.36 for LD3 [7]. On SD1.5/5NFE it is third, with 15.17 against 14.29 for MTEO and 14.77 for SpanLift. It is still ahead of DyWeight (15.51) and of every training-free baseline there. The spread among all methods on SD1.5/5NFE and SD1.5/8NFE is much narrower than on FFHQ64/3NFE and IN64/3NFE, so the solver's choices move the metric less there.
How we got here
We began by measuring, not designing. Training-free probes on a small pixel-space development model fixed three choices early. On the same schedule the derivative-form multistep rule (iPNDM) clearly beat the data-prediction rules: in the agent's development measurements its FID was about 15 against about 25 for DPM-Solver++(2M) and a third-order variant. The analytic first step was a large gain: it took iPNDM from 15.4 to 9.79 and DPM-Solver++(2M) from 24.1 to 15.5. Variable-step Adams–Bashforth weights, the textbook fix for a non-uniform grid, were much worse than the fixed weights (43 against 15). So we initialised the learned weights at the fixed rule, and the pixel path uses the derivative form.
The integrator then lost most of its planned capacity.
- Spectral coefficients hurt. Our first fitted solver mixed past evaluations with a separate weight per frequency band. In short fits it was worse than plain scalar weights (8.24 against 6.39), and its first fit diverged outright, which we traced to the coupling between the weights and the effective-time drift. We kept scalar weights and lower learning rates.
- Learning the schedule hurt. Fitting the noise levels alongside the weights made the short fit worse (10.77). A late retry, fitting the levels only in the final polish, brought no gain (4.693, against a range of 4.62–4.71 with fixed levels). The fitted weights and offsets appear to absorb that freedom, so the levels stay fixed.
- The springboard helped. In matched short fits, adding learned springboard points improved FID from 6.03 to 5.37. The fitted values came out small, and on the late steps negative, which moves those queries slightly toward higher noise. Teacher quality made no difference: teachers of 35, 70 and 100 steps, two Heun teachers and a third-order data-prediction teacher all reached about 4.0–4.1 FID themselves, so we kept the cheapest.
At this point a full Phase 1 fit only tied a DyWeight fit we ran ourselves (5.25 against 5.14), and we needed a second source of capacity. We tried two. A SpanLift-style convolutional residual that leaves the span of past evaluations [10] gave little on its own (5.12) and nothing on top of the conditioning offsets (4.834 against 4.843), so we dropped it. Per-step time-embedding offsets fitted on the frozen integrator reached 4.91, ahead of our DyWeight reference, and 4.84 with a full fit. Fitting those offsets jointly with the integrator from the start was neutral (5.42 against 5.37). That is why the offsets are a separate phase. Two attempts to make the offsets depend on the sample, through a head driven by bottleneck features, failed: the unbounded head diverged, and a bounded one (5.36 against 5.04) and a per-sample embedding modulation (4.946 against 4.912) gave no gain.
The remaining decisions were about cost and robustness. Fitting on a guided latent model took about 22 s per update at first, which made a full two-phase fit too slow. Caching the teacher targets halved the fitting time at almost no cost in quality (4.89 against 4.84), and wall-clock deadlines were added so that a slow model returns partial parameters instead of timing out. Extra passes over the cache in Phase 2 helped on the unconditional development model (4.892, 4.757 and 4.704 for one, two and three passes), and the joint polish added a little more (4.619). On a conditioned model, however, the extra passes reliably hurt: 6.03 for one pass against 6.95 for the adaptive count, reproduced on a repeat. That is why the pass count is capped at one for conditioned models; a later run with two passes (7.22) confirmed it. For the flow branch, diagnostics showed that a student written in the noise-level convention of the other models was badly off at initialisation, so we added the native flow-time integrator, which roughly halved its initial distance to the teacher. On the guided latent model, polynomial levels did not help while the GITS table did, by the agent's own teacher-referenced measure, and so the table was adopted in the last version. Turning TF32 off, raising the Phase 1 learning rate and doubling the number of cached teacher images (together with a shorter teacher) all gave no gain.
Limitations
- SD1.5/5NFE is not won. Our solver trails MTEO and SpanLift on SD1.5/5NFE. Since MTEO fits the same kind of conditioning offsets, our extra integrator machinery does not pay for itself on every model.
- The gains over the strongest baseline are modest where they exist. Our development measurements showed a run-to-run spread of the fitting procedure of several tenths of an FID point on one model. The margins over MTEO on FFHQ64/3NFE and IN64/3NFE are of a similar order, so we would not read them as decisive without repeated fits.
- The method is a composition of known levers. Fitted multistep weights and time scales, a springboard query, an analytic first step and fitted conditioning offsets all have precedents among this task's baselines [9, 6, 11]. What we add is the learned springboard distance, the order of fitting (integrator first, conditioning second, joint polish last) and evidence for which levers do not help. The scalar weights, fixed schedule and absence of a beyond-span operator are choices made on development measurements, not derived.
- There are model-specific branches. The integrator form depends on the model's kind, the pass count on whether it takes a conditioning input, and one schedule is a hard-coded table selected by the model's noise range. These branches use fields of the solver's interface, not names, but they are tuning choices and could transfer poorly to a model of another kind.
- The design was tuned mostly on pixel-space models. Most of our development measurements are FIDs on pixel-space models. For the guided latent models we used only teacher-referenced proxies during development, and those moved little with fitting.
References
- Luping Liu, Yi Ren, Zhijie Lin et al. (2022). Pseudo Numerical Methods for Diffusion Models on Manifolds. ICLR.
- Qinsheng Zhang, Yongxin Chen (2023). Fast Sampling of Diffusion Models with Exponential Integrator. 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.
- Zhenyu Zhou, Defang Chen, Can Wang et al. (2024). Fast ODE-based Sampling for Diffusion Models in Around 5 Steps. CVPR.
- Tong Zhao, Mingkun Lei, Liangyu Yuan et al. (2026). DyWeight: Dynamic Gradient Weighting for Few-Step Diffusion Sampling.
- 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.