Papers
Topics
Authors
Recent
Search
2000 character limit reached

Marginal Neural Ratio Estimation (MNRE)

Updated 10 July 2026
  • Marginal Neural Ratio Estimation (MNRE) is a simulation-based inference technique that directly targets low-dimensional marginal posteriors, bypassing full joint estimation.
  • It trains neural classifiers to estimate likelihood-to-evidence ratios, implicitly marginalizing nuisance parameters and reducing computational cost.
  • Extensions like TMNRE and autoregressive methods improve simulation efficiency and accuracy in high-dimensional scientific applications.

Searching arXiv for recent and foundational papers on Marginal Neural Ratio Estimation to ground the article. Marginal Neural Ratio Estimation (MNRE) is a simulation-based inference technique for Bayesian parameter estimation with intractable likelihoods, designed to learn marginal posteriors for low-dimensional subsets of parameters directly from simulations rather than by first approximating a full joint posterior and then numerically marginalizing nuisance variables. In the standard formulation, a neural network is trained to estimate a likelihood-to-evidence ratio, or equivalently a posterior-to-prior ratio, by distinguishing joint samples from product-of-marginals samples; when the network is fed only a subset of parameters, the resulting ratio is already marginalized over the remaining coordinates (Miller et al., 2020, Rozet et al., 2021, Saxena et al., 2023). This makes MNRE particularly suited to scientific settings in which the parameter space is high-dimensional, the simulator is expensive, and the quantities ultimately reported are one- and two-dimensional marginals rather than the full posterior (Miller et al., 2020, Miller et al., 2021).

1. Conceptual foundations

The canonical setting for MNRE is simulation-based inference with a forward model

θxp(xθ),\theta \mapsto x \sim p(x\mid \theta),

where one can generate synthetic observations but cannot evaluate p(xθ)p(x\mid \theta) analytically or cheaply. In this setting, Bayesian inference still targets p(θxobs)p(\theta\mid x_{\mathrm{obs}}), but the likelihood must be bypassed rather than computed explicitly (Saxena et al., 2023, Abellán et al., 2024).

Within the neural SBI literature, the standard taxonomy distinguishes Neural Posterior Estimation, which models p(θx)p(\theta\mid x) directly; Neural Likelihood Estimation, which models p(xθ)p(x\mid \theta); and Neural Ratio Estimation, which models a likelihood-to-evidence ratio with a classifier (Saxena et al., 2023, Abellán et al., 2024). MNRE belongs to the ratio-estimation family, but differs from full-joint NRE by targeting marginal posteriors over selected parameters θA\theta_A rather than the full parameter vector θ\theta (Miller et al., 2020, Rozet et al., 2021).

This emphasis on marginals is motivated by a recurring scientific pattern. In many physics and astronomy applications, the primary scientific object is not the full high-dimensional posterior, but low-dimensional marginals used for credible intervals, corner plots, and substantive interpretation (Miller et al., 2020). From that perspective, learning the full joint distribution can be both statistically and computationally excessive. A concise characterization given in the arbitrary-subset formulation is that MNRE is standard NRE applied to (x,θA)(x,\theta_A) instead of (x,θ)(x,\theta), with nuisance parameters integrated out implicitly by the simulator (Rozet et al., 2021).

A further extension is arbitrary-subset marginalization. In Arbitrary Marginal Neural Ratio Estimation, a binary mask a{0,1}da\in\{0,1\}^d specifies which coordinates are retained, allowing a single amortized network to provide marginal posteriors over arbitrary subsets without retraining and without numerical integration over complements (Rozet et al., 2021). This suggests a unifying interpretation of MNRE as a family of classifier-based posterior-to-prior estimators indexed by parameter subsets.

2. Mathematical formulation

The basic ratio used throughout MNRE is

p(xθ)p(x\mid \theta)0

Once p(xθ)p(x\mid \theta)1 is known, the posterior follows from

p(xθ)p(x\mid \theta)2

(Saxena et al., 2023, Miller et al., 2020).

Neural ratio estimation obtains this quantity through binary classification. One generates positive samples from the joint distribution,

p(xθ)p(x\mid \theta)3

and negative samples from the product of marginals,

p(xθ)p(x\mid \theta)4

