Relational Diffusion Distillation for Efficient Image Generation

Weilun Feng, Chuanguang Yang, Zhulin An, Libo Huang, Boyu Diao, Fei Wang, Yongjun Xu

Introduction

Diffusion models have established themselves as the state-of-the-art in image synthesis, yet their practical utility is often hindered by a "patience problem." Producing high-quality images typically requires dozens or hundreds of iterative denoising steps, making them computationally expensive and slow for real-time applications or edge devices.

To address this, researchers have turned to Knowledge Distillation (KD), where a fast "student" model is trained to mimic a pre-trained, high-performance "teacher" model. However, conventional distillation methods often focus on pixel-level alignment or global feature averages. These approaches frequently fail to capture the intricate spatial relationships—such as how the texture of a cat's ear relates to its paw—that are essential for structural coherence. Relational Diffusion Distillation (RDD) introduces a novel framework that prioritizes these spatial and cross-sample relationships to enable high-quality generation in as little as a single step.

Methodology

RDD moves beyond simple value-matching by teaching the student model to replicate the internal "relational map" of the teacher. The framework introduces two primary components to capture these dependencies:

1. Intra-Sample Pixel-to-Pixel Relationship Distillation (IS_P2P)

Traditional distillation often treats images in isolation. IS_P2P, however, calculates a spatial relation matrix for an entire mini-batch. By measuring how pixels across different generated samples relate to one another, the student is forced to learn the long-term dependencies and structural patterns mastered by the teacher. This ensures that the student captures the underlying distribution of the data rather than just mimicking raw pixel values.

2. Memory-based Pixel-to-Pixel Relationship Distillation (M_P2P)

Because hardware constraints limit the number of images that can be processed in a single batch, the authors implemented an online pixel queue. This memory bank stores pixel embeddings from previous training iterations. The student model compares its current pixel features against this diverse history, providing a significantly richer "vocabulary" of relationships. This effectively simulates a massive batch size, allowing for more stable and diverse image generation without increasing GPU memory requirements exponentially.

Progressive Distillation

These relational losses are integrated into a Progressive Distillation framework. This process iteratively halves the required sampling steps (e.g., from 8 steps to 4, then 2, and finally 1), ensuring the student maintains quality even as the computational budget is drastically reduced.

Experimental Results

The researchers evaluated RDD on two standard benchmarks: CIFAR-10 (unconditional 32x32 generation) and ImageNet 64x64 (conditional generation).

Efficiency and Quality

RDD demonstrated state-of-the-art performance in efficiency. On the ImageNet 64x64 benchmark, RDD achieved a 1.47 FID decrease (indicating higher image quality) in 1-step generation compared to the previous leading method, RCFD. Most notably, RDD generates images in just 4 steps that surpass the quality of standard DDIM sampling at 1024 steps—a 256x speedup.

Robustness

Ablation studies confirmed that both IS_P2P and M_P2P contribute independently to the model's performance. Furthermore, the framework proved robust to hyperparameter variations, such as temperature or loss weights, suggesting that RDD is a stable, "plug-and-play" technique for model compression.

Key Insights

  • Structure over Raw Values: The core innovation of RDD is the realization that the structure of the feature space is more informative for distillation than raw feature values. By mimicking the teacher's relational map, the student captures the essence of the data distribution more efficiently.
  • Spatial Preservation: Unlike methods that use average pooling—which can blur internal representations—RDD maintains the spatial grid, ensuring fine details are preserved during the distillation process.

Limitations and Future Work

While RDD shows great promise, several areas for future research remain:

  • Resolution Scaling: Current experiments focused on 32x32 and 64x64 resolutions. Scaling RDD to high-resolution models like Stable Diffusion (512x512 or 1024x1024) is the next logical step for real-world application.
  • Classifier Dependency: The method currently relies on a pre-trained classifier (e.g., DenseNet) to extract features for distillation, meaning the quality of the student is partially dependent on the classifier's understanding of the images.
  • Computational Constraints: While M_P2P is efficient, the memory usage of the IS_P2P component grows with batch size, which may present challenges when working with very large feature maps on limited hardware.

Summary updated

BibTeX
@inproceedings{feng2024relational,
  author = {Weilun Feng and Chuanguang Yang and Zhulin An and Libo Huang and Boyu Diao and Fei Wang and Yongjun Xu},
  title = {{Relational Diffusion Distillation for Efficient Image Generation}},
  booktitle = {ACM Multimedia},
  year = {2024},
}
Figure