[Paper Review] Hamiltonian Monte Carlo using an adjoint-differentiated Laplace approximation: Bayesian inference for latent Gaussian models and beyond
This paper proposes an adjoint-differentiated Laplace approximation for scalable Bayesian inference in latent Gaussian models, enabling efficient Hamiltonian Monte Carlo (HMC) sampling by marginalizing out latent Gaussian variables. The method achieves orders-of-magnitude speedup in gradient computation for high-dimensional hyperparameters, outperforming standard techniques and enabling robust inference in complex models like sparse kernel interaction models with ~6,000 hyperparameters.
Gaussian latent variable models are a key class of Bayesian hierarchical models with applications in many fields. Performing Bayesian inference on such models can be challenging as Markov chain Monte Carlo algorithms struggle with the geometry of the resulting posterior distribution and can be prohibitively slow. An alternative is to use a Laplace approximation to marginalize out the latent Gaussian variables and then integrate out the remaining hyperparameters using dynamic Hamiltonian Monte Carlo, a gradient-based Markov chain Monte Carlo sampler. To implement this scheme efficiently, we derive a novel adjoint method that propagates the minimal information needed to construct the gradient of the approximate marginal likelihood. This strategy yields a scalable differentiation method that is orders of magnitude faster than state of the art differentiation techniques when the hyperparameters are high dimensional. We prototype the method in the probabilistic programming framework Stan and test the utility of the embedded Laplace approximation on several models, including one where the dimension of the hyperparameter is $\sim$6,000. Depending on the cases, the benefits can include an alleviation of the geometric pathologies that frustrate Hamiltonian Monte Carlo and a dramatic speed-up.
Motivation & Objective
- To address the computational bottleneck in Bayesian inference for latent Gaussian models, where HMC struggles due to complex posterior geometry.
- To enable efficient gradient computation of the marginal likelihood when hyperparameters are high-dimensional, a key challenge in scalable MCMC.
- To develop a differentiable Laplace approximation that integrates seamlessly with dynamic HMC in probabilistic programming frameworks like Stan.
- To demonstrate the method’s utility on high-dimensional models, including sparse kernel interaction models with ~6,000 hyperparameters.
- To overcome limitations of variational inference in multimodal posteriors by combining marginalization with gradient-based sampling.
Proposed method
- The method uses a Laplace approximation to analytically marginalize out the latent Gaussian variables θ, reducing the posterior to depend only on hyperparameters φ.
- It introduces a novel adjoint-differentiation technique that propagates only the minimal information needed to compute gradients of the approximate marginal likelihood.
- The adjoint method computes gradients of the marginal log-likelihood with respect to φ in O(1) operations per hyperparameter, scaling efficiently with dimension.
- The approach is integrated into Stan’s HMC framework, leveraging automatic differentiation and dynamic adaptation for robust sampling.
- The method is validated on models with up to ~6,000 hyperparameters, including sparse kernel interaction models and hierarchical regression with horseshoe priors.
- The Laplace approximation is embedded within HMC, allowing efficient exploration of the hyperparameter space while avoiding the geometric pathologies of full joint sampling.
Experimental results
Research questions
- RQ1Can an adjoint-differentiated Laplace approximation significantly reduce the computational cost of gradient computation in high-dimensional latent Gaussian models?
- RQ2Does the proposed method improve the mixing and convergence of HMC in models with complex posterior geometry due to latent Gaussian variables?
- RQ3Can the method handle multimodal posteriors for hyperparameters, especially when energy barriers between modes are moderate?
- RQ4How does the performance of the embedded Laplace approximation compare to full HMC and variational inference in terms of accuracy and computational efficiency?
- RQ5To what extent does the adjoint method scale with increasing hyperparameter dimension, particularly in models like sparse kernel interaction models?
Key findings
- The adjoint-differentiated Laplace approximation reduces gradient computation time by orders of magnitude compared to standard techniques when hyperparameters are high-dimensional.
- On a sparse kernel interaction model with ~6,000 hyperparameters, the method enabled successful HMC sampling with 0 divergent transitions, while full HMC failed due to tuning instability.
- The method achieved a 100x speedup in differentiation time compared to the Rasmussen and Williams algorithm on high-dimensional problems, as shown in Figure 1.
- The embedded Laplace approximation produced results consistent with full HMC on a regularized horseshoe model, while ADVI failed to capture the correct mode of the posterior.
- In multimodal posteriors, the method successfully explored multiple modes, unlike ADVI, which collapsed to a single mode.
- The approach enabled stable HMC sampling with dynamic adaptation, avoiding the need for manual tuning and reducing divergent transitions compared to standard HMC.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.