Dimensionality Reduction as Probabilistic Inference

Aditya Ravuri, Francisco Vargas, Vidhi Lalchand, Neil D Lawrence

TL;DR

ProbDR unifies classical dimensionality reduction (DR) algorithms—ranging from spectral methods like PCA, Isomap, and Laplacian Eigenmaps to neighbor-embedding methods like t-SNE and UMAP—into a single variational inference framework. By viewing these algorithms as optimizing an Evidence Lower Bound (ELBO) over an intermediate data statistic (such as a covariance or graph adjacency matrix), the framework enables DR models to be implemented in Probabilistic Programming Languages (PPLs), equipped with generative models, and applied to unseen test data.

What Problem Does This Paper Address?

Dimensionality reduction is a cornerstone of data visualization, denoising, and exploratory analysis in fields like single-cell biology. While linear techniques like PCA have well-known probabilistic formulations (e.g., PPCA, GPLVMs), modern non-linear algorithms such as t-SNE, UMAP, and spectral graph methods have largely been developed as ad-hoc heuristic cost functions or geometric algorithms.

Without a rigorous probabilistic interpretation, these algorithms cannot easily:

  1. Incorporate prior domain knowledge or structured inductive biases.
  2. Quantify uncertainty or compose with larger probabilistic graphical models.
  3. Act as generative models to make principled predictions on unseen, out-of-sample data points.

Methods

The authors propose ProbDR, a variational framework where low-dimensional latent coordinates $X \in \mathbb{R}^{n \times l}$ define an intermediate summary statistic $M$ (such as an adjacency matrix, covariance, or precision matrix), which in turn parameterizes a generative model for the observed high-dimensional data $Y \in \mathbb{R}^{n \times d}$.

Under ProbDR, the evidence lower bound (ELBO) splits cleanly into two terms: $$\arg \max_{X, \theta} \mathbb{E}_{q(M|Y)}[\log p_\theta(Y|M)] - \mathrm{KL}(q(M|Y) \parallel p(M|X))$$

Because the variational distribution $q(M|Y)$ is fixed directly by the data without learned parameters (analogous to the forward process in diffusion models), the first term is constant with respect to the latents $X$. Maximizing the ELBO w.r.t. $X$ reduces strictly to minimizing the Kullback–Leibler divergence $\mathrm{KL}(q \parallel p)$.

The paper establishes two major equivalences:

  • Neighbor-Embedding Methods (SNE, t-SNE, UMAP): $M$ is a discrete adjacency matrix $A'$. The standard loss functions are exactly recovered as the KL divergence between variational distributions conditioned on data $Y$ and prior distributions parameterized by latent embeddings $X$:
  • SNE: Independent Categorical distributions per row.
  • t-SNE: A single joint Categorical distribution across all point pairs with Student-$t$ kernels.
  • UMAP: Product of independent Bernoulli edge probabilities.
  • Spectral / Eigendecomposition Methods ("Two-Step MAP"): Methods like PCA, CMDS, LLE, Laplacian Eigenmaps, MVU, and Diffusion Maps first compute an empirical moment matrix $\hat{M}$ (a sample covariance $\hat{S}$ or precision $\hat{\Gamma}$), then extract scaled eigenvectors. The authors prove that this second step is equivalent to Maximum A Posteriori (MAP) inference in a Wishart or Inverse-Wishart model.

Datasets

  • Rotated MNIST: A synthetic benchmark consisting of a 10-datapoint subset of MNIST digits (0, 1, and 7), each augmented with 25 rotations. This creates a controlled high-dimensional ($d = 784$), low-sample-size ($n = 250$) dataset with known 1D manifold loops.
  • Single-Cell RNA-seq (Tasic et al., 2018): Mouse brain cell transcriptomics data. The Lamp5 cluster was split 50/50 into training and unseen test sets (~1,000 cells each) across 3,000 highly variable genes to benchmark out-of-sample expression prediction.

Key Insights and Ideas

  • DR as Likelihood Matching on Graphs and Covariances: Popular cost functions in t-SNE and UMAP are not arbitrary heuristics; they correspond to exact KL divergences matching observed graphs to latent-conditioned random graphs.
  • Minor Coordinates Analysis (MCA): Mirroring Probabilistic PCA (which recovers leading eigenvectors via a Wishart covariance model), the authors introduce a probabilistic precision model whose MAP estimate recovers the minor eigenvectors (the smallest eigenvalues), formalizing algorithms like Laplacian Eigenmaps and LLE.
  • Dimensionality Reduction in PPLs: Because the objectives correspond to standard exponential-family likelihoods, algorithms like t-SNE, UMAP, and spectral embeddings can be executed directly inside standard probabilistic programming engines (such as Stan) with a few lines of code.
  • Free Generative Modeling: By pairing the inferred graph or precision with a Matérn graph Gaussian Process (Graph GP), classical DR embeddings can be used as generative models to make posterior predictions for new, unseen data points.

Key Results

  • Automated Inference in Stan: Embeddings produced by implementing ProbDR inside Stan faithfully reproduced the low-dimensional manifolds and clusters found by canonical open-source implementations (scikit-learn and umap-learn) on the rotated MNIST dataset.
  • Out-of-Sample Generalization: Using the ProbDR-UMAP model coupled with a Matérn Graph GP on the mouse brain scRNA-seq dataset, the model produced smooth out-of-sample gene expression predictions for the 50% held-out test cells, outperforming a standard vanilla Variational Autoencoder (VAE) in test RMSE.

Limitations and Future Work

  • Lack of Marginal Consistency: Because Graph GPs depend on the discrete graph Laplacian $L$, introducing a new test data point alters the graph structure and changes the covariance of all existing data points, violating strict marginal consistency.
  • Non-Uniform Marginal Variances: Standard graph Laplacians produce non-uniform marginal variances across nodes, requiring heuristic normalization steps.
  • Scalability: Full-form unamortized inference in PPLs for large datasets ($n > 10^4$) remains computationally intensive compared to custom gradient descent solvers used in production UMAP/t-SNE libraries.
  • Future Directions: Incorporating non-Euclidean geometry (e.g., hyperbolic kernels for hierarchical tree data or hyperspherical kernels for cyclical processes) into the generative prior.

Summary updated

BibTeX
@inproceedings{ravuri2023dimensionality,
  author = {Aditya Ravuri and Francisco Vargas and Vidhi Lalchand and Neil D Lawrence},
  title = {{Dimensionality Reduction as Probabilistic Inference}},
  booktitle = {SPIGM @ ICML},
  year = {2023},
  url = {https://openreview.net/forum?id=O4qVLlmjho},
}
Figure