often by shuffling p(xθ)p(x\mid \theta)5 and p(xθ)p(x\mid \theta)6 to destroy their dependence. A neural classifier with output p(xθ)p(x\mid \theta)7 is trained with binary cross-entropy loss; at the optimum,

p(xθ)p(x\mid \theta)8

so the classifier logit approximates p(xθ)p(x\mid \theta)9 (Saxena et al., 2023, Miller et al., 2020).

MNRE replaces p(θxobs)p(\theta\mid x_{\mathrm{obs}})0 by a subset p(θxobs)p(\theta\mid x_{\mathrm{obs}})1. The marginal posterior satisfies

p(θxobs)p(\theta\mid x_{\mathrm{obs}})2

with

p(θxobs)p(\theta\mid x_{\mathrm{obs}})3

The corresponding marginal likelihood-to-evidence ratio is

p(θxobs)p(\theta\mid x_{\mathrm{obs}})4

MNRE trains the same classifier construction on p(θxobs)p(\theta\mid x_{\mathrm{obs}})5, using simulations from the full prior but discarding p(θxobs)p(\theta\mid x_{\mathrm{obs}})6 at the network input. At optimum, the network approximates p(θxobs)p(\theta\mid x_{\mathrm{obs}})7, and the marginal posterior is recovered as

p(θxobs)p(\theta\mid x_{\mathrm{obs}})8

(Saxena et al., 2023, Miller et al., 2020).

In the arbitrary-subset formulation, the subset is encoded by a mask p(θxobs)p(\theta\mid x_{\mathrm{obs}})9, and the classifier is written as p(θx)p(\theta\mid x)0, or equivalently p(θx)p(\theta\mid x)1 to maintain fixed-dimensional inputs. This yields

p(θx)p(\theta\mid x)2

for any non-empty subset specified by p(θx)p(\theta\mid x)3 (Rozet et al., 2021). This construction avoids numerical marginalization over nuisance coordinates entirely.

3. Truncation, nesting, and autoregressive extensions

Truncated Marginal Neural Ratio Estimation (TMNRE) extends MNRE by sequentially restricting the prior support to regions where the posterior for a target observation has non-negligible mass (Miller et al., 2021). Instead of proposing simulations from the full prior in every round, TMNRE defines a truncated prior

p(θx)p(\theta\mid x)4

where p(θx)p(\theta\mid x)5 is chosen from approximate posterior information. In the original truncation scheme, the region is updated by thresholding marginal ratios relative to their maxima with a cutoff p(θx)p(\theta\mid x)6, yielding a nested sequence of constrained supports (Miller et al., 2020, Miller et al., 2021).

A central feature of TMNRE is local amortization. Because the estimator is trained on a truncated prior rather than on a single fixed observation, it remains amortized over observations generated from that region, which in turn makes empirical posterior tests feasible (Miller et al., 2021, Cole et al., 2021). This is presented as a distinctive advantage: TMNRE is simulation efficient and also enables fast empirical posterior testability (Miller et al., 2021).

The swyft line of work adds a second layer of efficiency through simulation reuse. An inhomogeneous Poisson point process cache stores previously simulated parameter points and their outputs, allowing later truncation rounds and even new inference tasks to recycle simulations rather than regenerate them (Miller et al., 2020). In that framework, “nested ratio estimation” is conceptually the same as MNRE, with truncation and caching used to focus simulation effort on plausible regions while retaining all previous simulator calls (Miller et al., 2020).

Recent work generalizes TMNRE beyond axis-aligned truncation. Autoregressive Neural Ratio Estimation factorizes the joint posterior into one-dimensional conditionals and learns the corresponding conditional ratios, thereby addressing correlated high-dimensional posteriors more robustly than a single joint classifier (Montel et al., 2023). The same paper replaces hyper-rectangular truncation by block-wise correlated truncation based on a high-dimensional ratio contour, and introduces a slice-based nested sampling algorithm that can draw both posterior samples and constrained prior samples from the learned ratio estimator (Montel et al., 2023). This suggests a broader evolution of MNRE from direct low-dimensional marginals toward structured high-dimensional ratio models that remain compatible with sequential truncation.

