Can VAEs Generate Novel Examples?

Alican Bozkurt, Babak Esmaeili, Dana H. Brooks, Jennifer G. Dy, Jan-Willem van de MeentarXiv 2018

TL;DR

While Variational Autoencoders (VAEs) are designed to generate novel data, this paper reveals that high-capacity VAEs often default to performing "nearest-neighbor" lookups in the training data. Surprisingly, the authors find that shallower models with restricted capacity actually generalize better to unseen categories, whereas deeper models tend to overfit by producing blurry averages of known examples.

What Problem Does This Paper Address?

The "magic" of generative models like VAEs is their supposed ability to learn the underlying structure of data and create entirely new, plausible examples. However, there is a theoretical concern: if a decoder network is powerful enough, it might simply "memorize" the training set.

The authors investigate a specific hypothesis: does a VAE actually learn to synthesize new concepts, or is it just performing a sophisticated version of a weighted average (or nearest-neighbor matching) of the images it saw during training? This is a critical question for understanding whether these models are truly "creative" or just efficient data retrievers.

Methods

The researchers anchor their study on a mathematical theorem (Shu et al., 2018) which states that an "optimal" decoder with infinite capacity will always output a convex combination (a weighted average) of the training data.

To test how this holds up in practice, they:

  1. Compare Architectures: They trained "Shallow" VAEs (1 hidden layer) and "Deep" VAEs (3 hidden layers).
  2. Measure "Averaging" Behavior: They calculated the "weighted average" of training samples for every test input and compared it to the actual VAE output.
  3. Analyze Weight Distribution: They used "weight perplexity" to see how many training images contribute to a single reconstruction. If the perplexity is 1, the model is essentially just picking the single closest image from the training set (Nearest Neighbor).

Datasets

The study uses the MNIST dataset of handwritten digits. To test generalization, they created specific partitions:

  • $MNIST^{tr}$: The standard training set.
  • $MNIST^{tr}_{\setminus 9}$: A training set where all images of the digit '9' were removed.
  • $MNIST^{te}_9$: A test set consisting only of the digit '9'.

By training on everything except 9s and then asking the model to reconstruct a 9, they could measure "out-of-distribution" generalization.

Key Insights and Ideas

  • The Nearest-Neighbor Trap: For models trained on the full dataset, the "weight perplexity" usually peaked at 1. This means that for most test images, the VAE wasn't blending features; it was identifying one specific training example and trying to reproduce it.
  • Capacity vs. Creativity: There is a trade-off between reconstruction accuracy and generalization. High-capacity (deep) models are better at mimicking the training data but fail miserably when they encounter something new (like a '9' they weren't trained on).
  • The "Shallow" Advantage: Shallow VAEs were surprisingly good at reconstructing the withheld digit '9'. Because they lacked the capacity to perfectly map latent coordinates to specific training points, they were forced to learn more general features (like loops and lines) that allowed them to "imagine" a 9.
  • Depth Matters More Than Width: The number of layers (depth) was a much stronger predictor of "memorization" behavior than the total number of parameters.

Key Results

  • Qualitative Failure of Deep VAEs: When a Deep VAE (trained without 9s) was shown a '9', it produced a blurry image that looked like a weighted average of 4s, 7s, and 0s.
  • Qualitative Success of Shallow VAEs: The Shallow VAE (trained without 9s) successfully reconstructed a recognizable '9', proving it had learned generalizable strokes rather than just training-set lookups.
  • Quantitative Confirmation: Using Binary Cross Entropy (BCE), the authors showed that reconstructions from shallow models were closer to the actual input image than to the "weighted average" of the training set. For deep models, the opposite was true—they were closer to the theoretical "weighted average" of the training data.

Limitations and Future Work

  • Dataset Complexity: The study is limited to MNIST. While MNIST is a standard benchmark, it is much simpler than real-world images. It remains to be seen if these findings scale to complex datasets like CelebA or ImageNet.
  • Defining "Novelty": The paper acknowledges that "novel" and "plausible" are still somewhat vague terms in generative modeling.
  • Future Directions: The authors suggest investigating new objective functions that explicitly encourage the model to combine different features of training samples (like "the loop of a 0" and "the tail of a 7") rather than just averaging the raw pixel values in high-dimensional space.

Summary updated

BibTeX
@misc{bozkurt2018can,
  author = {Alican Bozkurt and Babak Esmaeili and Dana H. Brooks and Jennifer G. Dy and Jan-Willem van de Meent},
  title = {{Can VAEs Generate Novel Examples?}},
  year = {2018},
  eprint = {1812.09624},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1812.09624},
}
Figure