ByPE-VAE: Bayesian Pseudocoresets Exemplar VAE

Qingzhong Ai, Lirong He, Shiyu Liu, Zenglin Xu

Introduction

Exemplar VAEs improve upon standard Variational Autoencoders (VAEs) by using the actual training data as a rich, non-parametric prior. However, this approach scales poorly and is computationally massive. To address this, researchers have introduced ByPE-VAE (Bayesian Pseudocoresets Exemplar VAE), which uses "Bayesian pseudocoresets" to compress the training data into a tiny, weighted set of pseudo-inputs. This achieves up to a 3x training speedup over Exemplar VAEs while matching or exceeding state-of-the-art performance in density estimation and representation learning.

The Bottleneck in Exemplar VAEs

In a standard VAE, the prior distribution is typically a simple standard normal (Gaussian) distribution. While computationally convenient, this simplistic prior ignores the underlying nature of the data, often leading to "posterior collapse" and over-regularization, where the model generates blurry or generic samples.

To fix this, the Exemplar VAE uses a non-parametric prior based on the training data itself (the "exemplars"). While Exemplar VAEs generate highly impressive results, they require the entire dataset to participate in the prior's calculation during training. For massive datasets, calculating this prior becomes a severe computational bottleneck. ByPE-VAE tackles this exact scaling problem: capturing the rich, data-driven prior of an Exemplar VAE without the crippling computational cost.

Enter Bayesian Pseudocoresets

The core idea behind ByPE-VAE is inspired by coresets—a technique used to find a small, weighted subset of data that efficiently approximates an entire dataset. Instead of using all $N$ training samples as the prior, ByPE-VAE learns a small set of $M$ "pseudodata" points (where $M \ll N$) and assigns a weight to each point.

  1. Variational Inference for Coresets: The model formulates the search for the optimal pseudocoreset as a variational inference problem. It minimizes the Kullback-Leibler (KL) divergence between a prior based on the small pseudocoreset and a prior based on the massive full dataset.
  2. Two-Step Alternating Optimization: To train the model efficiently, the authors use an alternating strategy. First, they freeze the pseudocoreset and update the standard VAE parameters. Next, they freeze the VAE parameters and update the pseudodata points and their weights.
  3. Lazy Updating: To maximize speed, the pseudocoreset isn't updated every single step. It is only updated every $k$ epochs (e.g., $k=10$), drastically cutting down computational overhead.

Key Insights and Performance

ByPE-VAE was evaluated on standard image benchmarks including Dynamic MNIST, Fashion MNIST, CIFAR10, and CelebA. The coreset paradigm proves to be an excellent fit for VAEs. By weighting a small number of learned pseudo-inputs, the model accurately approximates the distribution of the entire dataset, making the learned pseudo-inputs highly interpretable.

Generated faces on CelebA

Density Estimation and Speed

ByPE-VAE achieved state-of-the-art Negative Log-Likelihood (NLL) across multiple network architectures (MLP, HVAE, ConvHVAE). For example, using a ConvHVAE on Dynamic MNIST, ByPE-VAE achieved an NLL of 22.84, edging out the Exemplar VAE (22.92) and VampPrior (22.94).

Crucially, this performance comes with massive efficiency gains. On Dynamic MNIST, ByPE-VAE required only 13.19 seconds/epoch, compared to the Exemplar VAE's 35.45 seconds/epoch. This is nearly a 3x speedup while maintaining better NLL scores. The "lazy" updating strategy is the secret sauce here—the VAE continues to learn effectively even if its prior isn't updated on every single forward pass.

Representation Learning

In a k-Nearest Neighbor (kNN) classification task on the learned latent space, ByPE-VAE consistently outperformed standard VAEs and Exemplar VAEs, proving it learns more meaningful, separated clusters.

KNN classification accuracy on MNIST and Fashion MNIST

Furthermore, when using the VAE to generate synthetic data to train a downstream classifier (data augmentation), ByPE-VAE reduced the test error on MNIST to 0.88%, compared to 1.10% for the Exemplar VAE.

Limitations

One practical constraint emerges during generative data augmentation: lack of labels. Because the pseudocoreset consists of synthetic, learned points, they do not have ground-truth class labels. To generate labeled synthetic data for downstream tasks, the authors had to swap the pseudocoreset out for the original training data at the end of training.

Future work could involve scaling this approach to much larger, high-resolution datasets or applying Bayesian pseudocoresets to other modalities like text or audio generation.

Summary updated

BibTeX
@inproceedings{ai2021bype,
  author = {Qingzhong Ai and LIRONG HE and SHIYU LIU and Zenglin Xu},
  title = {{ByPE-VAE: Bayesian Pseudocoresets Exemplar VAE}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=SBiKnJW9fy},
}
Figure