Abstract: Simulation-based inference (SBI) often faces challenges when estimating marginal posteriors for arbitrary subsets of parameters. Traditional methods either require expensive numerical integration or training separate models for every parameter combination. This paper introduces Arbitrary Marginal Neural Ratio Estimation (AMNRE), which utilizes a binary masking mechanism during training to enable a single neural network to perform amortized inference on any parameter subset. We demonstrate AMNRE's effectiveness on a complex toy model and a 15-dimensional gravitational wave simulator, achieving results comparable to traditional MCMC methods in a fraction of the time.
Introduction
In fields like astrophysics and epidemiology, researchers rely on stochastic simulators to model complex systems. These simulators are often "likelihood-free," meaning that while data can be generated from them, the mathematical probability of a specific observation—the likelihood—is intractable. This makes Bayesian inference, specifically calculating the posterior distribution $p(\theta|x)$, extremely difficult.
The Marginalization Challenge
A significant hurdle in SBI is marginalization. Scientists rarely require the full high-dimensional posterior; they typically focus on one or two parameters of interest (e.g., the mass of a black hole) while ignoring others. Traditionally, this leaves two suboptimal choices:
- The Integration Trap: Estimating the full high-dimensional posterior and then using expensive numerical integration to marginalize out unwanted dimensions.
- The Combinatorial Explosion: Training a separate neural network for every possible subset of parameters. For a $d$-dimensional space, there are $2^d - 1$ possible subsets, making this approach unfeasible for high-dimensional simulators.
Methodology: Arbitrary Marginal Neural Ratio Estimation
AMNRE builds upon Neural Ratio Estimation (NRE), which frames inference as a classification task. A neural network is trained to distinguish between "real" parameter-observation pairs $(\theta, x)$ and "fake" randomized pairs.
The core innovation of AMNRE is the introduction of a binary mask $a$. During training, the network is fed the data $x$, the mask $a$, and the parameters multiplied by the mask ($\theta \cdot a$). By sampling the mask randomly during training, the network learns to ignore masked parameters (those multiplied by 0) and provide the ratio for any arbitrary combination of parameters.
Because the network learns the ratio $r(\theta_a, x)$, it effectively learns the marginal posterior $p(\theta_a|x)$ for any subspace $\Theta_a$ chosen at inference time. This turns a structural dimensionality problem into a conditioning problem.
Experimental Evaluation
The authors evaluated AMNRE on two distinct benchmarks:
- SLCP (Simple Likelihood Complex Posterior): A 5-dimensional toy simulator designed as a "torture test." Its posterior contains four distinct, symmetric modes that are notoriously difficult for inference algorithms to capture.
- Gravitational Waves (GW): A 15-dimensional simulator of binary black hole mergers. This represents a real-world application where traditional sampling methods, such as Markov Chain Monte Carlo (MCMC), can take days to process a single event.
Key Results
AMNRE demonstrated significant improvements in computational efficiency without sacrificing accuracy. For the Gravitational Wave task, traditional methods (Bilby/dynesty) required approximately 3 days to produce a posterior. In contrast, AMNRE produced all 1-D and 2-D marginal posteriors in roughly 1 second on a single GPU.
On the SLCP model, AMNRE successfully captured the complex four-mode structure, matching ground-truth MCMC results. The method was also applied to the GW150914 event—the first detected gravitational wave—yielding results in close agreement with established astrophysical pipelines.
Limitations and Future Work
While AMNRE offers lightning-fast inference at test time, it requires a substantial "up-front" simulation budget for training (millions of simulations for the GW case). Additionally, the authors noted slight "underconfidence" in certain parameters, where the predicted distributions were broader than the ground truth. Future research may explore weighted masking distributions to prioritize accuracy on specific marginals or increasing network expressiveness to mitigate underconfidence.
Summary updated