NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Diffusion Based Representation Learning

Sarthak Mittal, Korbinian Abstreiter, Stefan Bauer, Bernhard Schölkopf, Arash MehrjouICML 2023

Introduction

While diffusion models have revolutionized image generation and currently stand as the champions of image quality, they lack the inherent "latent space" that makes models like Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs) so useful for understanding data. Diffusion models are essentially "black boxes" when it comes to feature extraction; they denoise data step-by-step without necessarily creating a reusable, compressed summary of the input.

Existing methods to extract representations from diffusion models often rely on contrastive learning (such as SimCLR), which requires humans to manually select domain-specific data augmentations like cropping or color jittering. This paper introduces Diffusion-based Representation Learning (DRL), a framework that seamlessly plugs an encoder into the diffusion process to learn rich, unsupervised representations using only the internal logic of the diffusion process.

Methodology: Conditional Score Matching

To bridge the gap between diffusion and representation learning, the authors propose a new objective function called Conditional Score Matching.

In standard diffusion, a model learns to predict the "score" (the direction to the clean data) at various noise levels. DRL augments this by adding a trainable encoder ($E_\phi$) that observes the clean image and provides a "latent code" $z$ as an additional input to the denoiser.

Overview of Conditional Score Matching in DRL

The authors introduce two variants of this approach:

  1. DRL (Deterministic): Uses a standard deterministic encoder.
  2. VDRL (Variational): Uses a probabilistic encoder, functioning similarly to a VAE but operating entirely within the diffusion framework.

The Infinite-Dimensional Code

Most traditional models map an image to a single, static vector. In contrast, DRL proposes a "time-dependent" representation where the latent code is a curve that changes based on the noise level ($t$). This allows the model to capture different levels of detail—ranging from coarse, global shapes to fine-grained textures—within the exact same representation.

Key Insights

  • Noise as a Feature Filter: One of the most striking findings is that the noise level ($t$) acts as a semantic lens. When the model is trained on high noise levels, the latent code learns "global" features like object class. At low noise levels, it captures "fine-grained" details like stroke thickness or specific textures. This allows for manual control over the granularity of the learned features.
  • The "Non-Vanishing" Opportunity: The authors mathematically prove that the standard Denoising Score Matching objective has a "non-vanishing constant"—a theoretical floor the loss cannot drop below. By introducing the latent code, they turn this constant into a gap that the encoder can fill. The encoder effectively "distills" information from the image into the code to help the denoiser minimize this remaining error.
  • Theoretical Superiority: The paper provides a proof sketch demonstrating that a time-dependent representation (a curve) is theoretically at least as expressive as, and often superior to, any static representation learned by a standard autoencoder.

Results and Performance

The models were trained and evaluated on four standard computer vision benchmarks: MNIST, CIFAR-10, CIFAR-100, and Mini-ImageNet.

  • Downstream Performance: Both DRL and VDRL significantly outperformed standard Autoencoders (AE) and Variational Autoencoders (VAE) on classification tasks across all tested datasets.
  • Semi-Supervised State-of-the-Art: When utilized as a pre-training step for LaplaceNet (a state-of-the-art semi-supervised model), DRL yielded massive improvements. For instance, on CIFAR-10 with only 100 labeled examples, accuracy jumped from 73.68% to 81.63%.
  • Sampling Speedup: Because the learned representations capture so much structural information, the authors found they could start the generation process from a lower noise level ($t=0.7$ instead of $1.0$) without sacrificing image quality. This reduced the required number of sampling steps, cutting computational costs by 30%.

Limitations and Future Work

While highly effective, the authors note that due to hardware constraints, their models were only trained for about 15% of the iterations typically used in top-tier diffusion research. It is highly likely that performance would scale further with additional compute.

Furthermore, while DRL beats "restricted" contrastive models (those without domain-specific augmentation "cheats"), it does not yet outperform full SimCLR on every metric. However, DRL remains a more general and elegant solution because it does not require human intuition to design data-specific augmentations.

Future work will explore how to jointly optimize the time parameter $t$ during downstream tasks, allowing the model to automatically select the optimal "level of detail" for any specific problem.

Summary updated

BibTeX
@inproceedings{mittal2023diffusion,
  author = {Sarthak Mittal and Korbinian Abstreiter and Stefan Bauer and Bernhard Schölkopf and Arash Mehrjou},
  title = {{Diffusion Based Representation Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=LCAjuPNJP0},
}
Figure