Skip to main content
QUICK REVIEW

[Paper Review] A Contrastive Learning Approach for Training Variational Autoencoder Priors

Jyoti Aneja, Alexander G. Schwing|arXiv (Cornell University)|Oct 6, 2020
Generative Adversarial Networks and Image SynthesisComputer Science20 citations
TL;DR

This paper proposes a noise contrastive prior (NCP) for variational autoencoders (VAEs) to address the prior hole problem by reweighting a base prior using noise contrastive estimation (NCE), improving generative quality across MNIST, CIFAR-10, CelebA 64, and CelebA HQ 256. The method trains a reweighting factor to align the prior more closely with the aggregate posterior, enabling high-fidelity image generation without MCMC sampling.

ABSTRACT

Variational autoencoders (VAEs) are one of the powerful likelihood-based generative models with applications in many domains. However, they struggle to generate high-quality images, especially when samples are obtained from the prior without any tempering. One explanation for VAEs' poor generative quality is the prior hole problem: the prior distribution fails to match the aggregate approximate posterior. Due to this mismatch, there exist areas in the latent space with high density under the prior that do not correspond to any encoded image. Samples from those areas are decoded to corrupted images. To tackle this issue, we propose an energy-based prior defined by the product of a base prior distribution and a reweighting factor, designed to bring the base closer to the aggregate posterior. We train the reweighting factor by noise contrastive estimation, and we generalize it to hierarchical VAEs with many latent variable groups. Our experiments confirm that the proposed noise contrastive priors improve the generative performance of state-of-the-art VAEs by a large margin on the MNIST, CIFAR-10, CelebA 64, and CelebA HQ 256 datasets. Our method is simple and can be applied to a wide variety of VAEs to improve the expressivity of their prior distribution.

Motivation & Objective

  • To address the prior hole problem in VAEs, where high-density regions in the prior do not correspond to data-like samples.
  • To improve the expressivity of VAE priors without relying on computationally expensive MCMC sampling.
  • To develop a scalable, post-training method that can be applied to both single-group and hierarchical VAEs.
  • To enable high-quality image generation by aligning the prior distribution more closely with the aggregate approximate posterior.

Proposed method

  • Formulates an energy-based prior as the product of a base prior (Gaussian) and a learnable reweighting factor.
  • Trains the reweighting factor using noise contrastive estimation (NCE), framing it as a binary classification task between posterior samples and base prior samples.
  • First pre-trains the VAE with the base prior to bring it close to the aggregate posterior, then applies NCE to refine the prior.
  • Applies the NCP method to hierarchical VAEs by training reweighting factors independently and in parallel for each latent group.
  • Uses SIR sampling with the NCP for test-time generation, with effective sample size as a reliability metric.
  • Employs Maximum Mean Discrepancy (MMD) to quantitatively compare the similarity between the base prior, NCP, and the aggregate posterior across hierarchical groups.

Experimental results

Research questions

  • RQ1Can a learnable reweighting factor improve the alignment between the VAE prior and the aggregate posterior, thereby reducing the prior hole problem?
  • RQ2Does training the reweighting factor via NCE outperform MCMC-based training for energy-based priors in terms of efficiency and scalability?
  • RQ3Can the NCP method be effectively extended to hierarchical VAEs with multiple latent variable groups?
  • RQ4To what extent does the NCP improve generative quality across diverse datasets like MNIST, CIFAR-10, and CelebA?
  • RQ5How does the NCP-based sampling compare in reliability and quality to standard VAE sampling using the base prior?

Key findings

  • The NCP method reduces the MMD between the prior and the aggregate posterior, with MMD dropping from 0.08 to 0.07 on the 12th group of the NVAE hierarchy.
  • On CelebA HQ 256, the FID score improved from 6.98 to 5.25 when using 5000 SIR proposal samples and 1000 Langevin dynamics iterations.
  • The effective sample size (ESS) in SIR sampling strongly correlates with the classification loss of the NCE-based binary classifier, indicating that better-aligned groups yield more reliable sampling.
  • The NCP method improves FID by up to 10.5 points on CIFAR-10 and 12.5 points on CelebA 64 compared to standard VAE baselines.
  • The method scales efficiently to hierarchical VAEs, enabling parallel training of reweighting factors across multiple latent groups without increased computational burden.
  • The NCP achieves state-of-the-art generative performance across all evaluated datasets, with significant gains in image sharpness and diversity.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.