Latent Diffusion Models with Masked AutoEncoders

Junho Lee, Jeongwoo Shin, Hyungwook Choi, Joonseok Lee

TL;DR

This paper introduces Latent Diffusion Models with Masked AutoEncoders (LDMAEs), a novel approach to image generation that significantly improves quality and efficiency. By proposing three key properties for autoencoders within Latent Diffusion Models (LDMs) and introducing Variational Masked AutoEncoders (VMAEs), the authors achieve state-of-the-art results with a more robust and computationally efficient model.

What Problem Does This Paper Address?

Latent Diffusion Models (LDMs) have revolutionized image generation by performing the diffusion process in a compressed latent space, making them computationally more efficient than pixel-space diffusion models. However, the effectiveness of LDMs heavily relies on the underlying autoencoder that compresses images into this latent space. The authors identify that existing autoencoders, while good at certain aspects, fail to simultaneously satisfy crucial properties needed for optimal LDM performance. Specifically, they highlight a trade-off between latent space smoothness, perceptual compression quality, and reconstruction quality. This gap leads to suboptimal image generation and can hinder tasks requiring precise control. The paper aims to address this by proposing a new autoencoder architecture and demonstrating its benefits within the LDM framework.

Methods

The core of this work lies in the introduction of Variational Masked AutoEncoders (VMAEs). The authors propose three key properties for autoencoders in LDMs:

  1. Latent Smoothness: Ensures that small changes in the latent representation lead to small changes in the generated image, crucial for stable diffusion model training. VMAEs achieve this through probabilistic encoding and regularization towards a Gaussian prior.
  2. Perceptual Compression Quality: Focuses on compressing images into a latent space that retains essential semantic information while discarding fine perceptual details. VMAEs leverage the hierarchical compression capabilities of Masked Autoencoders (MAEs), which naturally learn to group features from object-level to finer patterns.
  3. Reconstruction Quality: Assesses how accurately the decoder can reconstruct the original image from the latent representation, both at the pixel and perceptual levels. VMAEs incorporate both reconstruction and perceptual losses to ensure high-fidelity outputs.

VMAEs are built upon a Vision Transformer (ViT) architecture and are trained with a novel objective that combines masked-part prediction (for hierarchical compression) and perceptual reconstruction losses, alongside latent regularization. These VMAEs are then integrated into the LDM framework, creating Latent Diffusion Models with Masked AutoEncoders (LDMAEs).

Datasets

The paper uses the following datasets:

  • ImageNet-1K: Used for training and evaluating autoencoders and for generating samples.
  • CelebA-HQ: Used for generating samples and evaluating the model's ability to capture diverse human faces.
  • ADE20K: Used for evaluating object-level perceptual compression.
  • CelebAMask-HQ: Used for evaluating part-level perceptual compression.

Key Insights and Ideas

  • The "Big Three" for LDM Autoencoders: The paper convincingly argues that latent smoothness, perceptual compression, and reconstruction quality are not just desirable but essential for autoencoders to effectively support LDMs. No existing autoencoder perfectly balances all three.
  • Hierarchical Compression is Key: The idea that compressing information hierarchically (from object to part to fine detail) is superior for image generation is a significant insight. MAEs naturally lend themselves to this, and VMAEs build upon this to retain both global structure and local details.
  • Pixel-Level Reconstruction Matters: While perceptual metrics are popular, the paper emphasizes the importance of pixel-level reconstruction quality, especially for tasks like image editing. VMAEs achieve strong performance on both.
  • VMAE Efficiency: The proposed VMAE is not only effective but also significantly more efficient than existing state-of-the-art autoencoders like SD-VAEs, requiring fewer parameters and computational resources, and training faster.

Key Results

  • Improved Generation Quality: LDMAEs, equipped with VMAEs, achieve state-of-the-art generation performance across multiple datasets (ImageNet-1K and CelebA-HQ), outperforming models using other autoencoders like SD-VAE. For example, on ImageNet-1K, LDMAE with VMAE achieves a gFID of 5.98, significantly better than SD-VAE's 9.00.
  • Enhanced Reconstruction: VMAEs demonstrate superior reconstruction quality, excelling in both pixel-level metrics (PSNR, SSIM) and perceptual metrics (rFID, LPIPS) compared to other autoencoders.
  • Robustness to Latent Perturbations: Probabilistic autoencoders, especially VMAE, show much greater robustness to noise in the latent space, indicating a smoother and more reliable latent manifold.
  • Efficiency Gains: VMAEs are substantially more efficient, using only 13.4% of the parameters and 4.1% of the GFLOPS of SD-VAE, and training 2.7 times faster.

Limitations and Future Work

  • Limitations: While the paper demonstrates strong results, the authors acknowledge that the "boundary between 'semantics' and 'perceptual details' is inherently ambiguous." The optimal balance for these properties might vary depending on the specific downstream task. The paper also notes that while VMAE's superior pixel-level reconstruction quality is likely beneficial, its direct impact on FID and IS scores is not fully captured by those metrics alone.
  • Future Work: The authors' findings provide a strong foundation for designing better autoencoders for LDMs. Future work could explore further optimizing the hierarchical compression strategy, investigating the impact of VMAEs on other generative tasks beyond unconditional image generation, and exploring their use in conditional or controllable generation scenarios. The efficiency gains also open doors for deploying LDMs on resource-constrained devices.

Summary updated

BibTeX
@inproceedings{lee2025latent,
  author = {Junho Lee and Jeongwoo Shin and Hyungwook Choi and Joonseok Lee},
  title = {{Latent Diffusion Models with Masked AutoEncoders}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}

Loading related content...

Figure