Adversarially Learned Inference

Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, Aaron Courville

Introduction

In the world of deep generative models, two giants have traditionally stood apart: Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs).

VAEs excel at "inference"—they can take an image and map it back to the underlying latent variables that produced it. However, because they rely on pixel-wise loss functions, their generated images are often blurry. Conversely, GANs produce stunningly sharp, realistic images but act as "black boxes" regarding inference. Once a GAN is trained, there is no straightforward way to take a real image and find the specific noise vector ($z$) that would recreate it.

Adversarially Learned Inference (ALI) is a framework designed to bridge this gap. It jointly learns to generate data and perform inference (mapping data back to latent factors) within a single adversarial game. By training a discriminator to distinguish between pairs of (data, latent) samples from two different directions, ALI produces high-quality, sharp images like a GAN while maintaining the useful latent representations typical of a VAE.

The ALI Framework: Matching Joint Distributions

The core innovation of ALI is the adversarial game played over joint distributions. In a standard GAN, the discriminator only looks at data ($x$) and tries to decide if it is real or fake. In ALI, the discriminator evaluates pairs of data and latent codes $(x, z)$.

ALI Architecture

As illustrated above, two networks attempt to fool the Discriminator ($D$):

  1. The Inference Network / Encoder ($G_z$): Takes real data $x$ and produces a latent code $\hat{z}$. This creates a joint pair $(x, \hat{z})$.
  2. The Generation Network / Decoder ($G_x$): Takes a random latent code $z$ and generates data $\tilde{x}$. This creates a joint pair $(\tilde{x}, z)$.

The Discriminator is trained to distinguish between these two types of pairs. To win, the Encoder and Decoder must work together so that the distribution of "real data with inferred codes" looks exactly like "random codes with generated data."

Crucially, ALI does not use a traditional reconstruction loss (like Mean Squared Error). Instead, the "reconstruction" property emerges naturally: if the joint distributions match, the conditional distributions must also match, meaning the encoder's $z$ must be a meaningful representation of the input $x$.

Key Insights

  • Matching Joints is Powerful: By matching the joint distributions $p(x, z)$ and $q(x, z)$, the model automatically matches the marginals (the quality of generated images) and the conditionals (the quality of the inference).
  • Departure from Pixel-Perfection: Because there is no pixel-wise loss, ALI reconstructions aren't always exact copies. For example, if you reconstruct a face, the model might change the exact hair color or eye position but will maintain the "essence" (pose, gender, expression). This suggests the model is learning high-level semantics rather than just memorizing pixels.
  • Stochasticity Matters: ALI emphasizes using stochastic (probabilistic) mappings for both generation and inference, providing the flexibility needed to model complex data distributions.

Results and Performance

The authors evaluated ALI on several standard benchmarks, including CIFAR-10, SVHN (Street View House Numbers), CelebA, Tiny ImageNet, and a 2D Toy Dataset.

CelebA Samples
  • Image Quality: As seen in datasets like CelebA, ALI produces sharp, high-fidelity samples that far surpass the clarity of standard VAEs.
  • Semi-Supervised Learning: The latent representations learned by ALI proved highly effective for downstream tasks. On the SVHN classification task, ALI achieved a 7.42% error rate, which was highly competitive with state-of-the-art approaches.
  • Latent Space Interpolation: The model learned a coherent manifold of data. Taking two real images, mapping them to latent space, and interpolating between them yielded smooth and realistic transition images.
  • Mode Coverage: On a toy 2D dataset of 25 Gaussians, ALI covered significantly more modes ($13.4/25$) than a standard GAN ($10.4/25$), suggesting the inference network helps stabilize training and prevent "mode collapse."

Limitations and Future Work

While ALI successfully marries the strengths of GANs and VAEs, it has limitations:

  • Faithfulness of Reconstructions: Because reconstructions are "believable" rather than "faithful," ALI may not be suitable for tasks requiring exact pixel-level reproduction (like medical imaging).
  • Underfitting: On complex datasets like CIFAR-10, the model sometimes struggles to capture exact object identities, likely due to underfitting.
  • Discrete Data: The model relies on the "reparameterization trick" for backpropagation, making it difficult to apply directly to discrete data like text or categorical latent variables without further modifications.
  • Training Stability: Like all GAN-based architectures, ALI can be sensitive to hyperparameter choices and requires careful balancing between the generator/encoder and the discriminator.

Summary updated

BibTeX
@inproceedings{dumoulin2017adversarially,
  author = {Vincent Dumoulin and Ishmael Belghazi and Ben Poole and Alex Lamb and Martin Arjovsky and Olivier Mastropietro and Aaron Courville},
  title = {{Adversarially Learned Inference}},
  booktitle = {International Conference on Learning Representations},
  year = {2017},
  url = {https://openreview.net/forum?id=B1ElR4cgg},
}
Figure