arXiv:2610.18945stat.MLOct 2026

Manuscript Offprint

arXiv:2610.18945

Semi-Amortized Bayesian Inference with Reusable Local Posteriors

Niek Stevenson, Paul-Christian Bürkner, Andrew Heathcote, Stefan T. Radev

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Semi-Amortized Bayesian Inference with Reusable Local Posteriors

Niek Stevenson Paul-Christian Bürkner Andrew Heathcote Stefan T. Radev University of Amsterdam TU Dortmund University University of Amsterdam Rensselaer Polytechnic Institute

Abstract

Amortized Bayesian inference uses simulations to perform Bayesian estimation when likelihoods are expensive or analytically unavailable. However, learning the full joint posterior is challenging in high-dimensional models with complex dependencies. We introduce a semi-amortized method that divides parameters into smaller blocks, and uses conditional independence to identify the information needed to infer each block. We train neural estimators for blocks whose posterior updates are computationally expensive or frequently repeated. Each estimator learns from simulations of the relevant model components to approximate the block’s full conditional posterior, given the relevant observations and the values of the variables on which it depends. A Markov chain then alternates direct draws from these estimators with conventional updates of the remaining variables. Each neural update uses the current conditioning values and requires neither likelihood evaluation nor an acceptance–rejection step. Where the same conditional structure recurs, one estimator can be reused across blocks and datasets, with an output dimension determined by the block rather than the full model. We illustrate the approach in high-dimensional and computationally expensive hierarchical and spatiotemporal models.

1 INTRODUCTION

Figure 1: Comparison of sampling methods for the same graphical model, where shared parameters θc\theta_{c} and θb\theta_{b} govern interconnected local parameters θai\theta_{a_{i}}, each generating observations yiy_{i}. (a) Conventional MCMC updates all parameter blocks in repeated sweeps. (b) Amortized neural posterior estimation (NPE) tries to approximate the full joint posterior directly through a suitable inverse factorization (see text) without resorting to MCMC. (c) Semi-amortized inference (ours) combines conventional MCMC updates of θc\theta_{c} with draws from amortized conditional posteriors for the remaining θ−c\theta_{-c}. Estimator A is shared across the θai\theta_{a_{i}} blocks, while estimator B updates θb\theta_{b}. During each sweep, a conditional update uses the current values of the other blocks.

Neural simulation-based inference (SBI) can learn intractable probability distributions from simulations when likelihoods are expensive or analytically unavailable (Cranmer et al., 2020). In amortized neural posterior estimation (NPE), a conditional density estimator is trained on simulated parameter–data pairs (θ,y)(\theta,y) to approximate the posterior p(θ∣y)p(\theta\mid y). Once trained, it can obtain samples for any new observation y∗y^{*} without retraining, amortizing the cost of repeated inference.

However, amortizing the full posterior becomes challenging as the number of inferred parameters grows and their dependencies become more complex. For example, hierarchical models connect group-specific parameters through population distributions (Gelman et al., 2013), state-space models link latent states over time (Durbin and Koopman, 2012), and spatial models describe dependence across locations (Rue and Held, 2005). Such models can strain amortized methods, as the posterior dimension grows with the number of groups, time points, or locations, while dependencies between parameters must still be represented jointly.

The joint posterior of such models can often be decomposed into inverse factors involving subsets of variables (Stuhlmüller et al., 2013; Webb et al., 2018; Habermann et al., 2026). This decomposition exposes smaller inference problems in which one block of variables is inferred conditional on the others. In a hierarchical model, for example, each group’s parameters can be inferred from its observations conditional on the population parameters. Classical Gibbs sampling exploits this structure by iteratively drawing each parameter block from its full conditional distribution.

Amortized Bayesian inference on structured models also relies on clever factorization. Existing methods assign neural estimators to individual inverse factors so that samples from the joint posterior can be generated by ancestral sampling (Webb et al., 2018; Heinrich et al., 2024; Habermann et al., 2025; Habermann et al., 2026; Arruda et al., 2024). While effective for moderately sized models, full amortization can become extremely costly when the posterior contains thousands or even hundreds of thousands of factors due to simulation and memory costs. Compositional modeling mitigates this problem by combining exchangeable factors at inference (Arruda et al., 2026). However, its accuracy can deteriorate as the number of composed factors grows.

Building on likelihood-free approximate Gibbs sampling (Rodrigues et al., 2020), we instead develop a semi-amortized Bayesian inference (SABI) method that combines neural conditional updates with conventional MCMC steps (Figure 1). Similar to Arruda et al. (2026), our method does not simulate the full graphical model; it requires only identifying which inverse factors are difficult to sample and which admit efficient conventional updates—a distinction that is typically clear from the model structure. In hierarchical models, for example, the challenging step is often sampling group-specific posteriors, whereas the hyperposterior is well identified and easier to sample.

We demonstrate SABI across three realistic applications with complex dependencies and tens of thousands of parameters, where comparisons with reference samplers show close agreement in posterior summaries. In a simulation-based application, SABI outperforms alternative SBI methods; further, it enables reuse of the same trained estimator across different hierarchical structures at scale. Additionally, we provide an initial analysis of the sampler’s stationary accuracy.