PriorGuide: Test-Time Prior Adaptation for Simulation-Based Inference

Yang Yang, Severi Rissanen, Paul E. Chang, Nasrulloh Loka, Daolang Huang, Arno Solin, Markus Heinonen, Luigi Acerbi

TL;DR

PriorGuide introduces a novel method to adapt pre-trained, diffusion-based amortized simulation-based inference (SBI) models to new prior distributions at test time without retraining. By treating the new prior as a guidance term during the diffusion sampling process, it enables flexible integration of domain knowledge and rapid prior sensitivity analysis.

What Problem Does This Paper Address?

Simulation-Based Inference (SBI) is essential for scientific fields where evaluating the likelihood function of a complex system is impossible, but running forward simulations is easy. Modern "amortized" SBI methods use deep generative models (like diffusion models) to learn a direct mapping from observed data to parameter posteriors.

However, these models are traditionally locked into the fixed prior distribution used during their massive training phase. If a practitioner wants to test a new prior—either to inject expert domain knowledge or to perform a prior sensitivity analysis—they face a difficult choice: endure the massive computational cost of retraining the amortized model from scratch, or rely on restrictive, pre-defined "meta-priors" that only support simple, factorized distributions. PriorGuide addresses this limitation by enabling on-the-fly prior adaptation purely at inference time.

Conceptual overview of PriorGuide adapting a diffusion model to new prior information at test time.

Methods

PriorGuide modifies the score function during the reverse diffusion sampling process. It introduces a guidance term based on the prior ratio:

$$r(\theta) = \frac{q(\theta)}{p_{\text{train}}(\theta)}$$

where $q(\theta)$ is the new target prior and $p_{\text{train}}(\theta)$ is the original training prior.

To evaluate how this prior ratio propagates through the diffusion timesteps without resorting to slow, high-variance Monte Carlo estimations, the authors introduce two key approximations:

  1. Reverse Transition Kernel Approximation: They model the reverse transition kernel as a multivariate Gaussian distribution, deriving its mean via Tweedie's formula.
  2. Prior Ratio Approximation: They approximate the prior ratio function $r(\theta)$ as a generalized Gaussian Mixture Model (GMM).

Combining these two approximations yields a closed-form, analytical solution for the guidance term. To ensure exactness at low noise levels, the authors also integrate interleaved Langevin dynamics steps into the sampling process, allowing users to directly trade additional test-time compute for higher inference fidelity.

Datasets

The authors evaluated PriorGuide across six standard and complex SBI benchmark problems:

  • Two Moons: A standard 2D benchmark displaying a bimodal, crescent-shaped posterior geometry.
  • Ornstein-Uhlenbeck Process (OUP): A time-series model frequently applied in financial mathematics and evolutionary biology.
  • Turin Model: A highly challenging, high-dimensional time-series model used for simulating radio wave propagation.
  • Gaussian Linear (10D & 20D): Standard benchmarks used to infer the mean of multivariate Gaussian distributions.
  • Bayesian Causal Inference (BCI): A 5D parameter model from computational cognitive neuroscience simulating audiovisual localization tasks.

Key Insights and Ideas

  • Decoupling Simulator Training from Prior Choice: PriorGuide shifts the burden of prior selection from training time to test time. This paves the way for true "foundation models" in SBI that can be trained once on a broad prior and specialized later by different researchers.
  • The GMM Ratio Trick: Instead of trying to fit a complex target distribution directly, fitting the ratio of the new and old priors as a GMM provides an elegant, analytical workaround to an otherwise intractable integration problem.
  • Compute-for-Accuracy Trade-off: Unlike fully amortized methods that provide a fixed-quality answer instantly, PriorGuide allows users to systematically improve posterior accuracy by allocating more test-time compute budget (via more diffusion or Langevin steps).

Key Results

PriorGuide significantly improves inference accuracy over base models that lack prior adaptation, and it consistently outperforms existing meta-prior methods like the Amortized Conditioning Engine (ACE), which cannot handle correlated or non-factorized priors.

For computationally expensive simulators like the Turin model, PriorGuide delivers a greater than 10x speedup compared to retraining the base model from scratch, while accurately recovering both posterior and posterior-predictive distributions.

Example posterior predictive distributions for OUP and Turin models under strong priors, showing PriorGuide closely matching the true data.

Limitations and Future Work

The primary limitation of PriorGuide is its reliance on prior coverage: the new target prior $q(\theta)$ must have substantial overlap with the original training prior $p_{\text{train}}(\theta)$. If the target prior places significant mass in out-of-distribution (OOD) regions where the base model was poorly trained, the guidance can become unstable.

Additionally, the guidance calculations involve matrix operations for the GMM components that scale poorly to extremely high-dimensional parameter spaces ($\text{dim}(\theta) \gg 20$). The authors suggest that exploring advanced covariance approximation techniques is a promising direction to speed up the method and reduce the number of required function evaluations.

Summary updated

BibTeX
@inproceedings{yang2026priorguide,
  author = {Yang Yang and Severi Rissanen and Paul E. Chang and Nasrulloh Loka and Daolang Huang and Arno Solin and Markus Heinonen and Luigi Acerbi},
  title = {{PriorGuide: Test-Time Prior Adaptation for Simulation-Based Inference}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=G4I23g5Ugh},
}
Figure