Gotta Go Fast When Generating Data with Score-Based Models

Alexia Jolicoeur-Martineau, Ke Li, Rémi Piché-Taillefer, Tal Kachman, Ioannis Mitliagkas

TL;DR

Score-based diffusion models generate high-fidelity data by numerically integrating reverse-time Stochastic Differential Equations (SDEs), but standard fixed-step solvers like Euler–Maruyama (EM) require thousands of expensive neural network evaluations. This paper introduces an adaptive-step SDE solver tailored specifically to diffusion models that uses stochastic extrapolation, scaled $\ell_2$ error norms, and quantization-aware tolerances. The approach accelerates image synthesis by $2\times$ to $10\times$ over EM while matching or improving sample quality—especially on high-resolution images where EM struggles.

What Problem Does This Paper Address?

While score-based generative models produce exceptional image quality and diversity, their generation phase is notoriously slow. Sampling typically involves numerically reversing a continuous-time forward diffusion process (such as Variance Exploding [VE] or Variance Preserving [VP] SDEs) across hundreds or thousands of discretized steps.

Off-the-shelf adaptive SDE solvers from the scientific computing literature (e.g., Runge–Kutta variants) fail in this setting: they either diverge, run dramatically slower than simple fixed-step EM, or degrade output quality. The authors pinpoint three domain-specific reasons:

  1. High dimensionality: Traditional solvers use the $\ell_\infty$ norm for error estimation, causing a single aberrant pixel in an image to reject the entire step.
  2. Computational cost: Evaluating the drift requires a full forward pass through a massive score network, making higher-order multistep or multi-stage methods prohibitively expensive.
  3. Precision mismatch: Classical solvers seek high numerical precision, whereas generative image modeling only requires errors smaller than 8-bit RGB color quantization levels.

Methods

The authors build a custom, low-overhead adaptive SDE integrator designed around the structure of reverse-time score-based diffusion:

  • Two-Evaluation Adaptive Scheme: The algorithm pairs Euler–Maruyama (strong order 0.5) with Roberts’ stochastic Improved Euler scheme (strong order 1.0). Critically, the two stages share intermediate score evaluations, requiring only two score network passes per step.
  • Extrapolation: Rather than advancing state trajectories using the lower-order estimate $x'$ and using the higher-order estimate $x''$ merely for error tracking, the solver adopts $x''$ as the accepted update (extrapolation), yielding higher precision at zero extra computational cost.
  • Scaled $\ell_2$ Error Norm: The error metric replaces the brittle maximum error ($\ell_\infty$) with a root-mean-square / scaled $\ell_2$ norm over all dimensions to prevent isolated pixel errors from stalling time steps.
  • Domain-Informed Error Tolerances: Absolute error tolerance ($\epsilon_{abs}$) is directly pegged to imperceptible RGB rounding: $\frac{y_{\max} - y_{\min}}{256}$ (e.g., $0.0039$ for $[0, 1]$ scaled inputs). Mixed error tolerances adapt dynamically to both current and previous samples.
  • Per-Sample Batch Stepping: Because each image trajectory in a mini-batch is independent, step sizes adapt individually per image rather than throttling the entire batch to the worst-case sample.
  • Tweedie-Grounded Terminal Denoising: The authors point out and fix an inconsistency in standard implementations of the final denoising step, correctly scaling score offsets via Tweedie’s formula.

Datasets

The authors evaluate pre-trained continuous-time diffusion models (VP, VP-deep, VE, VE-deep) from Song et al. (2020a) across:

  • CIFAR-10 ($32 \times 32$)
  • LSUN-Church ($256 \times 256$)
  • FFHQ (Flickr-Faces-HQ) ($256 \times 256$)

No new datasets or benchmarks are introduced; evaluation relies on pre-existing pretrained checkpoints.

Key Insights and Ideas

  • Extrapolation is critical for SDE speedups: Lamba's classic adaptive scheme uses an ODE solver for error correction and fails to improve sample fidelity. Using Roberts’ stochastic Improved Euler allows true stochastic extrapolation, turning an unstable baseline into a high-order sampler.
  • More steps do not always mean better samples: On score models, running $10\text{k}$ EM steps actually yields worse FID than $1\text{k}$ steps. Because neural score estimators have slight approximation errors, taking excessive steps can accumulate drift deviations away from the true data manifold.
  • VE vs. VP dynamics: VP diffusions are significantly easier to solve rapidly. VE diffusions exhibit massive initial Gaussian noise variance ($\sigma_{\max}^2$), which inflates local error estimates early in reverse time, requiring smaller initial step sizes.

Key Results

  • CIFAR-10 ($32 \times 32$):
  • On VP models, the proposed solver reaches an FID of 2.59 with only 179 Number of Function Evaluations (NFE), whereas standard EM needs 1000 NFE to achieve 2.55 (and yields an unviable FID of 25.49 when restricted to 179 NFE).
  • Outperforms DDIM (FID 9.20 at 179 NFE) and Probability Flow ODE solvers (FID 3.11 at 142 NFE).
  • High-Resolution ($256 \times 256$):
  • LSUN-Church: Achieves FID 26.46 with 1030 NFE, outperforming 2000-step EM (FID 42.11). At the same 1030 NFE budget, EM collapses to an FID of 73.47.
  • FFHQ: Achieves FID 15.67 at 643 NFE, beating 2000-step EM (FID 18.57). Fixed-step EM at 643 NFE degrades severely to 44.42.
  • Probability Flow ODE solvers diverge or yield extremely poor visual quality at $256 \times 256$ (FID $> 135$), whereas the proposed SDE solver retains stable sampling.

Limitations and Future Work

  • Continuous-Time Restriction: The method relies on continuous-time SDE formulations and cannot be applied directly to legacy discrete-time diffusion setups (like standard DDPM) without continuous parameterization.
  • Hyperparameter Selection: While the solver eliminates manual step-size schedules, users still select a relative tolerance parameter ($\epsilon_{rel}$), which indirectly dictates the compute budget/quality tradeoff.
  • VE Process Overhead: Due to large variance scales in VE SDEs, speed gains on VE models remain lower ($2\times$–$3\times$) than those achieved on VP models ($5\times$–$10\times$).

Summary updated

BibTeX
@inproceedings{jolicoeurmartineau2022gotta,
  author = {Alexia Jolicoeur-Martineau and Ke Li and Rémi Piché-Taillefer and Tal Kachman and Ioannis Mitliagkas},
  title = {{Gotta Go Fast When Generating Data with Score-Based Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=YmONQIWli--},
}
Figure