DDAE++: Enhancing Diffusion Models Towards Unified Generative and Discriminative Learning

Weilai Xiang, Hongyu Yang, Di Huang, Yunhong Wang · DOI

Abstract

Diffusion models are generative powerhouses, but their internal architectures are often not optimized for learning the compact, high-level representations needed for discriminative tasks like classification. This paper introduces DDAE++, a framework that incorporates self-conditioning, a lightweight architectural tweak that reroutes intermediate features to guide the decoding process. This simple change creates a "semantic bottleneck," simultaneously boosting both image generation quality and representation learning performance across UNet, UViT, and DiT architectures.

Introduction

There is growing interest in using pre-trained diffusion models as unified learners—models that can both generate high-quality images and provide rich feature representations for downstream tasks like classification or segmentation. However, standard diffusion models distribute semantic information across all their layers, lacking an explicit "information bottleneck." Consequently, the richest high-level semantics get diluted as they propagate through the decoding layers, causing diffusion models to lag behind dedicated self-supervised learning (SSL) methods. DDAE++ addresses this by introducing a semantic bottleneck that bridges generative and discriminative capabilities.

Methodology

The core innovation of DDAE++ is self-conditioning, combined with adapted SSL techniques.

Self-Conditioning

The model aggregates rich semantic features from an intermediate layer and re-injects them into subsequent decoding layers to guide generation.

  • For UNet and DiT: Global average pooling is applied to a specific intermediate layer. This representation is scaled with a time-dependent factor and added to the standard timestep conditioning pathway.
  • For UViT: A learnable [CLS] summary token is introduced to automatically aggregate global semantics and condition patch tokens via self-attention.
The self-conditioning mechanism for DiT and UNet architectures, including a PyTorch-style code implementation.

Contrastive Self-Distillation and Augmentation

To refine the semantic bottleneck, DDAE++ applies a MoCo v3-style contrastive loss. Instead of a separate momentum encoder, the framework uses the diffusion model's existing Exponential Moving Average (EMA) model as the "teacher." Furthermore, specific geometric transformations—non-leaky augmentations—are used during training to improve representation robustness without causing visual artifacts to leak into generated images.

Extracted figure from page 5 of DDAE++: Enhancing Diffusion Models Towards Unified Generative and Discriminative Learning

Key Insights

  • The Architectural Bridge: Self-conditioning fundamentally links discriminative features to the generative decoding path. This link ensures that techniques improving feature discrimination (like contrastive learning) actively improve generation quality.
  • Structural Phase Transition: Using Centered Kernel Alignment (CKA), the authors demonstrated that self-conditioned models exhibit a sharp "phase transition," explicitly separating into a semantic encoding phase and a specialized generative decoding phase.
  • EMA as a Free Teacher: The EMA weights maintained during standard training serve as an optimal teacher for contrastive learning, eliminating additional compute overhead.
  • Early Success Prediction: The optimal layer for self-conditioning can be predicted early in training; the layer yielding the lowest training loss after just 20 epochs correlates with the best final FID and accuracy.

Experimental Results

DDAE++ demonstrates consistent improvements across various benchmarks:

  • Dual Improvements: On CIFAR-100, self-conditioning boosted linear probing accuracy by up to 1.99% while simultaneously improving FID scores.
  • Scalability on ImageNet-1k: Self-conditioned DiT models consistently outperformed baselines. For instance, a DiT-L model improved linear probing accuracy from 65.34% to 66.68% and FID from 2.09 to 2.04.
  • Transferability: Frozen features from enhanced models achieved higher mIoU on semantic segmentation tasks (ADE20K and VOC2012) compared to standard diffusion baselines.
  • Minimal Overhead: The architectural change is computationally inexpensive, adding only ~0.5M parameters to a UNet and just a single token to UViT.

Conclusion

DDAE++ successfully enhances diffusion models by introducing a semantic bottleneck through self-conditioning. This lightweight modification allows for a unified learning framework that excels in both generative and discriminative tasks. Future work will focus on scaling these methods to larger models and exploring better strategies for latent-space augmentations.

Summary updated

BibTeX
@misc{xiang2025ddae,
  author = {Weilai Xiang and Hongyu Yang and Di Huang and Yunhong Wang},
  title = {{DDAE++: Enhancing Diffusion Models Towards Unified Generative and Discriminative Learning}},
  year = {2025},
  eprint = {2505.10999},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.10999},
}
Figure