cs.LGMar 27, 2026

Automatic Laplace Collapsed Sampling: Scalable Marginalisation of Latent Parameters via Automatic Differentiation

Authors: Toby Lovick, David Yallup, Will Handley

Organizations: Institute of Astronomy, University of Cambridge · Kavli Institute for Cosmology, University of Cambridge · Institute of Astronomy & Kavli Institute for Cosmology, University of Cambridge

Abstract

We present Automatic Laplace Collapsed Sampling (ALCS), a general framework for marginalising latent parameters in Bayesian models using automatic differentiation, which we combine with nested sampling to explore the hyperparameter space in a robust and efficient manner. At each nested sampling likelihood evaluation, ALCS collapses the high-dimensional latent variables zz to a scalar contribution via maximum a posteriori (MAP) optimisation and a Laplace approximation, both computed using autodiff. This reduces the effective dimension from dθ+dzd_θ+ d_z to just dθd_θ, making Bayesian evidence computation tractable for high-dimensional settings without hand-derived gradients or Hessians, and with minimal model-specific engineering. The MAP optimisation and Hessian evaluation are parallelised across live points on GPU-hardware, making the method practical at scale. We also show that automatic differentiation enables local approximations beyond Laplace to parametric families such as the Student-tt, which improves evidence estimates for heavy-tailed latents. We validate ALCS on a suite of benchmarks spanning hierarchical, time-series, and discrete-likelihood models and establish where the Gaussian approximation holds. This enables a post-hoc ESS diagnostic that localises failures across hyperparameter space without expensive joint sampling.

Figures & tables

Appendix figures & tables7 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Corrected Integrated Laplace Approximation for Bayesian Inference in Latent Gaussian Models

    May 19, 2026Jinlin Lai, Charles C. Margossian, Daniel R. SheldonLatent Variable ModelsImportance Sampling

  2. Large-scale Uncertainty Quantification for Latent Variable Models Using Subsampling Markov Chain Monte Carlo

    May 29, 2026Xiaoyu Wang, Jonathan H. HugginsMarkov Chain Monte CarloStochastic Gradient Langevin Dynamics

  3. LazyHMC: Hamiltonian Monte Carlo Simulation for Lazy, Infinite Dimensional Probabilistic Programs

    Aug 9, 2026Maria-Nicoleta Crăciun, C. -H. Luke Ong, Tom Schrijvers +1Markov Chain Monte CarloAutomatic Differentiation