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 $z$ 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_θ+ d_z$ to just $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-$t$, 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.
翻译:我们提出自动拉普拉斯塌缩采样(ALCS),这是一个利用自动微分实现贝叶斯模型中潜参数边缘化的通用框架。该框架与嵌套采样相结合,以稳健高效的方式探索超参数空间。在每次嵌套采样似然评估中,ALCS通过最大后验(MAP)优化和拉普拉斯近似,基于自动微分将高维潜变量$z$塌缩为标量贡献。此举将有效维度从$d_θ+ d_z$降至仅$d_θ$,使得无需手工推导梯度或海森矩阵且无需大量模型特定工程即可处理高维设置下的贝叶斯证据计算。MAP优化与海森矩阵评估在GPU硬件上针对存活点并行化,使得该方法具备可扩展的实际应用能力。我们进一步证明,自动微分能够实现超越拉普拉斯近似的局部近似方法,例如Student-$t$等参数族,从而改进重尾潜变量的证据估计。我们在涵盖层次模型、时间序列模型和离散似然模型的基准测试集上验证了ALCS,并明确了高斯近似的适用条件。这使我们能够在无需昂贵联合采样的前提下,通过事后ESS诊断定位超参数空间中的失效区域。