Accelerating Diffusion Sampling with Optimized Time Steps

Shuchen Xue, Zhaoqiang Liu, Fei Chen, Shifeng Zhang, Tianyang Hu, Enze Xie, Zhenguo Li · DOI

Abstract: Diffusion probabilistic models (DPMs) have shown remarkable performance in high-resolution image synthesis, but their sampling efficiency is still to be desired due to the typically large number of sampling steps. Recent advancements in high-order numerical ODE solvers for DPMs have enabled the generation of high-quality images with much fewer sampling steps. While this is a significant development, most sampling methods still employ uniform time steps, which is not optimal when using a small number of steps. To address this issue, we propose a general framework for designing an optimization problem that seeks more appropriate time steps for a specific numerical ODE solver for DPMs. This optimization problem aims to minimize the distance between the ground-truth solution to the ODE and an approximate solution corresponding to the numerical solver. It can be efficiently solved using the constrained trust region method, taking less than 15 seconds. Our extensive experiments on both unconditional and conditional sampling using pixel- and latent-space DPMs demonstrate that, when combined with the state-of-the-art sampling method UniPC, our optimized time steps significantly improve image generation performance in terms of FID scores for datasets such as CIFAR-10 and ImageNet, compared to using uniform time steps.

Introduction

Diffusion Probabilistic Models (DPMs) are the powerhouses behind modern AI image generation, but they are notoriously computationally expensive. Generating an image requires a "reverse diffusion" process—essentially solving a complex Ordinary Differential Equation (ODE) to turn noise into structure. While high-order numerical solvers like UniPC and DPM-Solver++ have reduced the number of steps needed, most implementations still rely on uniform time steps (splitting the time interval into equal chunks).

This paper argues that uniform steps are a convenience rather than an optimal strategy. When generating an image in only 5 or 10 steps, the placement of those steps matters immensely. We introduce a training-free framework to accelerate diffusion model sampling by optimizing the discretization of time steps. By solving a fast optimization problem to minimize the error between numerical approximations and ground-truth solutions, we achieve state-of-the-art image quality (FID) with minimal sampling steps.

Methodology

The proposed framework constructs an optimization problem to find the ideal sampling schedule for a specific pre-trained model and solver:

  1. Error Bound Formulation: A theoretical upper bound is derived for the distance between the ground-truth solution ($x_0$) and the approximate solution produced by a specific numerical solver.
  2. Optimization Objective: The time steps are treated as variables. The goal is to minimize the sum of approximation errors across all steps, weighted by the model's score approximation error.
  3. Fast Solving: Using the constrained trust region method, the optimal schedule is found in under 15 seconds on a standard CPU.
  4. Plug-and-Play: The method is training-free; the optimization is run once for a desired number of steps, and the resulting schedule is used for all subsequent generations.

Experimental Results

The researchers evaluated the method across standard benchmarks including CIFAR-10, ImageNet (64x64 to 512x512), FFHQ, and AFHQv2 using both pixel-space and latent-space DPMs.

FID performance curves across various datasets. The optimized steps (red) consistently achieve lower FID scores than uniform and EDM baselines, especially at low NFE.

As shown in Figure 1, the optimized time steps consistently outperform standard schedules (uniform-$t$, uniform-$\lambda$, and EDM) across all datasets. For example, on CIFAR-10 at 5 steps, UniPC with optimized steps improved FID from 23.22 to 12.11. On ImageNet 512x512 at 5 steps, it achieved an FID of 11.40, whereas the best baseline was 20.28.

Qualitative comparison at NFE = 5. The optimized schedule (Ours) produces high-fidelity images while baselines result in significant artifacts or blurriness.

Qualitative results in Figure 2 highlight the impact of step placement. At extremely low Number of Function Evaluations (NFEs), the difference between a uniform schedule and an optimized one is the difference between a blurry approximation and a high-fidelity image.

Key Insights and Discussion

  • The Schedule as a Bottleneck: While much research focuses on the solver or the model architecture, the discretization scheme (where the steps are placed) is a significant factor for efficiency gains.
  • Non-Uniformity: The optimal path from noise to image is non-linear. Optimized steps naturally cluster where the solver's approximation error would otherwise be highest, reflecting the changing "speed" of information recovery.
  • Solver-Specific Optimization: Different solvers have unique error profiles. This framework allows the schedule to be tailored specifically to the solver being used, rather than using a one-size-fits-all approach.

While the method currently relies on a surrogate objective (an error upper bound), it demonstrates that mathematically optimized schedules can unlock massive efficiency for deterministic ODE-based sampling. Future work may extend this rigorous optimization to stochastic SDE-based sampling.

Summary updated

BibTeX
@inproceedings{xue2024accelerating,
  author = {Shuchen Xue and Zhaoqiang Liu and Fei Chen and Shifeng Zhang and Tianyang Hu and Enze Xie and Zhenguo Li},
  title = {{Accelerating Diffusion Sampling with Optimized Time Steps}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  doi = {10.1109/cvpr52733.2024.00792},
}
Figure