Abstract
As a widely recognized approach to deep generative modeling, Variational Auto-Encoders (VAEs) still face challenges with the quality of generated images, often presenting noticeable blurriness. This issue stems from the unrealistic assumption that approximates the conditional data distribution, $p(\textbf{x} | \textbf{z})$, as an isotropic Gaussian. In this paper, we propose a novel solution to address these issues. We illustrate how one can extract a latent space from a pre-existing diffusion model by optimizing an encoder to maximize the marginal data log-likelihood. Furthermore, we demonstrate that a decoder can be analytically derived post encoder-training, employing the Bayes rule for scores. This leads to a VAE-esque deep latent variable model, which discards the need for Gaussian assumptions on $p(\textbf{x} | \textbf{z})$ or the training of a separate decoder network. Our method, which capitalizes on the strengths of pre-trained diffusion models and equips them with latent spaces, results in a significant enhancement to the performance of VAEs.
Introduction
Generative modeling has seen significant progress through two primary frameworks: Variational Auto-encoders (VAEs) and Diffusion Models (DMs). VAEs are prized for their structured latent spaces, which facilitate representation learning and downstream tasks. However, they are notorious for producing blurry reconstructions due to the restrictive Gaussian assumption on the conditional likelihood $p(\mathbf{x}|\mathbf{z})$. Conversely, diffusion models generate high-fidelity, sharp images by iteratively denoising random noise, but they typically lack an efficient encoding mechanism to map data into a meaningful latent space.
This research introduces ScoreVAE, a framework designed to bridge this gap. By extracting a latent space from a pre-trained, unconditional diffusion model, ScoreVAE achieves the best of both worlds: the structured latents of a VAE and the high-quality generation of a diffusion model.
The ScoreVAE Framework
The core innovation of ScoreVAE is the analytical derivation of a decoder using Bayes’ rule for score functions. Unlike traditional VAEs that require training a neural network to act as a decoder, ScoreVAE leverages the score function of a pre-existing diffusion model.
Analytical Decoding and Decoupled Training
The decoding process is formulated as a conditional reverse diffusion. The "decoding score"—the gradient required to denoise an image—is mathematically decomposed into two components:
- The Prior Score: Provided by a frozen, pre-trained unconditional diffusion model.
- The Latent Posterior Score: Provided by a newly trained encoder network.
This decomposition allows for decoupled training. Researchers can take a state-of-the-art diffusion model "off the shelf" and only train the encoder to maximize a derived lower bound on the marginal data log-likelihood. This approach avoids the computational burden and instability of training a complex conditional diffusion model from scratch. To further refine results and correct for mathematical approximations, the authors also propose ScoreVAE+, which includes a small auxiliary correction network.
Experimental Evaluation
The authors evaluated ScoreVAE on standard benchmarks, including CIFAR10 ($32 \times 32$) and CelebA ($64 \times 64$).
Key Results
The method demonstrates substantial improvements in both quantitative metrics and visual fidelity. On CIFAR10, ScoreVAE+ achieved a Perceptual Quality (LPIPS) score of 0.119, significantly better than the 0.269 achieved by a standard $\beta$-VAE.
As shown in the qualitative results, traditional VAEs produce smoothed, "ghostly" reconstructions. In contrast, ScoreVAE reconstructions preserve fine-grained details such as hair texture, facial features, and sharp edges. The decoupled training approach also proved more stable than joint training methods (like DiffDecoders), particularly when enforcing a strong latent bottleneck.
Discussion and Conclusion
ScoreVAE successfully bypasses the Gaussian likelihood assumption that plagues traditional VAEs. By using the diffusion process as the likelihood, the model captures the complex, multi-modal nature of image data.
While the method offers superior quality and modularity, it inherits the sampling speed limitations of diffusion models, requiring multiple iterations for reconstruction. Future work will focus on scaling this approach to higher-resolution datasets and exploring more complex variational families for the encoder to further bridge the variational gap. In summary, ScoreVAE provides a powerful, modular way to equip existing diffusion models with the representation learning capabilities of VAEs without sacrificing image quality.
Summary updated