Neighbour-Driven Gaussian Process Variational Autoencoders for Scalable Structured Latent Modelling

Xinxing Shi, Xiaoyu Jiang, Mauricio A. Álvarez

TL;DR

Gaussian Process Variational Autoencoders (GPVAEs) are powerful tools for modeling structured data, but they suffer from a crippling $O(N^3)$ computational bottleneck. This paper introduces a "neighbour-driven" inference strategy that restricts GP interactions to a data point's nearest neighbours in the latent space. The resulting models, GPVAE-HPA and GPVAE-SPA, achieve state-of-the-art accuracy and massive scalability without relying on restrictive kernel assumptions or finicky inducing points.

What Problem Does This Paper Address?

Standard Variational Autoencoders (VAEs) assume that latent representations are independent and identically distributed (i.i.d.). This assumption falls apart when dealing with structured data like video frames, time series, or spatial geostatistics, where data points are inherently correlated.

GPVAEs fix this by replacing the independent prior with a Gaussian Process (GP) prior over the latent space. However, exact GP inference scales cubically ($O(N^3)$) with the number of data points $N$, making large-scale applications impossible. Existing workarounds either force users into rigid, narrow kernel choices or rely on "inducing points" (a small set of pseudo-inputs). Inducing points struggle to capture rapid local variations and become computationally heavy and difficult to optimize at scale.

Methods

The authors propose two complementary, neighbour-driven approximation methods inspired by Nearest Neighbour GPs (NNGPs) to sparsify the latent GP prior:

  1. Hierarchical Prior Approximation (HPA): This method introduces a binary random indicator vector to select local neighbourhoods within each mini-batch. It effectively forces sparsity directly onto the dense GP covariance matrix by "switching off" long-range interactions between non-neighbouring latent variables.
  2. Sparse Precision Approximation (SPA): This approach chain-factorizes the joint GP prior distribution using the probability chain rule but restricts the conditioning set of each data point to its $H$ nearest historical neighbours. This directly yields a sparse Cholesky factor for the prior precision (inverse covariance) matrix.

Both methods allow the troublesome Kullback-Leibler (KL) divergence term in the VAE objective to decompose into manageable, low-dimensional computations ($H \times H$ matrices), enabling seamless mini-batch training with arbitrary kernels.

GPVAE places a GP prior over latent variables Z. The proposed approach approximates the dense GP prior by leveraging the associated local neighbourhood.

Datasets

The models were evaluated across several diverse benchmarks:

  • Moving Ball: A synthetic dataset of 30-frame videos tracking a pixel ball moving along a 2D trajectory.
  • Rotated MNIST: Sequential handwritten digits rotated at consecutive angles, evaluated on corrupted frame imputation (60% missing pixels) and missing frame generation (60% dropped frames).
  • MuJoCo Hopper Physics: 14-dimensional physical simulation time-series data with 1,000 timestamps and 60% missing features.
  • Jura: A spatial geostatistical dataset containing hundreds of data points measuring metal concentrations in Swiss soil.
  • SPE10: A massive, highly heterogeneous geostatistical dataset from petroleum engineering consisting of over 141,900 data points measuring reservoir porosity and permeability.

Key Insights and Ideas

  • The "First Law of Geography" Applies to Latent Spaces: The core intuition is that local adjacencies capture the vast majority of essential correlation structures. By focusing only on nearest neighbours, the model discards redundant long-range dependencies without sacrificing predictive quality.
  • Inducing Points Fail Where Local Adjacency Excels: On highly heterogeneous datasets like SPE10, inducing point methods (which smooth out the space using global pseudo-points) fail to capture rapid local changes. Neighbour-driven methods excel here because they anchor computations to actual nearby data points.
  • Sparsity via Covariance vs. Precision: HPA and SPA achieve local sparsity in fundamentally different ways—HPA zeroes out elements in the covariance matrix, while SPA zeroes out elements in the precision matrix. Both prove to be valid and highly effective for scalable inference.

Key Results

  • Moving Ball Trajectory: GPVAE-SPA achieved excellent trajectory reconstruction quality using only $\frac{1}{6}$ of the total trajectory points, matching full-batch GP benchmarks while significantly outperforming inducing-point methods (SVGPVAE).
  • Rotated MNIST: On the missing frame generation task, GPVAE-SPA achieved the lowest Root Mean Squared Error (RMSE = 5.412) and Negative Log-Likelihood (NLL = 69.538), outperforming Markovian GPVAEs (MGPVAE) and longitudinal VAEs (LVAE) while maintaining fast training times ($\sim$9.3 seconds/epoch).
Figure 3: (a) Corrupted frame imputation with around 60% missing pixels. (b) Missing frames generation on Rotated MNIST with around 60% missing frames. The red boxes indicate the missing frames in that sequence.
  • Massive Scalability (SPE10): On the large-scale SPE10 dataset ($N \sim 141,900$), both GPVAE-HPA and GPVAE-SPA dramatically outperformed inducing-point baselines (achieving an RMSE of 0.638 vs. SVGPVAE's 0.979) while requiring $15\times$ fewer trainable parameters than standard Variational Nearest Neighbour GPs (VNNGP).

Limitations and Future Work

While the proposed neighbour-driven framework is highly flexible and doesn't require a specific distance metric, the authors primarily relied on standard Euclidean distance to define nearest neighbours. In high-dimensional latent spaces, Euclidean distance can become less meaningful due to the curse of dimensionality. The authors suggest that exploring alternative distance metrics—such as correlation-based distances or advanced manifold-aware metrics—is a promising and necessary direction for future work.

Summary updated

BibTeX
@inproceedings{shi2025neighbour,
  author = {Xinxing Shi and Xiaoyu Jiang and Mauricio A. Álvarez},
  title = {{Neighbour-Driven Gaussian Process Variational Autoencoders for Scalable Structured Latent Modelling}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=XlRIub1r5s},
}
Figure