SA-Solver: Stochastic Adams Solver for Fast Sampling of Diffusion Models

Shuchen Xue, Mingyang Yi, Weijian Luo, Shifeng Zhang, Jiacheng Sun, Zhenguo Li, Zhi-Ming Ma

TL;DR

SA-Solver is a novel, training-free stochastic sampler designed to significantly accelerate image generation from diffusion models without sacrificing image quality. By introducing a "variance-controlled" Stochastic Differential Equation (SDE) framework and pairing it with an efficient multi-step stochastic Adams solver, SA-Solver achieves state-of-the-art generation results in as few as 20 to 50 steps.

The Challenge: Speed vs. Quality in Diffusion Models

Diffusion Probabilistic Models (DPMs) have revolutionized generative AI, serving as the backbone for state-of-the-art tools like Stable Diffusion and Midjourney. However, their primary drawback is sampling speed. Generating a single high-quality image typically requires hundreds of network passes, known as the Number of Function Evaluations (NFEs).

To mitigate this, the community has heavily favored Ordinary Differential Equation (ODE) solvers (such as DDIM or DPM-Solver). ODEs are deterministic and can be solved efficiently in very few steps. However, Stochastic Differential Equation (SDE) solvers—which inject noise throughout the generation process—often yield higher-quality, more diverse images, provided they are given enough compute time.

This creates a clear dilemma: choose fast deterministic samplers or slow, high-quality stochastic samplers. This paper introduces SA-Solver to bridge this gap, offering a stochastic sampler that matches the speed of deterministic ODE solvers while retaining the quality benefits of SDEs.

Methodology: The SA-Solver Approach

The authors tackle the sampling bottleneck through a combination of novel SDE formulation and advanced numerical methods:

  1. Variance-Controlled Diffusion SDEs: The authors propose a new family of SDEs that share the same marginal probability distribution. They introduce a "noise scale" function, $\tau(t)$, which allows for a smooth transition between a pure ODE ($\tau=0$) and a standard SDE ($\tau=1$). By adjusting $\tau(t)$, the algorithm can precisely control the stochasticity of the sampling process.
  2. Stochastic Adams Solver (SA-Solver): While most samplers rely on "one-step" methods (like Euler) that only use the current state to predict the next, SA-Solver employs a linear multi-step method. It leverages previous network evaluations to make a more accurate, higher-order prediction of the next step without requiring additional, expensive neural network calls.
  3. Predictor-Corrector Framework: SA-Solver utilizes a "Predictor" step to obtain an initial estimate and a "Corrector" step to refine it. This classic numerical analysis technique ensures stability and accuracy, even when taking large step sizes.
SA-Solver Algorithm showing the Predictor-Corrector steps.
  1. Data-Prediction Reparameterization: Many diffusion models are trained to predict the noise ($\epsilon$) added to an image. However, the authors discovered that their multi-step solver performs significantly better when the network is reparameterized to predict the original data ($x_0$) directly, especially at low NFEs.
Comparison of Noise-prediction vs. Data-prediction across different NFEs.

Key Insights

  • Stochasticity as a Buffer: The authors realized that stochasticity does more than just add diversity; it acts as an error-correction mechanism. If the neural network's score estimation is slightly inaccurate (common in early training or with few sampling steps), the injected noise in an SDE helps correct the trajectory. In contrast, an ODE would simply accumulate this error.
  • Efficiency through Hindsight: By utilizing the multi-step Adams method, SA-Solver achieves higher-order accuracy "for free" by reusing the memory of previous steps, avoiding extra network evaluations.
  • The $\tau$ Lever: Empirical results show that for very few steps (e.g., 10-15), a small amount of noise is optimal. As the NFE budget increases, the noise scale can be increased to unlock the superior quality typically associated with SDEs.

Experimental Results

The authors evaluated SA-Solver across standard benchmarks including CIFAR-10, ImageNet (up to 512x512), and LSUN Bedroom, testing on architectures like ADM, EDM, Latent Diffusion, and Diffusion Transformers (DiT).

  • State-of-the-Art Performance: SA-Solver achieved the lowest (best) FID scores—a standard metric for image quality and diversity—on almost all benchmark datasets.
  • Massive Speedup: On ImageNet 256x256, SA-Solver reached an impressive FID of 3.88 in just 20 steps (as highlighted in the data-prediction comparison). For context, many popular ODE solvers struggle to break an FID of 4.0 even with a higher step count.
  • Robustness: SA-Solver significantly outperformed deterministic samplers when the underlying model was not fully converged, proving that stochasticity effectively mitigates model errors.
  • Qualitative Improvements: In text-to-image tasks using Stable Diffusion, SA-Solver generated images with noticeably finer details and more realistic textures compared to other fast samplers like UniPC.

Limitations and Future Work

While SA-Solver is highly effective, it does come with a few limitations. The optimal choice for the noise schedule $\tau(t)$ and the exact number of predictor/corrector steps currently relies on empirical heuristics rather than a strict theoretical derivation. Additionally, as a multi-step, predictor-corrector method, it is slightly more complex to implement than simpler one-step samplers like DDIM. Future work will likely focus on developing a rigorous theoretical framework for determining the optimal noise schedule for any given NFE budget.

Summary updated

BibTeX
@inproceedings{xue2023sa,
  author = {Shuchen Xue and Mingyang Yi and Weijian Luo and Shifeng Zhang and Jiacheng Sun and Zhenguo Li and Zhi-Ming Ma},
  title = {{SA-Solver: Stochastic Adams Solver for Fast Sampling of Diffusion Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=f6a9XVFYIo},
}
Figure