AdaDiff: Accelerating Diffusion Models Through Step-Wise Adaptive Computation

Shengkun Tang, Yaqing Wang, Caiwen Ding, Yi Liang, Yao Li, Dongkuan Xu

Abstract

Diffusion models (DMs) have established themselves as a premier approach for high-fidelity image generation. However, their iterative denoising process is computationally expensive, requiring multiple passes through deep neural networks. While most acceleration techniques focus on reducing the number of sampling steps, AdaDiff optimizes the "depth" of the model at each individual step. By employing a Timestep-Aware Uncertainty Estimation Module (UEM) and an Uncertainty-Aware Layer-wise Loss (UAL), AdaDiff dynamically adjusts the number of active layers based on the complexity of the denoising task at hand. Our evaluation shows that AdaDiff achieves a layer reduction of approximately 45% with negligible loss in image quality across standard benchmarks.

Introduction

The primary bottleneck in the deployment of diffusion models is their inference speed. Generating a single image typically involves dozens or hundreds of sequential steps. Standard DMs apply the full depth of the backbone network at every step, regardless of whether the specific denoising task requires such high capacity. AdaDiff is motivated by the observation that early denoising steps, which focus on global structure, often reach a stable representation much earlier in the network's depth than later steps that handle fine-grained details.

Methodology

AdaDiff introduces a "plug-and-play" framework for adaptive computation in diffusion backbones, such as U-ViT or U-Net.

Timestep-Aware Uncertainty Estimation Module (UEM)

To enable early exiting, the model must determine when a layer's output is "sufficiently accurate" to proceed to the next denoising step. AdaDiff integrates a lightweight UEM into each intermediate block. This module estimates the predictive uncertainty of the layer's output. If the uncertainty is below a predefined threshold $\theta$, the model terminates the current step's forward pass and "exits" early, skipping the remaining layers.

Overview of the AdaDiff framework showing step-wise adaptive computation and the early-exit mechanism.

Uncertainty-Aware Layer-wise Loss (UAL)

Training a model for early exiting is challenging because errors can accumulate across iterative steps. Standard layer-wise losses treat all timesteps equally. AdaDiff employs UAL, which weights the loss based on the estimated uncertainty. This strategy forces the model to prioritize accuracy in the layers and timesteps most critical for maintaining the overall denoising trajectory.

Key Insights

The core premise of AdaDiff is supported by the phenomenon of representation stabilization. Analysis of intermediate layer outputs reveals that the Mean Squared Error (MSE) relative to the final layer's output drops rapidly in the initial layers and then plateaus.

MSE between intermediate layer outputs and the final layer output across different datasets, demonstrating representation stabilization.

This stabilization suggests that shallow layers often capture enough information to move to the next denoising step. Furthermore, the "difficulty" of noise prediction varies throughout the generation process; AdaDiff exploits this by dynamically allocating more layers to "hard" steps and fewer to "easy" ones.

Experimental Results

AdaDiff was evaluated on CIFAR-10, CelebA, ImageNet, and MS-COCO.

  • Efficiency and Quality: AdaDiff achieved a layer reduction ratio of approximately 45% across multiple datasets. On CIFAR-10, it maintained a competitive FID of 3.7 while using 47.7% fewer layers, significantly outperforming other early-exit baselines like BERTxiT.
  • Performance Boost: Interestingly, training with the UAL loss improved the base model's performance. On CIFAR-10, the full model's FID improved from 3.11 to 2.7.
  • Text-to-Image Generation: On MS-COCO, AdaDiff reduced GFLOPs by over 43% while maintaining high-quality alignment with text prompts.
  • Synergy: AdaDiff is complementary to step-reduction methods like DPM-Solver, allowing for compounded speed gains.

Conclusion

AdaDiff provides a robust framework for accelerating diffusion models by optimizing model depth. By leveraging timestep-aware uncertainty, it achieves significant computational savings without sacrificing image quality. Future work may explore combining adaptive depth with adaptive sampling steps to further push the boundaries of efficient generative modeling.

Summary updated

BibTeX
@inproceedings{tang2024adadiff,
  author = {Shengkun Tang and Yaqing Wang and Caiwen Ding and Yi Liang and Yao Li and Dongkuan Xu},
  title = {{AdaDiff: Accelerating Diffusion Models Through Step-Wise Adaptive Computation}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72986-7\_5},
}
Figure