Lightweight Diffusion Models with Distillation-Based Block Neural Architecture Search

Siao Tang, Xin Wang, Hong Chen, Chaoyu Guan, Yansong Tang, Wenwu ZhuarXiv 2023 · DOI

Abstract

Diffusion models are computationally intensive due to their iterative sampling process and large architectural footprints. While many methods focus on reducing sampling steps, architectural optimization remains challenging due to training instability and the "unfairness" of global search strategies. We propose DiffNAS, a distillation-based block-wise Neural Architecture Search framework. DiffNAS decomposes the U-Net into independent blocks, utilizes a pretrained teacher for local supervision, and employs a dynamic joint loss during retraining. Our approach achieves approximately a 50% reduction in computational cost (MACs) and parameters, often outperforming the original teacher models in image quality metrics.

Introduction

Diffusion models have revolutionized generative AI but remain difficult to deploy on resource-constrained devices. Their complexity stems from two primary factors: the number of sampling steps and the size of the denoising network (typically a U-Net). While techniques like ODE solvers address sampling efficiency, architectural bulk persists. Standard compression methods like pruning or quantization often struggle with the sensitive training dynamics of diffusion. DiffNAS addresses this by applying Neural Architecture Search (NAS) at a block-wise level to eliminate structural redundancy without sacrificing stability.

Methods

DiffNAS operates in three distinct stages to ensure efficiency and fairness in architectural selection:

  1. Block-wise Supernet Training: The U-Net is divided into blocks based on resolution levels. A supernet containing multiple architectural paths is trained using distillation from a fixed teacher model. This allows blocks to be trained in parallel, significantly reducing search time.
  2. Block-wise Local Search: To avoid the "unfairness" of global search—where high-loss blocks dominate optimization—DiffNAS identifies the most efficient sub-architecture within each block independently. It selects the smallest model that meets a performance threshold relative to the teacher.
  3. Subnet Retraining with Dynamic Joint Loss: Once the optimal subnet is found, it is retrained using a dynamic loss schedule. Initially, the model prioritizes distillation to "warm up" the student by mimicking the teacher's features. As training progresses, a "beta schedule" shifts the focus toward the standard noise-prediction objective to refine generative performance.
The three-stage DiffNAS pipeline: Supernet Training, Block-wise Search, and Subnet Retraining.

Results

Evaluation across standard benchmarks including CIFAR-10, CelebA-HQ, and LSUN-church demonstrates significant efficiency improvements. On Latent Diffusion Models (LDM), DiffNAS achieved approximately a 50% reduction in MACs and a 46-58% reduction in parameters.

Quantitatively, the compressed models frequently achieved superior FID scores (lower is better) compared to their uncompressed teacher counterparts. As shown in Figure 3, the searched models maintain high fidelity across various samplers (DDIM, DPM) even as computational costs are significantly reduced. Qualitatively, images generated by the 50%-smaller models remain virtually indistinguishable from the full-sized originals.

The relationship between FID and MACs across different samplers.

Conclusion

DiffNAS provides a robust framework for slimming diffusion models by shifting from global to block-wise search and leveraging dynamic distillation. This approach overcomes common NAS pitfalls in the diffusion domain, producing models that are both lightweight and high-performing. Future work includes expanding the search space to include layer depth and integrating quantization for further optimization on edge devices.

Summary updated

BibTeX
@misc{tang2023lightweight,
  author = {Siao Tang and Xin Wang and Hong Chen and Chaoyu Guan and Yansong Tang and Wenwu Zhu},
  title = {{Lightweight Diffusion Models with Distillation-Based Block Neural Architecture Search}},
  year = {2023},
  eprint = {2311.04950},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.04950},
}
Figure