A conceptually distinct but related generalization is “detection is truncation,” where detection itself is interpreted as a truncation in latent source space. In that setting, TMNRE is used to couple source detection, selection functions, and population inference by conditioning simulations on bright-source configurations compatible with the observed data (Montel et al., 2022).

4. Architectures, software, and workflow

MNRE is architecturally flexible. The foundational arbitrary-subset implementation uses fully connected MLPs for toy models and a residual network with 17 residual blocks for gravitational-wave parameter inference (Rozet et al., 2021). In application papers, image-like data are processed with CNN embeddings plus MLP heads for ratio estimation, as in strong-lensing warm-dark-matter inference (Montel et al., 2022) and halo-map reconstruction from p(θx)p(\theta\mid x)7-body simulations (Dimitriou et al., 2022). In supernova analyses, separate per-object embedders and dataset summarizers are used to process irregular collections of light curves before feeding parameter-specific ratio heads (Karchev et al., 2022, Karchev et al., 2024).

The most widely used software framework is swyft, introduced as an open-source implementation of nested neural likelihood-to-evidence ratio estimation together with a Poisson point process cache for simulation reuse (Miller et al., 2020). In swyft, a typical workflow is to define the simulator, specify a factorized prior, choose marginals of interest, configure the number of truncation rounds and samples per round, and train a shared featurizer with separate parameter heads (Miller et al., 2020). The 21-cm reionization analysis explicitly uses swyft’s implementation of truncated MNRE to obtain all one- and two-dimensional marginals from a single simulation set (Saxena et al., 2023).

At the opposite end of the software spectrum, a later 21-cm tutorial presents a beginner-friendly PyTorch pipeline that implements MNRE directly with a simple MLP, plain NumPy/pickle data handling, and binary cross-entropy training, deliberately avoiding specialized SBI frameworks (Sen et al., 8 Sep 2025). This demonstrates that the core method does not depend on a particular software stack: what is essential is the classifier-based approximation of the posterior-to-prior ratio.

5. Scientific applications

MNRE and TMNRE have been deployed across a broad range of astrophysical and cosmological problems, typically in regimes with expensive simulators, many nuisance parameters, and interest in low-dimensional marginals.

Domain Representative paper Reported outcome
21-cm CD/EoR inference (Saxena et al., 2023) Accurate six-parameter posteriors with p(θx)p(\theta\mid x)8 simulations; p(θx)p(\theta\mid x)9 sufficient in convergence tests
CMB and likelihood-free cosmology (Cole et al., 2021) Orders of magnitude fewer simulator calls than conventional MCMC
Stage IV 3×2pt LSS (Abellán et al., 2024) Speedup factor of p(xθ)p(x\mid \theta)0–60 over classical MCMC methods
Strong lensing and WDM (Montel et al., 2022) Expected 95% credible lower limit on p(xθ)p(x\mid \theta)1 around p(xθ)p(x\mid \theta)2 in the scenario closest to CDM
Standard sirens and p(xθ)p(x\mid \theta)3 (Gagnon-Hartman et al., 2023) Corrects for p(xθ)p(x\mid \theta)4 of p(xθ)p(x\mid \theta)5 bias with extensive tiling of the localization region
SN Ia cosmology (Karchev et al., 2022) Unbiased and precise cosmological posteriors for up to 100 000 SNe Ia
Real SN Ia dust inference (Karchev et al., 2024) Implicitly marginalises over 4000 latent variables for p(xθ)p(x\mid \theta)6 SNe Ia

The 21-cm reionization study is a particularly explicit worked example. Using 21cmFAST, a six-dimensional astrophysical parameter vector, and SKA-like thermal noise, the method recovers the posterior distribution at significantly lower computational cost than conventional likelihood-based MCMC and shows a factor of 3–10 improvement in simulation efficiency relative to the comparison baseline (Saxena et al., 2023). The same training dataset is then reused to study redshift dependence and modeling uncertainty without rerunning 21cmFAST (Saxena et al., 2023).

In strong gravitational lensing, TMNRE is used to target the half-mode mass p(xθ)p(x\mid \theta)7 while marginalizing over lens, source, and halo-population uncertainties. There the sequential truncation of nuisance parameters is central: six rounds of p(xθ)p(x\mid \theta)8 simulations per round are used to constrain smooth lens and source parameters before training the final cutoff-mass estimator (Montel et al., 2022). The paper combines multiple images through a product of ratios, underscoring that MNRE-style estimators can be composed across independent datasets (Montel et al., 2022).

