AdaDiff: Adaptive Step Selection for Fast Diffusion Models

Hui Zhang, Zuxuan Wu, Zhen Xing, Jie Shao, Yu-Gang Jiang

TL;DR

AdaDiff is a lightweight framework that speeds up diffusion models by adaptively choosing the number of denoising steps based on the complexity of the input prompt. By using reinforcement learning to balance image quality against computational cost, AdaDiff achieves a 33% to 40% reduction in inference time with virtually no loss in visual fidelity.

What Problem Does This Paper Address?

State-of-the-art diffusion models like SDXL and Sora produce stunning images and videos, but they are notoriously slow. The bottleneck is the iterative denoising process, which typically requires 50 or more steps to generate high-quality results.

Existing acceleration techniques generally fall into two categories: reducing the number of steps (via faster samplers or distillation) or reducing the work done per step (via pruning). However, these methods are "one-size-fits-all"—they apply the same amount of computation to every prompt. The authors argue that this is inefficient. A simple prompt like "a closeup of a pizza" requires far less computational effort to look "correct" than a complex scene like "a busy city street with skyscrapers, cars, and pedestrians." AdaDiff addresses this waste by dynamically allocating more steps to informative, complex prompts and fewer steps to simple ones.

Methods

AdaDiff introduces a lightweight step selection network that sits in front of the diffusion model.

  1. Policy Learning: The selection network (consisting of three self-attention layers and an MLP) takes text features from a frozen encoder and outputs a "step policy"—a probability distribution over a discrete set of possible denoising steps (e.g., $\{5, 10, \dots, 50\}$).
  2. Reinforcement Learning (RL): Because choosing a discrete number of steps is a non-differentiable operation, the authors train the network using a policy gradient method.
  3. The Reward Function: To guide the RL agent, the authors designed a reward function that balances two competing goals:
  4. Quality Reward: Uses a specialized Image Quality Score (IQS) model to assess how well the image aligns with the text and how perceptually faithful it is.
  5. Step Reward: A penalty that encourages the model to save as many steps as possible relative to the maximum allowed.
Figure 2: An overview of AdaDiff. Given the input prompts, the step selection network learns the information richness of each prompt and derives the corresponding step usage policy. These policies determine the number of steps required for the diffusion model to generate images. Subsequently, the reward function balances the trade-off between speed and image quality.

Datasets

The authors evaluated AdaDiff across several diverse benchmarks for both image and video generation:

  • Image Generation: MS COCO 2017, Laion-COCO, and DiffusionDB.
  • Video Generation: MSR-VTT and InternVid.
  • Transferability: They also tested "zero-shot" performance by training the policy on one dataset (e.g., COCO) and testing it on another (e.g., Laion-COCO) to ensure the learned logic generalizes.

Key Insights and Ideas

  • Complexity Correlation: The model successfully learns that "richer" prompts need more work. As the number of words or unique objects in a prompt increases, AdaDiff automatically scales up the denoising steps.
  • Orthogonality: AdaDiff isn't a replacement for methods like SDXL-Turbo or DeepCache; it's a complement. Because it changes how many steps are used rather than how they are calculated, it can be stacked on top of other acceleration methods for even greater gains.
  • Relative Quality Ranking: Instead of using an absolute quality threshold (which is hard to define across different prompts), the reward function uses a "top-$k$" ranking. An image is considered "high quality" if its IQS score is among the best produced for that specific prompt across different step counts.
  • Better than Heuristics: The authors compared AdaDiff to simple rules (like "use more steps if there are more words"). AdaDiff consistently outperformed these manual heuristics, proving that the relationship between prompt text and required denoising effort is subtle and best learned by a neural network.
Figure 3: Analyze the learned step policy based on the num- ber of words and objects in the prompts. AdaDiff tends to assign more steps to more informative prompts.

Key Results

  • Speedup: On the COCO benchmark, AdaDiff reduced average sampling steps from 50 to roughly 28, resulting in a 39.7% speed increase while maintaining similar FID (Fréchet Inception Distance) and CLIP scores.
  • Video Efficiency: For video generation using ModelScopeT2V, it achieved a 35.8% speedup.
  • Stacking Benefits: When applied to already-fast models like SDXL-Turbo (which defaults to 5 steps), AdaDiff was able to reduce the average steps to just 2.19, providing an additional 52.7% speedup with comparable quality.
  • Qualitative Success: As seen in Figure 4, simple scenes (like a single bird) are handled in 10-20 steps, while complex scenes (like a kitchen with multiple appliances) receive the full 40-50 steps.
Qualitative results showing how AdaDiff assigns different step counts to 'Easy', 'Medium', and 'Hard' prompts across different categories.

Limitations and Future Work

  • Training Overhead: While the inference overhead of the selection network is negligible (1.93 GFLOPs vs. 35,140 GFLOPs for the diffusion model), training the policy requires significant GPU hours (16 to 80 A100 hours) because it involves generating multiple images per prompt to calculate rewards.
  • Reward Model Dependency: The system's success relies heavily on the accuracy of the IQS model. If the quality evaluator has biases or blind spots, the step selection policy will inherit them.
  • Future Directions: The authors suggest exploring more granular adaptive strategies, perhaps skipping specific layers within a step rather than just skipping entire steps.

Summary updated

BibTeX
@misc{zhang2023adadiff,
  author = {Hui Zhang and Zuxuan Wu and Zhen Xing and Jie Shao and Yu-Gang Jiang},
  title = {{AdaDiff: Adaptive Step Selection for Fast Diffusion Models}},
  year = {2023},
  eprint = {2311.14768},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.14768},
}
Figure