DisDiff: Unsupervised Disentanglement of Diffusion Probabilistic Models

Tao Yang, Yuwang Wang, Yan Lu, Nanning Zheng

Abstract

Diffusion Probabilistic Models (DPMs) have established themselves as the state-of-the-art for high-fidelity image synthesis. However, their internal representations remain largely opaque, functioning as "black boxes" where semantic attributes are entangled. DisDiff introduces a novel unsupervised framework designed to discover and isolate these underlying factors of variation—such as color, shape, and pose—by decomposing the model's gradient field into independent sub-gradient fields. This approach enables precise, label-free image manipulation without the quality trade-offs typically associated with disentangled representation learning.

Introduction

In the realm of representation learning, the concept of disentanglement is a primary objective: the goal is to ensure that each dimension of a model's latent space corresponds to exactly one independent factor of the data. While Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs) have historically been used for this task, they face significant limitations. VAEs often suffer from a fundamental trade-off where increased disentanglement leads to lower reconstruction quality and blurrier images. GANs, while capable of high-quality synthesis, are notoriously difficult to "invert," making it challenging to map a real image back into the latent space for precise editing.

DisDiff addresses these challenges by bringing unsupervised disentanglement to the DPM framework. By leveraging the superior generation quality and natural invertibility of diffusion models, DisDiff allows for the discovery of semantic factors in a completely label-free manner.

Methodology

The core innovation of DisDiff is the conceptualization of a diffusion model's total gradient field as a superposition of conditional sub-gradients. The framework aims to split this total field into distinct components, each responsible for a specific attribute of the generated image.

Architecture and Gradient Decomposition

The DisDiff framework consists of two primary components:

  1. Encoder ($E_\phi$): Maps an input image into a set of latent representations $\{z^1, z^2, \dots, z^N\}$, where each $z^i$ is intended to capture a unique factor of variation.
  2. Decoder ($G_\psi$): Learns to estimate the "sub-gradient field" for each factor. This represents a specific direction in the image space that modifies only the attribute associated with $z^i$.

Disentangling Loss Functions

To ensure that the discovered factors are truly independent, the authors employ a loss function based on minimizing mutual information, categorized into two types:

  • Invariant Loss: Ensures that a change in one factor does not inadvertently shift the others, maintaining the integrity of the remaining attributes.
  • Variant Loss: Ensures that the factor representation effectively captures the intended variation within the data.

Score-based Conditioning and Adaptive Weighting

Rather than retraining the entire diffusion model, DisDiff utilizes a "conditioning trick" similar to classifier guidance. This allows the discovered factors to be injected into the reverse diffusion process efficiently. Furthermore, the framework employs Adaptive Weighting, which dynamically scales the importance of the disentangling loss across different diffusion timesteps. This recognizes that semantic information (like global shape) is often more prominent at earlier denoising stages, while fine details emerge later.

Experimental Evaluation

The model was evaluated across a range of synthetic and real-world datasets to test its robustness and precision.

Datasets

  • Synthetic Benchmarks: Shapes3D, Cars3D, and MPI3D were used to measure disentanglement against known ground-truth factors like floor color, object scale, and azimuth.
  • Real-world Benchmarks: CelebA, CelebA-HQ, and FFHQ were used to evaluate the model's ability to discover complex, non-linear factors in human faces, such as "smile," "skin tone," or "hair length."

Quantitative Results

DisDiff demonstrated significant improvements over existing methods in both disentanglement metrics and image quality:

  • Disentanglement: On the MPI3D dataset, DisDiff achieved a DCI (Disentanglement, Completeness, Informativeness) score of 0.337, outperforming the previous state-of-the-art GAN-based method, DisCo (0.292).
  • Image Quality: On the CelebA dataset, DisDiff achieved a Fréchet Inception Distance (FID) of 18.249. This is a massive improvement over disentangled VAEs (FID ~99.8) and outperforms recent diffusion-based autoencoders like Diff-AE (FID ~22.7).

Discussion and Key Insights

DisDiff highlights several unique advantages of using DPMs for representation learning. The authors argue that the multi-step nature of the diffusion process provides a unique inductive bias. By enforcing constraints across 1,000 timesteps, the model has more opportunities to learn the underlying structure of the data compared to single-step models like VAEs.

Crucially, DisDiff avoids the traditional quality-disentanglement trade-off. Because it leverages a pre-trained DPM, the heavy lifting of high-quality image synthesis is already handled. The disentanglement process can therefore focus entirely on organizing the latent space and decomposing the gradient field, resulting in "pure" factor isolation—such as changing a wall's color without affecting the object in the foreground.

Limitations and Future Work

Despite its success, DisDiff faces several challenges:

  • Interpretability: In purely unsupervised modes, discovered factors may not always align perfectly with human categories (e.g., a factor might blend lighting and skin tone). Future work may involve using CLIP-guidance to bridge this gap.
  • Computational Overhead: The iterative nature of DPMs makes generation slower than single-pass GANs or VAEs.
  • Scene Complexity: While effective for centered objects and faces, disentangling highly complex or cluttered natural scenes remains a frontier for future research.
  • Ethical Considerations: The authors note that high-fidelity, unsupervised editing tools could be misused for creating malicious content, such as deepfakes, necessitating responsible deployment.

Conclusion

DisDiff represents a significant step forward in making diffusion models more interpretable and controllable. By successfully decomposing the gradient field of a pre-trained DPM, the framework enables high-quality, unsupervised disentanglement that surpasses previous VAE and GAN-based approaches, opening new doors for precise and label-free image editing.

Summary updated

BibTeX
@inproceedings{yang2023disdiff,
  author = {Tao Yang and Yuwang Wang and Yan Lu and Nanning Zheng},
  title = {{DisDiff: Unsupervised Disentanglement of Diffusion Probabilistic Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=3ofe0lpwQP},
}
Figure