Large-scale-structure and CMB applications emphasize nuisance-parameter scalability. In the Stage IV 3×2pt analysis, MNRE is applied to 17- and 19-dimensional cosmological models but reconstructs only one- and two-dimensional marginals, producing posteriors that match Metropolis–Hastings and MultiNest while achieving speedups of p(xθ)p(x\mid \theta)9 in θA\theta_A0CDM and θA\theta_A1 in decaying-dark-matter extensions (Abellán et al., 2024). The earlier CMB-focused TMNRE study similarly reports orders-of-magnitude reductions in simulator calls and stresses that the required number of samples is effectively independent of the number of nuisance parameters (Cole et al., 2021).

Supernova work has pushed the method into fully hierarchical settings. SICRET applies TMNRE to a BAHAMAS-style hierarchical model and verifies unbiased cosmological posteriors for up to 100 000 SNe Ia while also showing that local amortization can be used to convert approximate Bayesian posteriors into exact-coverage frequentist confidence regions (Karchev et al., 2022). SIDE-real then extends the methodology to real low-redshift SN Ia light curves with a hardware-accelerated forward model, inferring population-level dust parameters and individual-object parameters while marginalizing over thousands of latent variables (Karchev et al., 2024).

6. Validation, strengths, and limitations

A recurrent theme in the MNRE literature is that approximate posteriors must be tested, not merely produced. Coverage diagnostics appear in the 21-cm reionization analysis, where empirical coverage for all one- and two-dimensional marginals agrees with nominal levels within uncertainties (Saxena et al., 2023); in the warm-dark-matter lensing analysis, where the expected-coverage curve lies close to the diagonal (Montel et al., 2022); in the Stage IV LSS study, where 500 mock observations are used to verify empirical coverage of θA\theta_A2CDM marginals (Abellán et al., 2024); and in the CMB, supernova, and SIDE-real TMNRE papers, where local amortization is explicitly presented as the mechanism that makes such tests practical (Cole et al., 2021, Karchev et al., 2022, Karchev et al., 2024).

Across these studies, several advantages recur. MNRE directly targets the one- and two-dimensional marginals actually used in scientific interpretation, automatically marginalizes nuisance parameters through simulation, and avoids explicit numerical integration over complements (Miller et al., 2020, Rozet et al., 2021). TMNRE further focuses simulation effort through prior truncation, often yielding order-of-magnitude gains in simulator efficiency while preserving local amortization (Miller et al., 2020, Miller et al., 2021). Reuse of simulations across rounds, across marginals, and in some cases across related inference tasks is a distinctive operational benefit (Miller et al., 2020, Saxena et al., 2023).

The limitations are equally consistent. Results are only as good as the forward model, so semi-numerical or approximate simulators can induce biased posteriors unless model discrepancy is explicitly treated (Saxena et al., 2023, Montel et al., 2022, Abellán et al., 2024). Neural training can produce miscalibrated posteriors if architectures or hyperparameters are poor, which is why coverage tests are repeatedly emphasized (Saxena et al., 2023, Miller et al., 2020). Prior support matters: extrapolation beyond the training prior or into poorly sampled corners is unsafe (Saxena et al., 2023). Truncation itself can bias results if θA\theta_A3 is too aggressive or if strong correlations cause posterior mass to be chopped off, a failure mode discussed explicitly in the original TMNRE work and in the swyft literature (Miller et al., 2021, Miller et al., 2020).

A broader synthesis suggested by these papers is that MNRE is best understood not as a single fixed architecture but as a methodological pattern: direct estimation of marginal posterior-to-prior ratios from simulator output, optionally combined with truncation, caching, autoregressive factorizations, and calibration procedures. In that sense, MNRE has become a general tool for likelihood-free inference whenever the scientifically salient outputs are low-dimensional marginals and the dominant computational burden lies in simulating realistic data rather than evaluating tractable likelihoods (Rozet et al., 2021, Montel et al., 2023, Karchev et al., 2024).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (14)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Marginal Neural Ratio Estimation (MNRE).