text
stringlengths
128
2.05k
the natural transformation [MATH] is given by the [MATH] -folding functor [MATH] Proof. First we show that the functor [MATH] is well-defined. Condition (ii) in the definition of [MATH] requires the following things for a morphism [MATH] to be in [MATH]
[MATH] is in [MATH] , and in particular it is monoidal; [MATH] and [MATH] are actions of the same [MATH] , and the functor [MATH] is [MATH] -equivariant: [MATH]
[MATH] respects the multi-environment structure: [MATH] By monoidality and [MATH] -equivariance, we must have that [MATH] on objects and [MATH] on morphisms, so [MATH] restricts to a well-defined monoidal functor [MATH] . Respect of the multi-environment structure implies that [MATH] further extends to a well-defined m...
We now show that the natural transformation [MATH] is well-defined. We know that [MATH] is a morphism in [MATH] , as part of condition (i) in the definition of [MATH] , so all we need to show is that the functors [MATH] and [MATH] satisfy:
[EQUATION] for every morphism [MATH] in [MATH] . Note that on the LHS of the equation we are using [MATH] , while on the RHS of the equation we are using [MATH] . The equation above then holds as a consequence of monoidality, [MATH] -equivariance and respect of multi-environment structure on part of [MATH]
Proof. There are a number of claims to check: we need to show that the action on morphisms is well-defined, we need to show that the monad laws hold, and we need to show that the algebra laws hold.
Given a morphism [MATH] of [MATH] , we need to check that the following gives a well-defined functor [MATH] [EQUATION] Firstly, we need to check that [MATH] is an object of [MATH] whenever [MATH] is an object of [MATH] . Because [MATH] is a functor, [MATH] is necessarily in [MATH] and the morphisms [MATH] define an act...
[EQUATION] Secondly, we need to check that [MATH] provides a well-defined action of the functor [MATH] on morphisms [MATH] . The [MATH] -equivariance requirement on [MATH] follows from functoriality:
[EQUATION] Respect of the multi-environment structure follows form naturality of [MATH] [EQUATION] Finally, we need to check that [MATH] provides a suitable natural transformation. But this is obvious.
Having shown that [MATH] is an endofunctor, we move on to establishing that axioms for a monad are satisfied by the given multiplication [MATH] and unit [MATH] . In fact, we don’t have to do any work here: all necessary commuting diagrams follows from associativity and unitality of the monoids [MATH] formed by the grou...
The only thing remaining to be shown is that [MATH] is an Eilenberg-Moore algebra for the monad [MATH] , whenever [MATH] is a sub-category of [MATH] : the actual definition of the monoid operations [MATH] on group actions and multi-environment structures comes into play here.
We begin by checking the triangle law for algebras. Recall that the unit for group actions is defined by the trivial action [MATH] given by the identity automorphism, and that the unit for multi- environment structures is defined by:
[EQUATION] The category [MATH] is simply [MATH] , and we have [MATH] on functors [MATH] , so the triangle law [MATH] is satisfied as desired.
Recall now that the product [MATH] between commuting actions [MATH] and [MATH] is defined by: [EQUATION] Also recall that the product [MATH] between multi-environment structures is defined by:
[EQUATION] where we have taken [MATH] and [MATH] . We make the following observations: by construction, the product [MATH] yields the same folding as [MATH] followed by [MATH]
[EQUATION] by construction, the product [MATH] is [EQUATION] The former are the effects [MATH] after [MATH] -folding, while the latter are the effects [MATH] to which the natural transformation [MATH] has been applied as part of the action of the monad [MATH]
This means that the iterated construction [EQUATION] results in the same exact sub-category of [MATH] as the one-shot construction
[EQUATION] Similar considerations can be made on the action of the [MATH] construction on morphisms, showing that the square law [MATH] is satisfied, as desired.
Lemma 13 The full subcategory of the Karoubi envelope for [MATH] spanned by objects in the form [MATH] is isomorphic to [MATH] , i.e. it behaves as the category of [MATH] -probabilistic classical systems. As a consequence, the full sub-SMC of the Karoubi envelope spanned by objects in the form [MATH] —the “quantum” sys...
Proof. The proof is entirely straightforward, analogous to the proof given in for the second-order case of “conjugation” in involutive semirings.
# Source: arxiv 1805.12244 # Title: Mining gold from implicit models to improve likelihood-free inference # Sections: all # Downloaded: 2026-03-03T05:16:48.079802+00:00
Mining gold from implicit models to improve likelihood-free inference Abstract Simulators often provide the best description of real-world phenomena. However, the density they implicitly define is often intractable, leading to challenging inverse problems for inference. Recently, a number of techniques have been introd...
Introduction In many areas of science, complicated real-world phenomena are best described through computer simulations. Typically, the simulators implement a stochastic generative process in the “forward” mode based on a well-motivated mechanistic model with parameters [MATH] . While the simulators can generate sample...
and neural density estimation ( NDE ) techniques . While many of these techniques can be exact in the limit of infinite training samples, real-world simulators are computationally expensive, and sample efficiency is immensely important.
We present a suite of new techniques that can dramatically improve the sample efficiency for training neural network surrogates that estimate the likelihood
[MATH] or likelihood ratio [MATH] . This provides the key quantity needed for both frequentist and Bayesian inference procedures. Our approach involves extracting additional information that characterizes the latent process from the simulator, as we explain in Sec. . In Sec. we introduce the loss functions that utilize...
Related work Techniques for likelihood-free inference can be divided into two broad categories. In the first category, the inference is performed by directly comparing the observed data to the output of the simulator. This includes Approximate Bayesian Computation ( ABC
and probabilistic programming systems . Here we focus on a second category, in which the simulator is used to generate training data for a tractable surrogate model that is used during inference. There are rich connections between simulator-based inference and learning in implicit generative models such as GANs, with a...
The likelihood ratio trick ( LRT ). A surrogate model for the likelihood ratio [MATH] can be defined by training a probabilistic classifier to discriminate between two equal-sized samples [MATH] and [MATH] . The binary cross-entropy loss
[EQUATION] is minimized by the optimal decision function [MATH] . Inverting this relation, the likelihood ratio can be estimated from the classifier decision function
[MATH] as [MATH] . This “likelihood ratio trick” is widely appreciated . In practice, not all probabilistic classifiers trained to separate samples from [MATH] and [MATH] learn the optimal decision function. As long as the classifier decision function is a monotonic function of the likelihood ratio, this relation can b...
. We use the term Carl alibrated pproximate atios of ikelihoods) to describe likelihood ratio estimators based on calibrated classifiers.
Neural density estimation ( NDE ). More recently, several methods for conditional density estimation have been proposed, often based on neural networks
. They can be used to train a surrogate for the likelihood [MATH] or, in a Bayesian setting, the posterior [MATH] One particularly interesting class of models are normalizing flows
which model the density as a sequence of invertible transformations applied to a simple base density. The target density is then given by the Jacobian determinant of the transformation. Closely related, autoregressive models
factorize a target density as a sequence of simpler conditional densities. Novel contributions. The most important novel contribution that differentiates our work from the existing methods is the observation that additional information can be extracted from the simulator, and the development of loss functions that allo...
Concurrently, the application of these methods to a specific class of problems in particle physics has been discussed in Refs. . The present manuscript is meant to serve as the primary reference for these new techniques and is addressed to the broader physical science and machine learning communities. Most importantly,...
Extracting more information from the simulator We consider a scientific simulator that implements a stochastic generative process that proceeds through a series of latent states [MATH]
and finally to an output [MATH] . The latent space structure [MATH] can involve discrete and continuous components and is derived from the control flow of the (differentiable or non-differentiable) simulation code. Based on the mechanistic model implemented by the simulator, each latent state is sampled from a conditio...
[EQUATION] Often the likelihood is intractable exactly because the latent space [MATH] is enormous and it is unfeasible to explicitly calculate this integral. In real-world scientific simulators, the trajectory for a single observation can involve many millions of latent variables.
In this paper we consider the problem of estimating the likelihood [MATH] or the likelihood ratio [MATH] , which for the practical purpose of inferring parameter values [MATH] can be used almost interchangably, based on the data available from [MATH] runs of the simulator.
Typically, the setting of likelihood-free inference assumes that the only available output from the simulator are samples of observations [MATH] . But in real-life simulators, more information can usually be extracted. We typically have access to the latent variables [MATH] , and the distributions of each latent variab...
[MATH] are tractable. The key observation that is the starting point of our new inference methods is the following: While [MATH] is intractable, for each simulated sample we can calculate the joint score
[EQUATION] by accumulating the factors [MATH] as the simulation runs forward through its control flow conditioned on the random trajectory [MATH] . It can be insightful to think of the mechanistic model in the simulator as defining a policy [MATH] and [MATH] as analogous to the policy gradient used in Reinforce
. However, instead of trying to optimize [MATH] via a stochastic gradient estimate of some reward function, we will simply augment the data joint score.
Similarly, we can extract the joint likelihood ratio [EQUATION] The joint score and joint likelihood ratio quantify how much more or less likely a particular simulated trajectory through the simulator would be if one changed
[MATH] As a motivating example, consider the simulation for a generalization of the Galton board, in which a set of balls is dropped through a lattice of nails ending in one of several bins denoted by [MATH] . The Galton board is commonly used to demonstrate the central limit theorem, and if the nails are uniformly pla...
Figure shows that a large number of samples from the simulator are needed to reveal the differences in the distribution of [MATH] for small changes in [MATH] – the number of samples needed grows like [MATH] Moreover, this toy simulation is representative of many real-world simulators in that it is composed of non-diffe...
and [MATH] inapplicable, which previously motivated techniques such as Adversarial Variational Optimization . But the joint score in Eq. ( ) can easily be computed by accumulating the factors [MATH] , and we can calculate the joint likelihood ratio by accumulating factors [MATH] . In analogy to the Galton board toy exa...
For simulators written in an automatic differentiation framework, the calculation of the joint score and joint likelihood ratio can be entirely automatic and does not require any changes to the simulator code and output. As a proof of principle, at Ref.
we provide a framework that automates these calculations for any simulator in which all stochastic steps are implemented with the Pyro
library Learning from augmented data 4.1 Key idea How can the “augmented data” consisting of simulated observations [MATH] , the joint likelihood ratio [MATH] , and the joint score
[MATH] be used to estimate the likelihood [MATH] or likelihood ratio [MATH] ? The relation between [MATH] and [MATH] is not trivial — the integral of the ratio is not the ratio of the integrals! Similarly, how can the joint score be used to estimate the intractable score function
[EQUATION] The integral of the log is not the log of the integral! Consider the squared error of a function [MATH] that only depends on the observable [MATH] , but is trying to approximate a function [MATH] that also depends on the latent variable [MATH]
[EQUATION] The minimum-mean-squared-error prediction of [MATH] is given by the conditional expectation [MATH] Identifying [MATH] with the joint likelihood ratio [MATH] and [MATH] , we define
[EQUATION] and find that this functional is minimized by [MATH] . Similarly, by identifying [MATH] with the joint score [MATH] and setting [MATH] , we define
[EQUATION] which is minimized by [MATH] These loss functionals are immensely useful because they allow us to transform [MATH] into [MATH] and [MATH] into
[MATH] : we are able to regress on these two intractable quantities! This is what makes the joint score and joint likelihood ratio the gold worth mining.
4.2 Learning the likelihood ratio Based on this observation we introduce a family of new likelihood-free inference techniques. They fall into two categories. We first discuss a class of algorithms that uses the augmented data to learn a surrogate model for any likelihood [MATH] or likelihood ratio [MATH] . In Section 4...
The simulators we consider in this work do not only implicitly define a single density [MATH] , but a family of densities [MATH] . The parameters [MATH]
may potentially belong to a high-dimensional parameter space. For inference models based on surrogate models, there are two broad strategies to model this dependence. The first is to estimate [MATH] or the likelihood ratio
[MATH] for specific values of [MATH] or pairs [MATH] . This may be done via a pre-defined set of [MATH] values or on-demand using an active-learning iteration. We follow a second approach, in which we train parameterized estimators for the full model [MATH] or [MATH] as a function of both the observables [MATH] and the...
. The training data then consists of a number of samples, each generated with different values of [MATH] and [MATH] , and the parameter values are used as additional inputs to the surrogate model. When modeling the likelihood ratio, the reference hypothesis [MATH] in the denominator of the likelihood ratio can be kept ...
Rolr (Regression On Likelihood Ratio): First, a number of parameter points [MATH] is drawn from [MATH] . For each pair [MATH] , we run the simulator both for [MATH] and for [MATH] , labelling the samples with
[MATH] and [MATH] , respectively. In addition to samples [MATH] we also extract the joint likelihood ratio [MATH] An expressive regressor [MATH] (e. g. a neural network) is trained by minimizing the squared error loss
[EQUATION] Here and in the following the [MATH] dependence is implicit to reduce the notational clutter. Both terms in this loss function are estimators of Eq. ( ) (in the second term we switch [MATH] to reduce the variance by mapping out other regions of
[MATH] space). As we showed in the previous section, this loss function is, at least in the limit of infinite data, minimized by the true likelihood ratio [MATH] . A regressor trained in this way thus provides an estimator for the likelihood ratio and can be used for frequentist or Bayesian inference methods.
Rascal (Ratio And SCore Approximate Likelihood ratio): If such a likelihood ratio regressor is differentiable (as is the case for neural networks) with respect to [MATH] , we can calculate the predicted score
[MATH] . For a perfect likelihood ratio estimator, [MATH] minimizes the squared error with respect to the joint score, see Eq. ( ). Turning this argument around, we can improve the training of a likelihood ratio estimator by minimizing the combined ratio and score loss with a hyper-parameter
[MATH] [EQUATION] Cascal Carl And SCore Approximate Likelihood ratio): The same trick can be used to improve the likelihood ratio trick and the Carl inference method
. Following the discussion around Eq. ( ), a calibrated classifier trained to discriminate samples [MATH] and [MATH] provides a likelihood ratio estimator. For a differentiable parameterized classifier, we can calculate the surrogate score [MATH] . This allows us to train an improved classifier (and thus a likelihood r...
[EQUATION] Scandal (SCore-Augmented Neural Density Approximates Likelihood): Finally, we can use the same strategy to improve conditional neural density estimators such as density networks or normalizing flows. If a parameterized neural density estimator [MATH] is differentiable with respect to
[MATH] , we can calculate the surrogate score [MATH] and train an improved density estimator by minimizing [EQUATION] Unlike the methods discussed before, this provides an estimator of the likelihood itself rather than its ratio. Depending on the architecture, the surrogate also provides a generative model.
4.3 Locally sufficient statistics for implicit models A second class of new likelihood-free inference methods is based on an expansion of the implicit model around a reference parameter point [MATH] Up to linear order in [MATH] , we find
[EQUATION] with some normalization factor [MATH] . This local approximation is in the exponential family and the score vector [MATH] , defined in Eq. ( ), are its sufficient statistics.
For inference in a sufficiently small neighborhood around a reference point [MATH] , a precise estimator of the score [MATH] therefore defines a vector of ideal summary statistics that contain all the information in an observation [MATH] on the parameters
[MATH] [see also 46 47 . The joint score together with a minimization of the loss in Eq. ( ) allows us to extract sufficient statistics from an intractable, non-differentiable simulator, at least in the neighborhood of [MATH] . Moreover, this local model can be estimated by running the simulator at a single value
[MATH] — it does not require scanning the [MATH] space, and thus avoids the curse of dimensionality. Based on this observation, we introduce two further inference strategies:
Sally (Score Approximates Likelihood LocallY): By minimizing the squared error with respect to the joint score, see Eq. ( ), we train a score estimator [MATH] . In a next step, we estimate the density [MATH] through standard multivariate density estimation techniques. This calibration procedure implicitly includes the ...
Sallino (Score Approximates Likelihood Locally IN One dimension): The Sally inference method requires density estimation in the estimated score space, with typically [MATH] . But in cases with large number of parameters, it is beneficial to reduce the dimensionality even further. In the local model of Eq. ( 13 ), the l...
[MATH] -independent constant related to [MATH] . Any neural score estimator lets us also estimate this scalar function, which is a sufficient statistic for the 1-dimensional parameter space connecting [MATH] and [MATH] . We can thus estimate the likelihood ratio through univariate, rather than multivariate, density est...
The Sally and Sallino techniques are designed to work very well close to the reference point. The local model approximation may deteriorate further away, leading to a reduced sensitivity and weaker bounds. These approaches are simple and robust, and in particular the Sallino algorithm scales exceptionally well to high-...
For all these inference strategies, the augmented data is particularly powerful for enhancing the power of simulation-based inference for small changes in the parameter [MATH] . When restricted to samples [MATH] , the variance from the simulator is a challenge. The fluctuations in the empirical density scale with the s...
Experiments Generalized Galton board. We return to the motivating example in Sec. and Fig. and try to estimate likelihood ratios for the generalized Galton board. We use the likelihood ratio trick and a neural density estimator as baselines and compare them to the new Rolr Rascal Cascal , and Scandal methods. As the si...
NDE and Scandal methods we use a neural network with a softmax output layer over the bins to model [MATH] . All networks are explicitly parameterized in terms of [MATH] , the parameter of the simulator that defines the position of the nails (i. e. they take [MATH] as an input). We use a simple network architecture with...
activations. The left panel of Fig. shows the mean squared error between [MATH] and the true [MATH] (estimated from histograms of [MATH]
simulations from [MATH] and [MATH] ), summing over [MATH] , versus the training sample size (which refers to the total number of [MATH] samples, distributed over 10 values of [MATH] ). We find that both Scandal and Rascal are dramatically more sample efficient than pure neural density estimation and the likelihood rati...
Lotka-Volterra model. As a second example, we consider the Lotka-Volterra system , a common example in the likelihood-free inference literature. This stochastic Markov jump process models the dynamics of a species of predators interacting with a species of prey. Four parameters [MATH] set the rate of predators and prey...
We simulate the Lotka-Volterra model with Gillespie’s algorithm . From the time evolution of the predator and prey populations we calculate summary statistics [MATH] . Our model definitions, summary statistics, and initial conditions exactly follow Appendix F of Ref.
. In addition to the observations, we extract the joint score as well as the joint likelihood ratio with respect to a reference hypothesis [MATH] from the simulator. On this augmented data we train different likelihood and likelihood ratio estimators. As baselines we use Carl
and a conditional masked autoregressive flow (MAF) . We compare them to the new techniques introduced in section 4.2 , including a Scandal likelihood estimator based on a MAF. For MAF and Scandal we stack four masked autoregressive distribution estimators (MADEs)
on a mixture of MADEs with 10 components . For all other methods, we use three hidden layers. In all cases, the hidden layers have 100 units and [MATH] activations. Code for simulation and inference is available at Ref.
For inference on a wide prior in the parameter space, the different probability densities often do not overlap. As discussed above, the augmented data is then of limited use. Instead, we focus on the regime where we try to discriminate between close parameter points with similar predictions for the observables. We gene...
Our results indicate a trade-off between the performance in likelihood (density) estimation and likelihood ratio estimation. For density estimation, the MAF performs well. The variance of the score term in the Scandal loss degrades the performance, especially for larger values of the hyperparameter [MATH] However, for ...
Particle physics. Finally we consider a real-world problem from particle physics. A simulator describes the production of a Higgs boson at the Large Hadron Collider experiments, followed by the decay into four electrons or muons, subsequent radiation patterns, the interaction with the detector elements, and the reconst...
The new inference techniques can accommodate state-of-the-art simulators, but in that setting we cannot compare them to the true likelihood function. We therefore present a simplified setup and approximate the detector response such that the true likelihood function is tractable, providing us with a ground truth to com...
MadGraph 5 and MadMax . The setup and the results of this experiment are described at length in Ref. , which is attached as supplementary material.
In the right panel of Fig. we show the expected mean squared error of the approximate [MATH] for the different techniques as a function of the training sample size. We take the expectation over random values of [MATH] , drawn from a Gaussian prior with mean [MATH] and covariance matrix [MATH] . We compare the new techn...
All new inference techniques outperform the traditional histogram method, provided that the training samples are sufficiently large. Using augmented data substantially decreases the amount of training data required for a good performance: the Rascal method, which uses both the joint ratio and joint score information fr...
[MATH] . The particularly simple local techniques Sally and Sallino need even less data for a good performance. However, their performance eventually plateaus and does not asymptote to zero error. This is because the local model approximation breaks down further away from the reference point