Christoph Weniger — University of Amsterdam (GRAPPA)
IAIFI PhD School, 6 August 2026
A learned posterior always returns something. Knowing when to believe it is a separate problem.
Diagnostics > Taxonomy
A taxonomy of epistemic uncertainties in SBI: three failure modes, each with its own diagnostic strategy.
| Category | Type | Description |
|---|---|---|
| Epistemic | Epi-R | Reality Gap "I'm simulating the wrong system" |
| Epi-C | Compression Gap "I'm discarding relevant information" |
|
| Epi-A | Approximation Gap "I can't compute the posterior exactly" |
|
| Aleatoric | Ale | Irreducible randomness in the system and data |
Diagnostics > Failure modes
Approximate posteriors \(q_\phi(\theta \mid x)\) are overdispersed (underdispersed) when they overestimate (underestimate) their coverage of the data-generating parameters (example for Epi-A).
Posteriors that are exact but based on a lossy summary, \(q_\phi(\theta \mid x) = p(\theta \mid T(x))\), are wider and not overdispersed. Their width correctly represents the information loss, and the extra scatter in the posterior position exactly compensates. This is Epi-C.
Diagnostics > Reference posteriors
The most direct question you can ask: does the learned posterior agree with one we already trust?
Reference may be available as unnormalised explicit posterior, through Fisher approximation, or MCMC samples, etc.
Cannon, Ward & Schmon 2022, arXiv:2209.01845 (misspecification and SBI) · review: Cranmer, Brehmer & Louppe 2020, arXiv:1911.01429.
Diagnostics > Reference posteriors
A divergence quantifies the difference between two distributions. They all vanish when \(p = q\), and they weight disagreements very differently.
| Divergence | generator \(f(t)\) |
|---|---|
| KL, \(D_\mathrm{KL}(p\|q)\) | \(t\log t\) |
| Neyman \(\chi^2\) | \((t-1)^2\) |
| Jeffreys, \(D_J(p;q)\) | \((t-1)\log t\) |
| Jensen-Shannon | \(\tfrac{1}{2}\!\left(t\log t - (t{+}1)\log\tfrac{t+1}{2}\right)\) |
| Total variation | \(\tfrac{1}{2}|t-1|\) |
Values are rescaled by \(f''(1)\) so that a shifted posterior gives comparable numbers, and ordered by sensitivity to unmodelled modes.
Diagnostics > Reference posteriors
Diagnostics > Forward-backward
If no trustworthy reference posterior exists, one can use self-consistency checks: comparing joint samples from the backward model and the forward model.
If \(q_\phi(\boldsymbol\theta\mid\mathbf{x}) = p(\boldsymbol\theta\mid\mathbf{x})\) the two joint distributions coincide exactly. Conversely, any discrepancy is a clear indicator of inference error.
Talts et al. 2018 (SBC), arXiv:1804.06788 · Cook, Gelman & Rubin 2006, JCGS 15, 675 · Modrák et al. 2023 (what the histogram can and cannot see), arXiv:2211.02383.
Diagnostics > Forward-backward · SBC
Algorithm:
"Prior, then simulator" is the same thing as "\(x\sim p(x)\), then \(\theta^*\sim p(\theta\mid x)\)". Under \(q_\phi = p\) all \(L+1\) rank positions are equally likely, so the histogram is flat.
Simulator \(\theta\sim\mathcal{U}(-1,1)\), \(x\mid\theta\sim\mathcal{N}(\theta,\sigma^2)\) with \(\sigma = 0.1\); learned posterior \(q_\phi(\theta\mid x) = \mathcal{N}(\theta;\, x+b,\, (s\sigma)^2)\). Red × is \(\theta^*\); orange dots are the \(q\)-samples whose rank we record.
Diagnostics > Forward-backward · Coverage
Algorithm:
Only step 4 differs from SBC: rank by density \(q_i \equiv q_\phi(\theta_i\mid x)\), not by value. Flat now means correct highest-posterior-density coverage.
The dots now sit on the orange curve at their density height, and horizontal lines carry those heights to the axis. The red line marks \(q_\phi(\theta^*\mid x)\); the rank counts the orange lines above it.
The expected-coverage test and the "conservative vs overconfident" reading: Hermans et al. 2021, arXiv:2110.06581.
Diagnostics > Failure modes
A flat rank histogram is necessary, not sufficient. Three distinct failures survive it, and each has a different fix.
Diagnostics > Failure modes
Each tests probes the contained mass of superlevel sets defined by the ordering function. Tests are blind to mass transport along the fibers of the ordering function.
\(^\ast\)Construct \(q(\theta) = g(|\theta - \theta_0|)\) so that every symmetric interval around \(\theta_0\) carries exactly the true posterior mass. Then the HPDR pp-plot is diagonal by construction, no matter how distorted the shape becomes.
Diagnostics > Failure modes
Algorithm:
Two observations, so \(p(\theta\mid x_1,x_2)=\mathcal{N}\bigl(\tfrac{x_1+x_2}{2},\tfrac{\sigma^2}{2}\bigr)\). Both \(q\) are wider than that. Only an ordering that reads the full data sees the lossy one.
Overdispersed (width \(s\,\sigma/\sqrt2\)): every ordering sees it. Lossy (exact given \(x_1\) alone): only \(p(x\mid\theta)\) sees it.
Diagnostics > Generalization
All forward-backward tests share a structure: choose an ordering function \(f(\boldsymbol\theta, x)\) and rank \(\theta^*\) among the \(\theta_{1:L}\) under that ordering.
| Method | Ranks by | Tests Epi-C | Ordering \(f(\boldsymbol\theta, x)\) |
|---|---|---|---|
| SBC | parameter (\(d\) tests) | No | \(\theta_i\) for \(i=1,\ldots,d\) |
| HPDR coverage | learned posterior | No | \(q_\phi(\boldsymbol\theta\mid x)\) |
| TARP | distance to reference | No/Yes | \(\|\boldsymbol\theta - \boldsymbol\theta'\|^2\) |
| Likelihood ranks | likelihood | Yes | \(p(x\mid\boldsymbol\theta)\) |
| True HPDR | true posterior | Yes | \(\pi(\boldsymbol\theta\mid x) \propto p(x\mid\boldsymbol\theta)p(\boldsymbol\theta)\) |
Lemos et al. 2023 (TARP), arXiv:2302.03026 · Modrák et al. 2023 (the choice of test quantity shapes sensitivity), arXiv:2211.02383.
Diagnostics > Misspecification
Two separable questions about the simulator, joined by a named deviation of amplitude \(\eta\).
\(p(\mathbf{x}\mid\boldsymbol\theta)\) — baseline simulator.
\(p_\eta(\mathbf{x}\mid\boldsymbol\theta)\) — augmented simulator: consider one named deviation, amplitude \(\eta\), with \(p_{\eta=0} = p\).
\(p^*(\mathbf{x}\mid\boldsymbol\theta)\) — the real data generating process; typically never sampled.
"Is there an indication of a deviation?"
|
Step 1 ↓ Step 2 → |
inference insensitive | inference sensitive |
|---|---|---|
| no deviation found | fine, and you can say why | the dangerous cell |
| deviation found | model wrong, but it doesn't matter | fix the simulator |
Some literature on misspecification in SBI: Cannon, Ward & Schmon 2022, arXiv:2209.01845 · Ward et al. 2022 (robust SBI), arXiv:2209.11057 · posterior predictive checks: Gelman, Meng & Stern 1996, Statist. Sinica 6, 733.
Diagnostics > Misspecification
SBI enables the massively parallelize hypothesis testing to search for localized or aggregated devitations in data.
Noemi Anau Montel (MPA) · Anau Montel, Alvey & Weniger 2024, arXiv:2412.15100
Amortisation is a luxury. When you only have one observation, stop paying for it.
Sequential methods > SNPE
Amortised NPE spends its whole simulation budget covering the prior, so that any observation can be answered. If there is only one \(\mathbf{x}_\mathrm{obs}\), almost all of that budget is spent on data you will never see.
Strategy
Papamakarios & Murray 2016, arXiv:1605.06376 · Lueckmann et al. 2017, arXiv:1711.01861 · Greenberg, Nonnenmacher & Macke 2019, arXiv:1905.07488 · Deistler, Goncalves & Macke 2022, arXiv:2210.04815.
Sequential methods > The proposal problem
Train on pairs drawn from \(\tilde p(\boldsymbol\theta)\,p(\mathbf{x}\mid\boldsymbol\theta)\) and the NLL minimiser is not the posterior any more. It is the proposal posterior:
Four families of fixes, and they differ mainly in where the correction is applied.
Papamakarios & Murray 2016 (A), arXiv:1605.06376 · Lueckmann et al. 2017 (B), arXiv:1711.01861 · Greenberg et al. 2019 (C / APT), arXiv:1905.07488 · Miller et al. 2021 (truncated marginal), arXiv:2107.01214 · Deistler et al. 2022 (truncated SNPE), arXiv:2210.04815.
Sequential methods > Prior independence
The correction problem exists only because NPE learns \(q_\phi(\boldsymbol\theta\mid\mathbf{x})\), an object that contains the prior. Target something that does not, and sequential training needs no correction whatsoever.
The likelihood \(p(\mathbf{x}\mid\boldsymbol\theta)\) is a property of the simulator alone. Where you choose to draw the \(\boldsymbol\theta\) changes only which region gets fitted well, never what the correct answer is.
Sample the posterior at the end with MCMC on \(q_\phi \, p(\boldsymbol\theta)\), using the real prior.
The likelihood-to-evidence ratio is likewise prior-free. Train the classifier on proposal-drawn pairs, then apply the ratio to whichever prior you actually want:
Combined with truncation this is TMNRE: cut the prior box round by round, train marginals directly, no reweighting anywhere.
Papamakarios, Sterratt & Murray 2019 (SNL), arXiv:1805.07226 · Hermans, Begy & Louppe 2020 (SNRE), arXiv:1903.04057 · Miller et al. 2021 (TMNRE), arXiv:2107.01214.
Sequential methods > Truncation
Fixed budget of 400 simulations per round, drawn from the prior restricted to the current box — the proposal is a cut, not a fitted density. Learn \(q_\phi(\boldsymbol\theta\mid\mathbf{x}_\mathrm{obs})\), truncate to its \(3\sigma\) marginals, repeat.
| round | 1 |
| box (θ₁ × θ₂) | 12.0 × 12.0 |
| volume vs prior | 1 |
| sample spacing Δ | 0.54 |
| Δ / σpost | 3.1 |
The prior box is far wider than the posterior: almost every simulation lands where \(\mathbf{x}_\mathrm{obs}\) could never have come from.
Truncation stalls at the information floor — the exact posterior's own \(3\sigma\) width, set by the measurement noise. There \(\Delta\) has dropped below \(\sigma_\mathrm{post}\) and the surviving models differ by less than that noise. There is nothing left to cut.
Illustration only: \(q_\phi\) here is the exact posterior blurred by the sample spacing \(\Delta\propto\sqrt{V_\mathrm{box}/N}\), standing in for a network that cannot resolve structure finer than the gaps between its training points. No network is trained.
Miller et al. 2021 (TMNRE), arXiv:2107.01214 · Deistler, Goncalves & Macke 2022 (truncated SNPE), arXiv:2210.04815.
Sequential methods > EMRIs
Top left: the 3-D panel of figure 1 of Berry et al. 2019. Below: figure 3 of Cole et al. 2026, its 11 panels re-tiled 6×2 here.
Cole et al. 2026 (sequential SBI for EMRIs), Phys. Rev. D 113, 063030, arXiv:2505.16795 · Berry et al. 2019 (the EMRI science case), arXiv:1903.03686.
Tackling complex analysis problems: many sources, many parameters, one continuous inference.
Falcon > Motivation
Gamma-ray astronomy
Cosmology
Supernova cosmology
Falcon > Architecture
Complex models defined declaratively, in YAML config files.
Every component becomes its own Ray actor, spread over whatever hardware there is.
All simulation data goes into one central, shared store.
The store feeds inference actors that learn the posteriors — and steer which simulations run next.
Falcon > Dynamic SBI
10D benchmark: loss vs. wall clock
same run: which simulations sit in the training set, over time
strong lensing, 14 parameters — Dynamic SBI (pink) vs. likelihood-based reference (blue)
Lyu et al. 2025 (Dynamic SBI), arXiv:2510.13997 — left: 10D benchmark (Fig. 3); right: strong lensing (Fig. 5).
Falcon > Status
click to replay
The animation is this example's own run. Two independent latent components — a snake and the FALCON letters — each rendered, then composited into one noisy image. Both inference actors see only \(x\), and each steers what its own branch simulates next — the round-by-round contraction the animation shows. github.com/cweniger/falcon → examples/03_composite
Falcon > LISA
LDC1-1, sequential SBI started from the full LDC prior: all-sky, ±half a day in \(t_c\), signed spins. No narrowed prior, no template bank.
training buffer, round by round
final posterior (red = injected truth)
83 rounds · 1.30M waveforms · 1 h 57 m on one GPU · 8 of 9 parameters within 1σ
H. Lyu et al., in prep. — LISA global-fit effort
Falcon > Open questions