Abstract
Variational inference (VI) is a cornerstone of Bayesian machine learning, yet it frequently relies on restrictive assumptions such as posterior unimodality and mathematical conjugacy. This paper introduces Nonparametric Variational Inference (NPV), a versatile algorithm that approximates complex, multimodal posterior distributions using a flexible mixture of kernels. By employing Taylor series expansions to handle non-conjugate likelihoods, NPV provides a general-purpose inference framework that is competitive with specialized bounds and often more efficient than Markov Chain Monte Carlo (MCMC) methods.
Introduction
In Bayesian modeling, the goal is often to approximate a posterior distribution $p(\theta|y)$. Traditional VI methods, particularly mean-field approximations, are computationally efficient but suffer from two major limitations. First, they are often "conjugacy-dependent," requiring specific pairings of priors and likelihoods to remain tractable. Second, they typically assume a unimodal (single-peaked) form, which fails to capture the complexity of distributions with multiple modes or significant skew.
Samuel Gershman, Matthew Hoffman, and David Blei (2012) proposed Nonparametric Variational Inference (NPV) to address these issues. NPV is designed as a "plug-and-play" method that requires only the log-joint probability and its derivatives, making it applicable to a wide range of continuous models.
The NPV Framework
The core innovation of NPV is the use of a uniformly weighted mixture of isotropic Gaussians to approximate the posterior: $$q(\theta) = \frac{1}{N} \sum_{n=1}^N \mathcal{N}(\theta; \mu_n, \sigma_n^2 I)$$
While the components themselves are parametric, the method is termed "nonparametric" because the approximation's complexity scales with the number of components $N$, similar to kernel density estimation. This flexibility allows NPV to capture intricate posterior shapes that a single Gaussian would miss.
Optimizing the Evidence Lower Bound (ELBO)
Optimizing the ELBO for a Gaussian mixture presents two primary challenges:
- Entropy Approximation: The entropy of a mixture of Gaussians lacks a closed-form solution. NPV utilizes Jensen’s inequality to derive a tractable lower bound.
- Non-Conjugate Likelihoods: To handle models where the prior and likelihood are not conjugate, the authors apply a second-order Taylor series expansion (the multivariate delta method). This allows the algorithm to use local curvature—specifically the Hessian—to determine the optimal shape and placement of the kernels.
The resulting optimization algorithm iterates between locating kernels in high-probability regions and adjusting their bandwidth to prevent overcrowding.
Experimental Evaluation
The authors evaluated NPV across two distinct domains:
- Logistic Regression: Tested on 13 binary classification datasets, NPV was compared against the Jaakkola & Jordan (JJ) bound, a gold-standard method specifically derived for logistic regression.
- Topographic Latent Source Analysis (TLSA): A complex, non-conjugate model applied to fMRI brain activity data. This task involved high-dimensional data (1,323 voxels) and required capturing subtle local patterns in neural responses.
Results and Discussion
NPV demonstrated remarkable performance across both benchmarks. In logistic regression, it achieved ELBO values and classification accuracies nearly identical to the specialized JJ method, proving its effectiveness as a general-purpose alternative.
In the fMRI experiments, NPV significantly outperformed Hamiltonian Monte Carlo (HMC) and Metropolis-Hastings in terms of predictive log-likelihood. Furthermore, NPV was approximately three times faster than HMC, highlighting the efficiency of deterministic approximations in high-dimensional spaces.
Conclusion
Nonparametric Variational Inference breaks the "conjugacy barrier" by providing a flexible, gradient-based approach to posterior approximation. Its ability to handle multimodality and non-conjugate models without extensive manual derivation makes it a powerful tool for modern Bayesian inference. Future work may explore relaxing the isotropic constraint on kernels or learning non-uniform weights to further enhance the method's expressivity.
Summary updated