Scalable Gaussian Process Variational Autoencoders

Metod Jazbec, Matthew Ashman, Vincent Fortuin, Michael Pearce, Stephan Mandt, Gunnar Rätsch

Abstract

Conventional variational autoencoders fail in modeling correlations between data points due to their use of factorized priors. Amortized Gaussian process inference through GP-VAEs has led to significant improvements in this regard, but is still inhibited by the intrinsic complexity of exact GP inference. We improve the scalability of these methods through principled sparse inference approaches. We propose a new scalable GP-VAE model that outperforms existing approaches in terms of runtime and memory footprint, is easy to implement, and allows for joint end-to-end optimization of all components.

Introduction

Gaussian Process Variational Autoencoders (GP-VAEs) are powerful models for capturing correlations between data points. However, their $O(N^3)$ computational complexity makes them notoriously hard to scale. Standard VAEs assume that data points are independent and identically distributed (i.i.d.) by using factorized priors, which limits their ability to model structured correlations, such as frames in a video or different rotated views of an object. GP-VAEs address this by placing a Gaussian Process (GP) prior over the latent space, linking data points based on auxiliary information like timestamps.

The primary challenge lies in the computational clash between VAEs and GPs. Deep learning models require large datasets and mini-batch training, whereas GPs typically require the entire dataset in memory and scale cubically with the number of data points $N$. Previous attempts to scale GP-VAEs were often restricted to specific kernels or data types. This work introduces a generic, kernel-agnostic framework for training GP-VAEs on large datasets using mini-batches.

Methods: Scalable Variational GP-VAE (SVGP-VAE)

To achieve scalability, the authors utilize sparse Gaussian processes, which summarize the full dataset using a set of $m$ "inducing points." Naive integration of sparse GPs into VAEs faces a trade-off between amortization and mini-batching. Titsias (2009) allows for amortized inference but requires the full dataset in memory, while Hensman et al. (2013) allows for mini-batching but breaks amortization by using free-floating variational parameters.

The proposed SVGP-VAE provides a hybrid solution. During training, stochastic estimates for optimal variational parameters are computed analytically from a mini-batch. These amortized parameters are then used within a decomposable Evidence Lower Bound (ELBO). This enables mini-batching while maintaining amortized inference and allowing joint optimization of VAE weights, GP kernel parameters, and inducing point locations.

Results

The model was evaluated on three datasets: Synthetic Moving Ball (trajectories), Rotated MNIST (4,050 images), and SPRITES (50,000 images).

Qualitative comparison of latent trajectories on the Moving Ball dataset. SVGP-VAE captures the structure similarly to the exact GP-VAE while offering superior scalability.

Performance and Scalability

The SVGP-VAE reduces computational complexity from $O(N^3)$ to $O(bm^2 + m^3)$, where $b$ is the batch size and $m$ is the number of inducing points. On Rotated MNIST, it achieved a Mean Squared Error (MSE) of 0.0251, significantly outperforming standard Conditional VAEs (0.0796) and the previous state-of-the-art GP-VAE (0.0370), while training nearly 10x faster (1.90s vs 19.10s per epoch).

RMSE on the Moving Ball dataset as a function of the number of inducing points $m$, showing convergence to exact GP-VAE performance.

On the moving ball dataset, SVGP-VAE matched exact GP-VAE performance with only 15 inducing points. On the large-scale SPRITES dataset ($N=50,000$), the model scaled easily, achieving a test MSE of 0.0079, a feat previously impossible for generic GP-VAEs.

Conclusion

The SVGP-VAE successfully resolves the tension between amortization and mini-batching in GP-VAEs. By leveraging sparse GP approximations in a principled way, it enables the application of structured priors to large-scale datasets. While the mini-batch estimators are technically biased, the practical impact is negligible. Future work includes exploring linear-complexity sparse GP techniques and applying the framework to high-dimensional real-world data like medical time series.

Summary updated

BibTeX
@inproceedings{jazbec2021scalable,
  author = {Metod Jazbec and Matthew Ashman and Vincent Fortuin and Michael Pearce and Stephan Mandt and Gunnar Rätsch},
  title = {{Scalable Gaussian Process Variational Autoencoders}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=BeZdG9lwxc},
}
Figure