Monte Carlo sampling algorithms aim to produce samples from a target distribution with a given unnormalised probability density function. The high cost of running Monte Carlo algorithms, with many simulation steps or particles needed to obtain a good empirical approximation to the target, can be reduced by introducing learnable components into the sampler – a form of amortisation. Once these components are trained, amortised samplers can produce high-quality samples with less computation at sampling time than training-free algorithms would require. We propose an amortised sampler built upon the framework of adaptive importance sampling – a hierarchical importance sampling procedure where the proposal is iteratively adapted. Our amortised adaptive importance sampling algorithm fits a lightweight neural network that adapts the proposal using information obtained over the course of sampling. By training our sampler over many different targets taken from the same family of distributions, we obtain a sampler that can adapt to a specific target at sampling time without a priori access to the target's parameters. We show that our procedure can efficiently sample from targets within the family the sampler was trained on, giving improvements over target-specific amortised samplers and training-free adaptive importance sampling algorithms. We also explore the potential for generalisation, where the trained sampler is used to sample from targets outwith its training family.
1 INTRODUCTION
We consider the problem of sampling from a distribution over Rd with probability density function
p(x)=Z1π(x),Z=∫Rdπ(x)dx,(1)
where we assume that we only have access to an un-normalised density π∝p. We also consider the related problem of estimating integrals of the form:
I=Ex∼p[f(x)]=∫Rdf(x)p(x)dx.(2)
(We use the same notation for an absolutely continuous distribution and its density.) These problems are of key importance in many applications, including Bayesian inference (Gelman et al., 1995) and statistical mechanics (Noé et al., 2019). One may want to solve both problems for many related distributions p and test functions f.
Monte Carlo Methods Monte Carlo methods are a commonly used solution to sampling problems. These methods form an empirical approximation to a single target distribution by performing a stochastic simulation. Many such methods simulate a Markov chain whose stationary distribution is the target, known as Markov chain Monte Carlo (Metropolis et al., 1953; Hastings, 1970; Roberts and Rosenthal, 2004; Neal, 2003, 2011). Another common category of Monte Carlo methods are importance sampling algorithms, which sample particles from some proposal distribution and reweight them (Elvira and Martino, 2021).
There are various iterative versions of importance sampling, with multiple rounds of particle reweighting, including annealed importance sampling (Neal, 2001), sequential Monte Carlo (Del Moral et al., 2006), and methods that adapt the proposal towards the target, known as adaptive importance sampling (AIS; Cappé et al., 2004, 2008; Bugallo et al., 2017). The adaptation of the proposal in AIS algorithms uses information obtained about the target at sampling time. Various adaptation rules have been proposed (Cappé et al., 2004,
Figure 1: Amortisation of a proposal adaptation over a family of targets. Each row shows sequential adaptation of the importance sampling proposal in our implementation of amortised adaptive importance sampling. The samples and importance weights from each iteration's proposal qt−1 are supplied to a neural network that predicts the parameters of the next iteration's proposal qt. During training, the neural network is updated to minimise a divergence between all steps' proposals and the target distribution p. Training is over many distributions from a family; once trained, the sampler can be used for new targets in the same family.
2008; Elvira et al., 2023; Akyildiz and Míquez, 2021; Paananen et al., 2021; Elvira and Chouzenoux, 2022).
Amortised Sampling The progress of deep learning methods has spurred the development of amortised sampling, wherein learnt components are introduced into sampling algorithms. Amortised sampling algorithms range from those that aim to learn MCMC transitions parametrised by a normalising flow (Gabrié et al., 2022) to expressive dynamics-based approaches (Berner et al., 2026). Amortised importance sampling methods include Müller et al. (2019), who parametrise the proposal using normalising flows. See Gabrié (2026) for a recent review of amortised sampling.
Many approaches to amortised sampling only consider sampling from a single distribution. Target-specific training becomes unattractive when sampling must be repeated across many related targets, since training cost is incurred separately for each target. Recently, there has been interest in algorithms that amortise over multiple Monte Carlo problems, for example, producing samples for many distributions from the same family (e.g., Bayesian posteriors conditioned on different observations). Advances made in this direction include those of Golinski et al. (2019); Sun et al. (2023b); Klein et al. (2023); Klein and Noé (2024).
Our Contribution We formulate a way to incorporate target-specific information into importance sampling proposals at sampling time by learning the adaptation rule in AIS ( §3). We obtain an algorithm that can efficiently adapt a starting proposal to any target within a family of distributions without requiring information that specifies the target in advance (Fig. 1). Empirically, we show the benefit of amortisation within an AIS procedure over AIS algorithms with static adaptation rules (Fig. 2).
The only target-specific information required by our amortised adaptive importance sampling (AAIS) algorithm is obtained during the sampling procedure, for example, through pointwise evaluations of the (possibly unnormalised) target density function and possibly its derivatives. This allows AAIS to sample from multiple different targets within the family it was trained on, but it can also be run on targets outwith its training family. We investigate this promising direction and show that AAIS can still perform efficiently when the evaluation family differs from the training family.
2 PRELIMINARIES
2.1 Importance Sampling
Importance sampling is a Monte Carlo algorithm that allows for estimating integrals of the form given by (2) without requiring samples from p. Instead, samples {xs}s=1S are drawn from a proposal distribution, q, and the corresponding Monte Carlo estimator of I is appropriately reweighted:
I=SZ1s=1∑Sw(xs)f(xs),w(xs)=q(xs)π(xs).(3)
This estimator is unbiased and consistent, and setting q=p recovers the standard Monte Carlo estimator for (2). If Z is unknown, it can be substituted with an estimator:
Z=S1s=1∑Sw(xs).(4)
Replacing Z in (3) with Z, we obtain the self-normalised importance sampling (SNIS) estimator:
This estimator is biased but consistent. In our experiments, we only consider the SNIS estimator.
The choice of the proposal distribution q is crucial to the efficiency of importance sampling. In particular, the variance of Z is proportional to the χ2 divergence between the target and the proposal, and large discrepancies between the two distributions may lead to highly variable weights and poor estimates (Agapiou et al., 2017). This motivates the design or adaptation of proposal distributions that approximate the target while remaining easy to sample from and evaluate. In practice, since an appropriate proposal is rarely known in advance, it is often advantageous to adapt it using information gathered during the sampling procedure.
2.2 Adaptive Importance Sampling
Adaptive importance sampling (AIS) algorithms iteratively adapt the proposal distribution using information from previous sampling iterations. AIS consists of three main stages iterated for T steps. Let q1 be the initial proposal, at step t: sample xs(t)∼qt,s=1,…,S; compute weights w(xs(t)) using (3); and then adapt the proposal to obtain qt+1; see Algorithm 1. One option is to construct the self-normalised AIS estimator of I:
Beyond improving the efficiency of importance sampling estimators, AIS can be used to construct proposals qt that progressively approximate the target p. The resulting approximation to p may be useful in its own right, for example, to draw posterior samples in a Bayesian problem and estimate posterior predictive.
A wide variety of AIS algorithms have been proposed, differing in several aspects, most notably in the adaptation rule – the mechanism used to adapt the proposal
Algorithm 1 Adaptive Importance Sampling
Require: S, T, initial proposal q1, target density π.
1: for t=1,…,T do
2: Draw S samples {xs(t)}s=1S from qt
3: Calculate w(xs(t)),s=1,…,S
4: Adapt qt→qt+1
5: end for
6: Draw and weight samples from qT+1
7: return S(T+1) pairs of samples and their weights,
{(ws(t),xs(t))}s=1,t=1S,T+1, and the proposals q1:T+1.
parameters across iterations – and in the parametric family adopted for the proposal. Common adaptation strategies include resampling-based mechanisms, where the locations of mixture components are adapted using the weighted sample population (Cappé et al., 2004; Elvira et al., 2017); geometry-based approaches, which exploit gradient and curvature information from the target to adapt the locations and covariance matrices of the proposal components (GAPIS; Elvira et al., 2015) (GRAMIS; Elvira et al., 2023); and parametric fitting approaches, where the proposal parameters are adapted to better approximate the target. The latter include moment-matching schemes, as in AMIS (Cornuet et al., 2012), as well as methods that formulate the adaptation explicitly as the minimisation of a statistical divergence between the proposal and the target (Ryu, 2016; Akyildiz and Miguez, 2021).
3 AMORTISED ADAPTIVE IMPORTANCE SAMPLING
We propose AAIS, which replaces the prespecified adaptation rule of AIS with a learnt function uϕ. The function is trained across AIS rollouts with different target distributions and maps information about the target collected during sampling to the next proposal.
Single-Target Amortisation We briefly introduce the idea through the single-target amortisation setting. In order to amortise AIS, we propose to learn the adaptation rule used in line 4 of Algorithm 1. We parametrise this adaptation rule with a function uϕ with learnable parameters ϕ. At step t, this function takes in the observables, O1:t, of the AIS rollout up to and including time t (e.g., target density evaluations, gradients) as well as the proposals up to time t, q1:t, and outputs the new proposal qt+1.
Let R denote the output of an AIS procedure (Algorithm 1) – the pairs of samples with their weights from each step and the proposals q1:T+1. The parameters of this adaptation function, uϕ, can then be trained to minimise some real-valued objective, D(R,π,f), which takes in the AIS output, R, as well as the target density π and, if desired, the function f for which the expectation in (2) is to be estimated. The output, R, of AIS is random, so the objective is to minimise:
ℓ(ϕ)=ER[D(R,π,f)],(8)
with respect to the parameters ϕ.
An example choice for D is the KL divergence of the final proposal to the target π:
Note that R depends on ϕ, so extra care is required in order to perform gradient descent on (8). The RE-INFORCE estimator (Williams, 1992) can be used, or certain choices of the qt can allow reparametrisation.
Many choices for D are possible; we explore some of them empirically in §4.3 and C.3. For notational simplicity, we will drop the dependence of D on f, since in our experiments the objectives do not depend on it.
Amortisation over Distribution Families All AIS algorithms use information about the target distribution p, via its unnormalised density π or its derivatives at sampled points, to adapt the proposal. As a result, the (distributions of) sequences of proposals over AIS iterations differ between targets.
However, in AAIS, the adaptation rule itself is learnt. The optimal way to adapt the proposal using new information about the target may depend on information that is not contained in the current AIS rollout's observables. Instead, the information may come from training over a family of target distributions that share some structure. For instance, in Fig. 1, the optimal adaptation of the proposal could take into account the knowledge, acquired during training on many targets, that the target is a mixture of two Gaussians.
Extending the single-target amortisation procedure, we train the adaptation rule over targets π∼Π, where Π is a distribution over unnormalised density functions, by minimising (8) in expectation over π:
ℓ(ϕ)=Eπ∼Π[ER[D(R,π)]],(11)
in a similar way to that considered in Paige and Wood (2016); Golinski et al. (2019). Algorithm 2 details the training of the uϕ. Once trained, the uϕ can be used to perform the adaptation step in Algorithm 1.
Minimising (11) is not the same as attempting to find a single proposal that fits many distributions well. The output R is dependent on both the adaptation rule parameters ϕ and the target π, so the objective in (11) aims for the best proposal for every individual π sampled from Π.
Characterising the Optimal Adaptation Rule To give further clarification, below we consider the optimal adaptation rules.
First, the optimal adaptation rule uπ∗(O1:t,q1:t) for a proposal qt with a single target π is:
In the family amortisation setting, we can only infer which target is being sampled from based on the information gathered at each step, thus the corresponding optimal rule for amortisation over Π is:
Comparing this with the single-target optimal adaptation, we note the additional weighting by the posterior probability of each π given the observed O1:t. So, in a Bayesian decision theory framework with loss ER[D(R,π)∣O1:t,q1:t], the optimal AAIS adaptation coincides with the optimal decision.
In the preceding setup, using intermediate targets πt in the objective is also possible. The adaptation rule uϕ could also return a distribution over proposals.
Our AAIS Implementation The above is a general setup for AAIS. Choices must be made for: the objective D, the parametrisation of uϕ, and the form of proposal.
We parametrise our proposals as equally-weighted Gaussian mixtures with N components:
qt(x)=N1n=1∑NN(μn(t),Σn(t)),(14)
where the μn(t) and Σn(t) are adapted at each step. We use a diagonal Σn(t) in our experiments.
Our adaptation function is chosen to be scale-equivariant (see §A.2). This gives the sampler better generalisation (see §C.5) and also removes the requirement for scale-specific hyperparameter tuning. Our uϕ produces additive adaptations to the μn(t) and multiplicative adaptations to the Σn(t), taking in only the current time step's information and proposal – the samples xs(t), their weights w(xs(t)), target gradient evaluations
True Samples
AAIS
DM-PMC
M-PMC
GAPIS
Funnel (d = 50)
Banana (d = 5)
Figure 2: Samples generated by the final step proposal for each method for 50-dimensional funnel (top row) with N=50 components in the proposal mixture, and 5-dimensional banana (bottom row) with N=10 components in the proposal mixture, each projected into their first two coordinates.
at the xs(t) and μn(t), the time step t, and qt. We use a neural network structure similar to Zaheer et al. (2017) making use of multiple lightweight multilayer perceptrons and pooling to ensure permutation-invariance with respect to the input sample-weight pairs. This allows the final AAIS algorithm to run with any number of samples taken at each step and for any number of components – not necessarily just the values used when training. See §A.1 for full adaptation function details.
Our choice for D is a step-wise KL divergence:
D(R,π)=T1t=2∑T+1KL(qt∣∣p)+ const. (15)
To allow for gradients to propagate from KL(qt∥p) back to the previous adaptations we make use of the reparametrisation trick for Gaussians and the deterministic-mixture sampling procedure of Elvira et al. (2017), where an equal number of samples are taken from each component in qt.
To stabilise training we make use of annealing in the early steps of training, and we modify the estimator of the KL divergences to use compressed log-density ratios. Details are in §B.1, and the full algorithm for training our AAIS implementation is given in Algorithm 3, along with details of algorithmic cost in §A.1.
4 EXPERIMENTS
We empirically evaluate the benefit of amortisation over families by comparing our AAIS implementation to previous AIS algorithms with different adaptation rules. We compare against: deterministic-mixture population Monte Carlo (DM-PMC; Elvira et al., 2017) – a resampling based adaptation rule, mixture PMC (M-PMC; Cappé et al., 2008) – an EM adaptation rule (equivalent to minimising the KL divergence between the target and a Gaussian mixture proposal qt , KL(p∥qt) ), and the gradient adaptive population importance sampler (GAPIS; Elvira et al., 2015) – adaptation based on target gradients and Hessian information. All samplers are run using a matched number of target density evaluations, and where gradients are calculated they count as 2 evaluations. These baselines give a range of types of adaptation rules, and they require little hyperparameter tuning. GAPIS requires the gradient step size to be chosen; for every target family we run GAPIS for different values of the step size on a validation set of targets and select the parameter value with the best performance.
We compare samplers using three main metrics: sliced 1-Wasserstein distance (Bonneel et al., 2015) between the final proposal and the target (sliced W1prop), the effective sample size (ESS) using the temporal mixture of all proposals, and the error in the estimated log-normalising constant log Z. To assess sampling on a family of distributions, we average these metrics over a batch of test targets and also compute the worst 5% quantile for each metric over the batch. All metric details are given in §B.3.
4.1 Sampling in Families
Details of all target families are given in §B.2.
Synthetic Densities We evaluate AAIS on a family formed from Neal's funnel distribution (Neal, 2003):
x1∼N(0,σ2),x2:d∣x1∼N(0,ex1Id−1).(16)
Table 1: Experimental results for Funnel d=5,25,50. We report the mean over 256 test targets from the family and (for AAIS) the std.dev. of this mean over 3 training seeds. The worst 5% quantile of the metric over the batch of targets is shown in parentheses. Best in green, second-best in blue.
Method ↓ Metric →
sliced W1prop↓
ESS ↑
logZerr.↓
5∥d
AAIS
0.4658±0.002(0.978)
0.2605±0.008(0.015)
0.1250±0.005(0.241)
DM-PMC
0.9592(1.69)
0.0301(0.002)
0.2691(0.537)
M-PMC
0.7222(1.43)
0.0965(0.004)
0.1777(0.347)
GAPIS
1.678(2.44)
0.0055(0.001)
0.4400(1.05)
True samples
0.4451(0.848)
1.000(1.00)
0.0000(0.000)
25∥d
AAIS
0.5069±0.006(1.08)
0.1953±0.006(0.003)
0.2672±0.007(0.413)
DM-PMC
1.423(2.22)
0.0004(0.000)
4.277(7.06)
M-PMC
2.060(2.85)
0.0003(0.000)
10.626(13.29)
GAPIS
1.125(1.68)
0.0013(0.000)
9.789(12.11)
True samples
0.4787(0.941)
1.000(1.00)
0.0000(0.000)
50∥d
AAIS
0.5123±0.002(1.11)
0.1327±0.003(0.002)
0.2921±0.003(0.437)
DM-PMC
1.837(2.65)
0.0001(0.000)
18.597(22.77)
M-PMC
2.263(3.07)
0.0001(0.000)
22.685(26.08)
GAPIS
1.070(1.64)
0.0006(0.000)
23.015(26.58)
True samples
0.4830(0.967)
1.000(1.00)
0.0000(0.000)
We turn this into a family of distributions by randomly sampling σ∼U[23,3].
Table 1 shows that AAIS outperforms the baselines consistently, with a final proposal better matched to the target, better ESS, and lower normalising constant estimation error. AAIS shows far better scalability for the problem as it is the only sampler that effectively samples from the funnel at 50 dimensions, having magnitudes larger ESS and a much more accurate estimation of the normalising constant. AAIS outperforms on the metric means and also has better performance on the worst 5% quantile of targets. Fig. 2 (top) shows samples taken from the final proposal, qT+1, of each AIS algorithm considered, where we see that AAIS is the only algorithm with a well-matched final proposal for the 50-dimensional funnel.
We also evaluate on a family built from banana-shaped distributions – Fig. 2 (bottom) – where amortisation performs similarly well, see Table 18 for full results.
Bayesian Posteriors We show here the usefulness of AAIS for Bayesian inference problems by training on a family of many related posteriors. We consider the following hierarchical Bayesian inference problem:
The σj2 are assumed to be known, and the task is to infer θ1:J,μ, and τ, so d=J+2. To form a family of distributions we randomly sample: observations y1:J, the parameters of the data generating process θ1:J,μ,τ, and the likelihood model parameters σj2. Table 2 shows the usefulness of amortisation over families for this problem. Again, AAIS scales much better to the higher-dimensional problems than the baselines and
Table 2: Experimental results for the Bayesian hierarchical model d=5,25. Metrics reported follow the convention of Table 1.
Method ↓ Metric →
sliced W1prop↓
ESS ↑
logZerr.↓
5∥d
AAIS
0.8718±0.029(1.50)
0.0358±0.003(0.002)
0.5812±0.007(0.972)
DM-PMC
1.594(3.16)
0.0120(0.001)
0.8585(1.69)
M-PMC
2.005(4.31)
0.0081(0.000)
1.674(3.81)
GAPIS
138.7(543.3)
0.0016(0.000)
2.449(5.90)
True samples
0.3458(0.565)
1.000(1.00)
0.0000(0.000)
25∥d
AAIS
0.9877±0.020(2.41)
0.0125±0.001(0.001)
1.279±0.022(2.19)
DM-PMC
3.675(6.99)
0.0003(0.000)
20.770(33.99)
M-PMC
5.413(9.27)
0.0001(0.000)
48.089(76.65)
GAPIS
429.0(1.2×103)
0.0007(0.000)
19.314(41.64)
True samples
0.3343(0.598)
1.000(1.00)
0.0000(0.000)
Table 3: Performance of AAIS amortised over a single target vs over a whole family, all targets are at d=25. Metrics reported follow the convention of Table 1.
Target Family
Amortised over
Evaluated on
logZerr.↓
Funnel
Single target Family
Single target
0.2656±0.0062(0.3187)0.2647±0.0081(0.3222)
Single target Family
Family
0.2661±0.0049(0.4080)0.2672±0.0074(0.4131)
Banana
Single target Family
Single target
1.096±0.0005(1.529)1.500±0.0244(2.102)
Single target Family
Family
2.563±0.0315(4.500)2.127±0.0138(3.340)
Hierarchical
Single target Family
Single target
0.9722±0.0194(1.208)1.281±0.0208(1.572)
Single target Family
Family
4.720±0.1137(15.600)1.279±0.0214(2.196)
BLR
Single target Family
Single target
293.7±5.751(335.1)428.8±7.762(461.9)
Single target Family
Family
605.2±9.940(1.1×103)374.3±4.139(998.9)
is able to perform stable adaptation of the proposal. On this Bayesian hierarchical problem AAIS has amortised not only over different datasets, but also over different data generating processes and different models for the likelihood (different σj2). We also evaluate performance on a Bayesian linear regression (BLR) problem in Table 20, where AAIS performs similarly well.
Comparison to Single-Target Amortisation To distinguish the performance gained from family-level amortisation over the performance gained from single-target amortisation, we show how AAIS trained over a family of distributions compares with AAIS trained on only a single distribution from the family. From Table 3 we see that single-target AAIS generally performs better on its training target, as expected. More importantly, we see that family-amortised AAIS performs better when evaluated on other distributions within the family, particularly on the Bayesian inference problems. Targets from the funnel family are close enough together that amortisation over the family is not meaningfully different from single-target training.
Table 4: Generalisation of a trained AAIS algorithm to shifted targets of the same form, see family definitions in §B.2. Sliced 1-Wasserstein distance of the final proposal to the target is reported and follows the convention of Table 1. A “-” indicates that the mean could not be calculated due to numerical divergence.
Base Target
Shift ↓ Method →
AAIS
DM-PMC
M-PMC
GAPIS
Banana (d=5)
Curvature range: [101,21]→[21,1]
1.365±0.0344(2.459)
1.530(3.040)
1.518(2.951)
1.387(1.996)
Curvature range: [101,21]→[1,2]
2.912±0.0520(5.382)
3.370(6.450)
3.429(6.192)
2.278(4.172)
BLR (d=5)
β∗∼N(0,4Ir)→β∗∼N(0,64Ir)
3.980±0.0428(7.859)
1.323(4.059)
5.108(9.767)
131.1(611.8)
β∗∼N(0,4Ir)→β∗∼N(0,400Ir)
12.231±0.0404(20.850)
6.793(16.909)
13.203(22.528)
684.2(3.8×103)
nrange:[3r,12r]→[12r,48r]
0.7802±0.0302(2.521)
1.152(2.197)
2.624(4.347)
132.9(668.3)
nrange:[3r,12r]→[48r,192r]
0.8607±0.0162(2.648)
1.190(2.101)
2.753(4.494)
515.2(2.5×103)
Funnel (d=5)
x1variancerange:[23,3]→[3,29]
3.280±0.0184(7.076)
3.955(7.728)
3.970(7.916)
3.927(7.551)
x1variancerange:[23,3]→[29,6]
21.723±0.0426(59.748)
22.256(60.264)
22.385(60.376)
21.531(58.947)
Hierarchical (d=5)
τrange:[21,8]→[8,20]
1.848±0.1378(5.819)
3.581(8.298)
4.929(12.708)
9.2×1012(5.0×1013)
τrange:[21,8]→[20,32]
-
9.220(19.125)
12.100(24.291)
-
Banana (d=25)
Curvature range: [101,21]→[21,1]
2.493±0.0234(3.211)
2.751(3.606)
3.340(4.011)
1.109(1.684)
Curvature range: [101,21]→[1,2]
4.253±0.0454(5.549)
5.114(6.662)
5.556(7.076)
3.245(4.806)
BLR (d=25)
β∗∼N(0,4Ir)→β∗∼N(0,64Ir)
3.366±0.0550(5.645)
4.164(6.531)
6.825(8.417)
1.4×103(7.3×103)
β∗∼N(0,4Ir)→β∗∼N(0,400Ir)
11.207±0.2200(15.456)
13.439(17.379)
15.990(19.547)
7.3×103(3.9×104)
nrange:[3r,12r]→[12r,48r]
1.310±0.0673(2.897)
1.961(3.197)
3.181(3.852)
1.1×103(5.5×103)
nrange:[3r,12r]→[48r,192r]
1.512±0.0747(3.192)
1.962(3.212)
3.177(3.954)
5.2×103(3.0×104)
Funnel (d=25)
x1variancerange:[23,3]→[3,29]
3.609±0.0564(8.537)
4.650(9.820)
5.760(10.868)
4.154(8.906)
x1variancerange:[23,3]→[29,6]
24.502±0.0988(65.907)
25.417(66.595)
26.834(67.877)
24.580(65.867)
Hierarchical (d=25)
τrange:[21,8]→[8,20]
3.767±0.0882(7.176)
10.288(14.992)
12.936(18.187)
2.7×1013(1.1×1014)
τrange:[21,8]→[20,32]
-
19.281(26.756)
22.520(30.694)
-
4.2 Generalisation to Unseen Targets
AAIS can be run on any target for evaluation, including targets not within its training family. Using the target families considered previously, we change the random parameter distributions defining each target family and obtain modified versions of each family. For example, we change the range which we sample σ from in (16) from [23,3] to [3,29]. In Table 4 we use AAIS trained on the original targets and test them on the modified targets. Even though AAIS was not trained on the modified families, it still often does the best. AAIS generalises well to the smaller of two different modifications performed to both the funnel and Bayesian hierarchical families, but is unable to generalise to the larger modification. AAIS generalises particularly well to the modifications performed on the Bayesian linear regression family, including shifts to the random number of data-points supplied for posterior inference. Note that GAPIS was re-tuned on the modified families.
4.3 Objective Choice
In Table 5 we compare different choices for divergence inside (15) instead of KL(qt∥p). We compare using KL(p∥qt) estimated either with a SNIS-estimator or using true target samples (oracle draws). The KL(p∥qt) estimated with true target samples achieves better performance on the two synthetic densities, but we were unable to achieve stable training of AAIS with
Table 5: Effect of three different divergences in the AAIS objective. Metrics reported follow the convention of Table 1. All targets are at d=25. A “-” indicates that the mean could not be calculated due to numerical divergence.
Target Family
Objective ↓ Metric →
logZerr.↓
Funnel
KL(qt∥p)
0.2672±0.0074(0.4131)
KL(p∥qt)(SNIS)
4.496±0.7189(6.445)
KL(p∥qt)(oracledraws)
0.2145±0.0077(0.3352)
Banana
KL(qt∥p)
2.127±0.0138(3.341)
KL(p∥qt)(SNIS)
6.705±0.6376(11.362)
KL(p∥qt)(oracledraws)
1.130±0.0392(2.398)
Hierarchical
KL(qt∥p)
1.279±0.0215(2.194)
KL(p∥qt)(SNIS)
-
KL(p∥qt)(oracledraws)
-
BLR
KL(qt∥p)
374.4±4.126(994.0)
KL(p∥qt)(SNIS)
1.6×103±1.4×103(5.0×103)
KL(p∥qt)(oracledraws)
583.8±41.198(1.1×103)
either KL(p∥qt) objective on the Bayesian hierarchical family. A particular challenge in the use of these objectives is that if the current proposal is far from the current target, then the importance weights can be extremely large, making numerical optimisation difficult. See §C.3 for further details.
4.4 Additional Experiments
In §C we provide various ablation studies, which justify our algorithm choices, such as the use of: target gradients (§C.1), expectation-maximisation-based features (§C.2), diagonal covariance structure (§C.4), and a step-wise objective ( §C.3). We also show that equivariance gives better generalisation performance at the cost of some performance on the training family ( §C.5). We explore the dependence on model capacity ( §C.6) and the generalisation of each trained model to targets from the other families ( §C.7). We also study the limits of scaling AAIS to multimodal distributions (Table 19).
Finally, we also give extra metrics for the results presented in the preceding subsections ( §C.8).
5 RELATED WORK
AIS with Learnt Components The idea to use adaptation rules based on the gradient of a divergence between proposal and target within an AIS algorithm has been explored previously, e.g., El-Laham et al. (2019); Han and Liu (2017); El-Laham and Bugallo (2019); Akyildiz and Míguez (2021); Perello and Akyildiz (2023) – these methods learn in an online fashion rather than amortising. Dowling et al. (2018) propose to use variational inference to learn an initialisation for AIS. The most similar approach to ours in the AIS literature is that of El-Laham and Bugallo (2021) who use a reinforcement learning setup and, like AAIS, propose to learn the adaptation between iterations. Unlike our setup, information gained from the AIS generation process is detached from the updating procedure – if the model is already trained, one could sample all of the parameters for every time step before running the algorithm. Under this formulation adaptation can never occur on a new target distribution, and thus amortisation over multiple targets is not possible.
Amortisation over Multiple Distributions AAIS tackles the problem of sampling and integral estimation over many different distributions/tasks. Prior works in this direction include Xi et al. (2018); Chen et al. (2024); Sun et al. (2023a,b), where the problem of jointly estimating multiple integrals is explored – these works differ from our problem setup in that they usually assume access to true samples from the target when training. Recent progress in amortised sampling for molecular dynamics was made by Klein et al. (2023); Klein and Noé (2024). Closely related is the area of amortised Bayesian inference, where amortisation is over datasets; such works include Ritchie et al. (2016); Paige and Wood (2016); Le et al. (2017), and Golinski et al. (AMCI; 2019), who set up a general framework for amortising the calculation of expectations. Many of these works, in a Bayesian inference setting, propose to learn a mapping from a dataset to the parameters of an importance sampling proposal. We adopt a similar framework, also through importance sampling, but we emphasise that our algorithm is able to solve a wider range of problems: these previous approaches require conditioning information that fully specifies the target distribution, whereas AAIS obtains information about the specific sampling target online during the sampling procedure.
6 CONCLUSION
We have shown that learning the adaptation rule in adaptive importance sampling by training over a family of distributions can give better sampling and estimation performance on that family. Unlike many amortisation approaches, AAIS does not require access to conditioning information about the target in advance of the sampling procedure. This is a useful freedom because we do not need to explicitly define the structure of the distribution family through a conditioning variable; instead, the structure can be implicit and inferred by observing target information through the training procedure. An extension of our AAIS algorithm could use conditioning information as an input to its adaptation rule. Alternatively, AAIS could be used to adapt the output proposal of another method that uses conditioning, such as that of Golinski et al. (2019).
Our AAIS implementation did not explore some of the many choices that the setup in §3 allows for, such as the possibility to make the adaptation non-Markovian (i.e., dependent on the entire rollout history), or to use a loss function that aims only for good estimation of a particular expectation (2) rather than a well matched proposal. AAIS can be extended to this setting by targeting the optimal distribution for a given f (see e.g., Owen (2013)); the methods suggested by Golinski et al. (2019) can be transferred to AAIS.
Our method shows promising generalisation potential to distributions that lie outside the training family. This opens the possibility for training a sampler that can perform well on many distributions that are structurally related, but have not necessarily been part of the family trained on. Our experiments deliberately made use of small-scale neural networks with small parameter counts, so scaling may bring greater generalisation performance. Our study of generalisation performance also raises the question of what kind of structure in these distribution families is amortisable, and whether we can predict if a sampler trained on one family will perform well on another.
Whilst our algorithm focused on adaptive importance sampling, the principle of using information obtained at sampling time to infer target information available due to amortisation can be extended to other iterative Monte Carlo algorithms that intake target information at each step, such as Markov chain Monte Carlo, where we expect that similar gains could be made.
AI Use Statement
Generative AI tools were lightly used to assist with coding tasks. They were not used for any other tasks, including writing and figure creation.
Acknowledgements
The work of AC is supported by the UKRI EPSRC through the CDT in Machine Learning Systems hosted in the School of Informatics, University of Edinburgh (EP/Y03516X/1), as well as joint sponsorship from Level E Research. The work of VE and ESW is supported by the Advanced Research and Invention Agency (ARIA). ESW acknowledges support from the CIFAR Learning in Machines and Brains programme.
References
Agapiou, S., Papaspiliopoulos, O., Sanz-Alonso, D., and Stuart, A. M. (2017). Importance sampling: Intrinsic dimension and computational cost. Statistical Science, pages 405–431.
Akyildiz, Ö. D. and Míguez, J. (2021). Convergence rates for optimised adaptive importance samplers. Statistics and Computing, 31(2):12.
Berner, J., Richter, L., Sendera, M., Rector-Brooks, J., and Malkin, N. (2026). From discrete-time policies to continuous-time diffusion samplers: Asymptotic equivalences and faster training. Transactions on Machine Learning Research (TMLR).
Bonneel, N., Rabin, J., Peyré, G., and Pfister, H. (2015). Sliced and Radon Wasserstein barycenters of measures. Journal of Mathematical Imaging and Vision.
Bugallo, M. F., Elvira, V., Martino, L., Luengo, D., Miguez, J., and Djuric, P. M. (2017). Adaptive importance sampling: The past, the present, and the future. IEEE Signal Processing Magazine.
Cappé, O., Douc, R., Guillin, A., Marin, J.-M., and Robert, C. P. (2008). Adaptive importance sampling in general mixture classes. Statistics and Computing, 18(4):447–459.
Cappé, O., Guillin, A., Marin, J.-M., and Robert, C. P. (2004). Population Monte Carlo. Journal of Computational and Graphical Statistics, 13(4):907–929.
Chen, Z., Naslidnyk, M., Gretton, A., and Briol, F.-X. (2024). Conditional Bayesian quadrature. Uncertainty in Artificial Intelligence (UAI).
Cornuet, J.-M., Marin, J.-M., Mira, A., and Robert, C. P. (2012). Adaptive multiple importance sampling. Scandinavian Journal of Statistics.
Del Moral, P., Doucet, A., and Jasra, A. (2006). Sequential Monte Carlo samplers. Journal of the Royal
Statistical Society: Series B (Statistical Methodology), 68(3):411–436.
Dowling, M., Nassar, J., Djurić, P. M., and Bugallo, M. F. (2018). Improved adaptive importance sampling based on variational inference. European Signal Processing Conference (EUSIPCO).
El-Laham, Y. and Bugallo, M. F. (2019). Stochastic gradient population Monte Carlo. IEEE Signal Processing Letters.
El-Laham, Y. and Bugallo, M. F. (2021). Policy gradient importance sampling for Bayesian inference. IEEE Transactions on Signal Processing.
El-Laham, Y., Djurić, P. M., and Bugallo, M. F. (2019). A variational adaptive population importance sampler. IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP).
Elvira, V. and Chouzenoux, E. (2022). Optimized population Monte Carlo. IEEE Transactions on Signal Processing.
Elvira, V., Chouzenoux, E., Akyildiz, Ö. D., and Martino, L. (2023). Gradient-based adaptive importance samplers. Journal of the Franklin Institute, 360(13):9490–9514.
Elvira, V. and Martino, L. (2021). Advances in importance sampling. Wiley Interdisciplinary Reviews: Computational Statistics, pages 1–14.
Elvira, V., Martino, L., Luengo, D., and Bugallo, M. F. (2017). Improving population monte carlo: Alternative weighting and resampling schemes. Signal Processing, 131:77–91.
Elvira, V., Martino, L., Luengo, D., and Corander, J. (2015). A gradient adaptive population importance sampler. IEEE international conference on acoustics, speech and signal processing (ICASSP).
Gabrié, M., Rotskoff, G. M., and Vanden-Eijnden, E. (2022). Adaptive Monte Carlo augmented with normalizing flows. Proceedings of the National Academy of Sciences, 119(10).
Gabrié, M. (2026). Leveraging generative models to assist Monte Carlo sampling. arXiv preprint arXiv:2608.07648.
Gelman, A., Carlin, J. B., Stern, H. S., and Rubin, D. B. (1995). Bayesian data analysis. chapman and hall/cRc.
Golinski, A., Wood, F., and Rainforth, T. (2019). Amortized Monte Carlo integration. International Conference on Machine Learning (ICML).
Haario, H., Saksman, E., and Tamminen, J. (1999). Adaptive proposal distribution for random walk Metropolis algorithm. Computational statistics, 14(3):375–395.
Han, J. and Liu, Q. (2017). Stein variational adaptive importance sampling. Uncertainty in Artificial Intelligence (UAI).
Hastings, W. K. (1970). Monte Carlo sampling methods using Markov chains and their applications. Biometrika, 57:97–109.
Kingma, D. P. and Ba, J. (2015). Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR).
Klein, L., Foong, A., Fjelde, T., Mlodozeniec, B., Brockschmidt, M., Nowozin, S., Noé, F., and Tomioka, R. (2023). Timewarp: Transferable acceleration of molecular dynamics by learning time-coarsened dynamics. Neural Information Processing Systems (NeurIPS).
Klein, L. and Noé, F. (2024). Transferable Boltzmann generators. Neural Information Processing Systems (NeurIPS).
Le, T. A., Igl, M., Rainforth, T., Jin, T., and Wood, F. (2017). Auto-encoding sequential Monte Carlo. International Conference on Learning Representations (ICLR).
Metropolis, N., Rosenbluth, A. W., Rosenbluth, M. N., Teller, A. H., and Teller, E. (1953). Equation of state calculations by fast computing machines. The journal of chemical physics, 21(6):1087–1092.
Müller, T., Mcwilliams, B., Rousselle, F., Gross, M., and Novák, J. (2019). Neural importance sampling. ACM Transactions on Graphics.
Neal, R. M. (2001). Annealed importance sampling. Statistics and computing, 11(2):125–139.
Neal, R. M. (2003). Slice sampling. The Annals of Statistics, 31(3):705–767.
Neal, R. M. (2011). MCMC using Hamiltonian dynamics. Handbook of Markov chain Monte Carlo.
Noé, F., Olsson, S., Köhler, J., and Wu, H. (2019). Boltzmann generators: Sampling equilibrium states of many-body systems with deep learning. Science.
Paananen, T., Piironen, J., Bürkner, P.-C., and Vehtari, A. (2021). Implicitly adaptive importance sampling. Statistics and Computing, 31(2):16.
Paige, B. and Wood, F. (2016). Inference networks for sequential Monte Carlo in graphical models. International Conference on Machine Learning (ICML).
Perello, C. A. and Akyildiz, Ö. D. (2023). Adaptively optimised adaptive importance samplers. arXiv preprint arXiv:2307.09341.
Ritchie, D., Horsfall, P., and Goodman, N. D. (2016). Deep amortized inference for probabilistic programs. arXiv preprint arXiv:1610.05735.
Roberts, G. O. and Rosenthal, J. S. (2004). General state space Markov chains and MCMC algorithms. Probability Surveys.
Ryu, E. K. (2016). Convex optimization for Monte Carlo: Stochastic optimization for importance sampling. Stanford University.
Sun, Z., Barp, A., and Briol, F.-X. (2023a). Vector-valued control variates. International Conference on Machine Learning (ICML).
Sun, Z., Oates, C. J., and Briol, F.-X. (2023b). Meta-learning control variates: Variance reduction with limited data. Uncertainty in Artificial Intelligence (UAI).
Williams, R. J. (1992). Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3):229–256.
Xi, X., Briol, F.-X., and Girolami, M. (2018). Bayesian quadrature for multiple related integrals. International Conference on Machine Learning (ICML).
Zaheer, M., Kottur, S., Ravanbakhsh, S., Poczos, B., Salakhutdinov, R. R., and Smola, A. (2017). Deep sets. Neural Information Processing Systems (NeurIPS).
Require: S, T, adaptation function uϕ, Nepochs, target family Π, proposal initialisation family Q, divergence/loss D, batch size B.
1: for epoch=1,…,Nepochs do
2: Draw a random batch of targets, πb∼Π, b=1,…,B
3: Draw a random starting proposal qb,1∼Q
4: for t=1,…,T do
5: Draw xb,s(t)∼qb,t, s=1,…,S, b=1,…,B.
6: Calculate wb,s(t)=w(xb,s(t)), s=1,…,S, b=1,…,B, using (3).
7: Calculate observables Ob,t, b=1,…,B.
8: Adapt qb,t+1=uϕ(qb,1:t,Ob,1:t), b=1,…,B.
9: end for
10: Draw and weight xb,s(T+1)∼qb,T+1, s=1,…,S, b=1,…,B.
11: Compute D(q1:T+1,{(xb,n,k(t),wb,s(t))}s=1,t=1S,T+1,π) for b=1,…,B.
12: Estimate ∇ϕEπ∼Π[E[D(q1:T+1,{(xb,n,k(t),wb,s(t))}s=1,t=1S,T+1,π)]] and update ϕ.
13: end for
14: return uϕ
A.1 AAIS Adaptation Function Details
We give the details of our adaptation function for AAIS here. First we calculate the EM update statistics for Gaussian mixtures as these will be used in features for our AAIS adaptation function.
A.1.1 EM Update Statistics
Here we motivate the calculation of various features within our adaptation function by relating them to the statistics calculated to perform the expectation-maximisation update with a mixture of Gaussians.
The M-step for a Gaussian mixture, g, with components gn,n=1,…,N, fitted to the sample-weight pairs {(xs,ws)}s=1S, ws=w(xs) from (3), as in Cappé et al. (2008), is given by the updates:
where c(i) denotes the index of the component that generated sample xi.
The M-PMC (Cappé et al., 2008) algorithm we use as a baseline makes use of the suggested Rao-Blackwellised version where instead ρn,s=∑j=1Nαjgj(xs)αngn(xs) is the probability of xs being generated by proposal n, we also restrict the covariance to be diagonal – in line with the proposal parametrisation used by AAIS.
Algorithm 3 Our AAIS implementation with an equal-weight Gaussian mixture proposal. The adaptation function is written with π as an input. This is used as notational convenience to mean that density evaluations and gradient evaluations of π are used as input, see §A.1.
Require: Number of components N, number of samples per component K, T, adaptation function uϕ, Nepochs, target family Π, batch size B, temperature schedule κ
1: for epoch=1,…,Nepochs do
2: Draw batch of random target unnormalised densities πb′∼Π, b=1,…,B.
3: Temper the density πb(x)=πb′(x)κ(eepoch)1
4: Draw random starting proposal parameters θb,1={μb,n(1),Lb,n(1)}n=1N parametising qb,1.
5: for t=1,…,T do
6: ϵb,n,k∼N(0,Id), b=1,…,B, n=1,…,N, k=1,…,K.
7: xb,n,k(t)=μb,n(t)+Lb,n(t)ϵb,n,k
8: wb,n,k(t)=qb,t(xb,n,k(t))πb(xb,n,k(t))
9: Adapt θb,t+1=uϕ(θb,t,{(xb,n,k(t),wb,n,k(t))}k=1,n=1K,N,π,T−1t−1).
10: end for
11: ϵb,n,k∼N(0,Id), b=1,…,B, n=1,…,N, k=1,…,K.
12: xb,n,k=μb,n(T+1)+Lb,n(T+1)ϵb,n,k
13: Estimate ∇ϕEπ∼Π[T1∑t=2T+1KL(qt∣∣p)] (21) using collected samples and perform a gradient step on ϕ.
14: end for
15: return uϕ
A.1.2 Full Adaptation Function Details
The adaptation step in our algorithm is detailed here, it consists of the calculation of various features/statistics, 3 MLP layers and a final linear output layer. Some inputs are clamped where required for stability, and the final adaptation is constrained in the amount it is allowed to change the current proposal by.
Per-particle Features First, each particle-weight pair (xs,ws) is processed. Let c(s) denote the index of the proposal component that generated xs, we calculate features:
These are then passed through an MLP, ξ, with: an input layer, a SiLU activation, and a single hidden-layer. Passing the features through ξ:R2d+1→RH, where H is the hidden-dimension, gives a per-particle encoding. These are pooled over each generating component:
hn=∣{j:c(j)=n}∣1s=1∑Sξ(zs,wˉs,gs)1c(s)=n.
Per-component Features The per-component features can mostly be split into 2 main groups of features. The first gives the adaptation access to the current parameters of the proposal, however, to maintain scale-equivariance, the features are relative component-wise features with respect to the global features of the proposal, and where appropriate are rescaled using the proposal's pooled variance:
The second group of features are aimed at providing the adaptation with access to the EM updates. We make use of the EM updates (the non-Rao-Blackwellised version) from the previous section:
νn=Ln−1(μEM−μ),Cn=Ln−1ΣEMLn−T.
Where, in the same style as the first group of features, we have expressed the mean and covariance EM-informed features in terms of a residual with respect to the current parameters.
We also pass in the pooled particle encodings from the previous section, the time index, and the gradients of the log-target evaluated at the current proposal means (this is the feature used by GAPIS (Elvira et al., 2015) to perform its adaptation).
We summarise the component-level features in Table 6. The correlation features are specific to the case of updating a full covariance on each step, in cases where only the diagonal is adapted these are omitted.
Table 6: Summary of component level features.
Feature
Dimension
hn – the pooled particle encodings.
H
ζ(μn−μˉ), position relative to the ensemble.
d
21logΣn,jj−logζ, variance relative to the ensemble.
d
Correlations of Σn.
d(d−1)/2
logNmn – EM mass share.
1
logNαn – Current mixture weight multiplied by N.
1
T−1t−1 – Step index, normalised to [0,1].
1
νn – scaled EM mean residual.
d
logdiag(Cn)−logof the residual EM covariance diagonal.
d
Correlations of Cn.
d(d−1)/2
Ln⊤∇logπ(μn)−Scaled target gradient at the component mean.
d
The features logNmn,logNαn,logdiag(Cn), and LnT∇logπ(μn) are clipped with the function f(x)=51clip(x,±20).
Proposal Parameter Updating The component features in the previous section, denoted featn are passed through 2 single-layer MLP's with SiLU activation functions −ψ∈Rdcomp→RH,ψcross∈R2H→RH where dcomp is the sum of dimensions listed in Table 6 – with a pooling step in order to mix information between components in the mixture, then they are passed through a linear layer with the appropriate output dimension depending on the number of parameters needed to output to adapt the covariance:
We split the output Δn=(Δμn′,ΔLn′), and apply a smooth clamping to the outputs to constrain the maximum adaptation to the proposal:
Δμn=Δμmaxtanh(ΔμmaxΔμn′).(20)
The means are adapted as
μn←μn+LnΔμn.
To adapt the covariances Σn, we split ΔLn′∈R2d(d+1) into a d-dimensional component Δlogσ′, and (if the full covariance is used to parametrise the mixture) a matrix, Kn′, with lower triangular values given by the remaining 2d(d−1) components. These adaptations are constrained as Δlogσ=21ΔLmaxtanh(ΔLmaxΔlogσ′) and (Kn)ij=ΔLmaxtanh(ΔLmax(Kn′)ij). Then, adapt the current Ln by:
Ln←LnAn,An=diag(eΔlogσ)+Kn.
Parameter Count The number of learnt parameters in this model depends on the form of the covariance. In our main experiments we used a diagonal covariance so the correlation features in Table 6 are omitted so dcomp=H+5d+3. This gives a parameter count of (2d+1)H+H+H2+H)+(dcompH+H)+(2H2+H)+(2dH+2d), where we have used brackets to separate the parameter counts for ξ,ψ,ψcross, and the final layer (W,b). See Table 7 for the exact parameter count in our experiments.
Cost The cost of the AAIS algorithm above in terms of target density evaluations, counting gradient evaluations as double cost (one forward pass + backward pass), is:
C=2N(K+1)(T+1).
This is calculated as: NK(T+1) evaluations of the density and its gradient at the samples xs with cost 2NK(T+1), added to the gradient at the component means μn giving a further 2N(T+1) cost.
A.2 Scale Equivariance of AAIS
Here we give the precise statement about the equivariance properties of our AAIS algorithm and give the brief proof. This is specific to our implementation of AAIS.
Lemma A.1. Let π∗(x)=π(ax−b) and uϕ be the AAIS adaptation function as in §A.1, then, if we denote the output parameters from the adaptation function as
Proof. The proof proceeds by showing the scale-invariance of the procedure which produces the Δn. From there, the adaptation to μn is:
aμn+b←aμn+b+aLnΔμn=a(μn+LnΔμn)+b,
and the covariance adaptation is:
aLn←aLnAn,An=(diag(eΔlogσ2)+Kn).
Starting with the per-particle features which are encoded, note first that the weights ws will be identical because of the way π∗ is defined, let ys=axs+b be the transformed particles given to the function, then:
so the pooled variance scales as we would expect it to.
Thus all the features that lead into producing Δn are invariant under a linear transformation, so the statement follows using the argument given at the start.
This has a useful corollary:
Corollary A.2. Let a given AAIS rollout's proposal parameters on each step be {μn(t),Ln(t)}n=1,t=1N,T+1 then, assuming that the target is changed such that the new target π∗(x)=π(ax−b) and the same random noises are used throughout, using the same trained AAIS network parameters and starting the rollout at {aμn(1)+b,aLn(1)}n=1N will give the sequence of proposal parameters {aμn(t)+b,aLn(t)}n=1,t=1N,T+1.
Proof. The proof follows by repeated application of Theorem A.1 throughout the AAIS iterations.
Informally, the usefulness of this corollary is that if a trained set of parameters ϕ works well for a particular problem, then it will work similarly for the scaled version of the problem. As an example, imagine that a set of parameters can sample a Gaussian with mean μ and variance σ2 well, then it will be able to sample a Gaussian of mean aμ+b and variance a2σ2 in the same fashion as long as the starting proposal parameters are transformed accordingly.
A.3 Non-equivariant Version
The non-equivariant version of AAIS, evaluated in Tables 13 and 14, adds in absolute features into the adaptation, breaking equivariance but allowing for learning the scale of the target. The non-equivariant adaptation function takes the same form as that described in §A.1 with additional component-level features μn, logdiag(Ln), logs – the component mean, log of the diagonal of the scale matrix, and log of the pooled proposal standard deviation (19). The output is also given an extra d values Δμnabs and the mean adaptation becomes μn←μn+LnΔμn+lϕΔμnabs where lϕ∈R is a learnt scale for the adaptation.
B EXPERIMENTAL DETAILS
Here we give details of our experimental setup. All experiments were performed on a cluster using NVIDIA L40S GPU's, per training run these took approximately 3 minutes for the lower dimensional training runs up to 15 minutes for the d = 50 runs. Our models are lightweight enough to run on CPU, although the batching over many targets during training is significantly sped up through GPU use.
B.1 Training Details
Our objective function requires estimation of KL(qt∥p). In order to maintain stable training when q and π are mismatched, we use compression with arcsin on the log-density ratio, the estimator we use is:
C=30 was chosen so that the compression has a negligible effect for ratios within a suitable range and only compresses extreme values.
The Adam optimiser (Kingma and Ba, 2015) is used with a cosine scheduled learning rate starting at 3×10−3 and with minimum learning rate (3×10−3)⋅201.
Annealing was performed through training to aid stability with a temperature schedule, as in Algorithm 3, κ(epoch)=0.3+(1−0.3)⋅min(1,0.1⋅Nepochsepoch).
After training, the final model is chosen by selecting the model at the epoch with the lowest loss on a held out set of targets from the family.
B.2 Target Densities
Here we detail the different choices for target families II. Both Bayesian posteriors are based on similar posteriors from Gelman et al. (1995).
Funnel A family consisting of Neal's funnel (Neal, 2003) in d-dimensions, a single target has the form:
x1∼N(0,σ2),xi∣x1∼N(0,ex1),i=2,…,d.
The family of distributions obtained by sampling σ∼U[23,3].
Banana A product of independent 2-dimensional banana distributions as in Haario et al. (1999). An individual block is given by:
x1∼N(0,σ12),x2∼N(b(x12−σ12),σ22),
where σ12,σ22 and b are the variances and the curvature. The samples are then rotated by some angle θ. The parameters for every block are sampled as b∼U[101,51],σ1∼U[1,3],σ2∼U[21,23],θ∼U[0,2π], and, if d is even, an individual target is formed by composing 2d blocks, if d is odd then 2d−1 blocks are composed along with a final independent Gaussian N(0,σ12).
Bayesian Linear Regression Posterior This is a Bayesian linear regression model. Let r be the number of parameters of the linear model, define a design matrix X∈Rndata×r, parameter vector β∈Rr, variance σ2∈R, and the hyperparameters a,b∈R. Let y∈Rndata be the response, the model is:
which can be tractably sampled from by sampling σ2∼Inv−Gamma(a∗,b∗) followed by β∣σ2∼N(μ,σ2V−1). To ensure every sampling method produces valid σ2 values, each method produces samples of logσ2 instead and we adjust the above posterior accordingly. The above also has tractable expected values for the parameters to be sampled, which can be used instead of approximations for evaluation.
We take V0=101Ir,a0=b0=1,μ0=0. Only the data and the parameters of the data generating process differ between targets in the family. We give the details below.
The data generating process randomly constructs the design matrix X such that the family has a range of different difficulties within it, we do this by randomly sampling X with a given condition number κ (approximately) and with a random rotation:
Xi∼N(0,Σ),i=1,…,r,Σ=QDQT,(22)
where Q is a random orthogonal r×r matrix formed by taking the QR decomposition of a r×r matrix of i.i.d. standard Gaussian random variables, and D is the diagonal matrix with elements si2 where logsi=ri−1logκ−logκ.
this gives the smallest and largest singular values of Σ as 1 and κ2 respectively, so the condition number of Σ is exactly κ2, for each target we sample log10κ∼U[0,2] so κ∈[1,100].
After generating X, the data is produced as:
yi∼N(Xβ∗,(σ∗)2),i=1,…,ndata,(23)
where remaining parameters are sampled as β∗∼N(0,4Ir) and σ∗∼U[103,23]. We also randomise the number of data points ndata∼U[3r,12r].
Hierarchical Bayesian Posterior This is a hierarchical Bayesian model. In d-dimensions, let J=d−2, then the model is given by:
To differ members within a family of such distributions, we use different sets of generated data with different parameters for the data generating process: we use μ∗,τ∗,θj∗ to indicate the true parameters used in the data generation for a particular target, then the data generating process is μ∗∼N(0,25),τ∗∼U[21,8],θj∗∼N(μ∗,(τ∗)2),yj∼N(θj∗,σj2), we also randomise the known σj2 as σj2∼U[2,18], so each target not only varies in the data y supplied, but also in the likelihood model itself.
In order to obtain ground truth samples to use as reference for evaluations, we see that, for a given (μ,τ), we can simply sample θj as
where Γ(qT+1,p) is the set of probability measures with marginals qT+1 and p, Sd−1={ω∈Rd:∣∣ω∣∣=1}, τw(x)=ωTx is the projection of x∈Rd onto ω, and (τω)#p is the pushforward of p by τω. We compute the Monte Carlo estimate of this by sampling projections ω, and we calculate the distance between the empirical distributions of qT+1 and p formed by 300 samples from each. This metric is denoted “sliced W1prop” in our tables.
Effective Sample Size The effective sample size for an AIS output with weights {w(xs(t))}s=1,t=1S,T+1 is
ESS=∑t∑sw(xs(t))2(∑t∑sw(xs(t)))2,(26)
and we report the normalised version S(T+1)1ESS∈[0,1].
Error in Log-Estimate of Normalising Constant We compute the estimate of Z:
Z=S(T+1)1t=1∑T+1s=1∑Sw(xs(t)),(27)
and then report ∣logZ−logZ∣.
Sliced 1-Wasserstein Distance with Resampled Points This is the same calculation as the previous sliced 1-Wasserstein distance, except that the empirical distribution for qT+1 is not formed from new samples from the final proposal, but instead by sampling with replacement from the final S samples on the last step of the AIS procedure proportional to their importance weights.
KL divergence We compute the estimated KL(qT+1∥p) as
and then take the absolute error between this and E[f(x)] estimated by 20000 draws from π.
B.4 Hyperparameters
Table 7 gives the hyperparameters used in the experiments. We vary the value of K in order to maintain a matched cost for each sampler. The GAPIS step size λ was chosen by selecting the best value (in terms of sliced 1-Wasserstein distance of the final proposal to the target) from a grid of 11 different values. The Δμmax parameter for AAIS that controls the maximum amount the proposal means can shift between time steps (see §A.1) was increased for the Bayesian linear regression problem. Other, fixed, parameters are the number of training epochs Nepochs=1500, and the target batch size used during training B=32.
Table 7: Hyperparameter settings for experiments. The final three columns are specific to AAIS, the Num. params column was calculated using the formula from §A.1.
Target Family
d
N
T
K(AAIS)
K(DM−PMC)
K(M−PMC)
K(GAPIS)
λ(GAPIS)
Δμmax
H
Num. params.
BLR d5
5
10
15
15
32
32
25
1e−05
3.0
32
5802
Hierarchical d5
5
10
15
15
32
32
25
1e−05
1.0
32
5802
Funnel d5
5
10
15
15
32
32
25
0.01
1.0
32
5802
Banana d5
5
10
15
15
32
32
25
0.03
1.0
32
5802
BLR d25
25
25
15
15
32
32
6
1e−05
3.0
64
31346
Hierarchical d25
25
25
15
15
32
32
6
1e−05
1.0
64
31346
Funnel d25
25
25
15
15
32
32
6
0.0003
1.0
64
31346
Banana d25
25
25
15
15
32
32
6
0.03
1.0
64
31346
Funnel d50
50
50
15
25
53
53
5
0.0001
1.0
128
124260
Banana d50
50
50
15
25
53
53
5
0.03
1.0
128
124260
C ADDITIONAL EXPERIMENTS
Here we give the results of various ablation experiments performed, as well as extra metrics for the experiments presented in the main text.
C.1 Target Gradient Ablation
Here we show the effect of removing the gradient information from the features of the update function. Table 8 shows that removing the gradient features from the model is detrimental, particularly on the Bayesian linear regression problem.
Table 8: Experimental results showing the effect of removing target gradients as features in the adaptation function ( §A.1) note that this still uses target gradients when performing gradient descent in training. Metrics reported follow the convention of Table 1. All targets are at d=25.
Target Family
Method ↓ Metric →
sliced W1prop↓
rev. KL ↓
logZerr.↓
E[x]err.↓
BLR
With gradient features
1.174±0.0333(2.600)
409.9±3.154(1.0×103)
374.4±4.126(994.0)
6.832±0.2652(15.645)
No gradient features
5.300±1.431(6.316)
1.1×103±157.7(1.8×103)
790.1±22.984(1.4×103)
19.601±1.304(25.856)
Hierarchical
With gradient features
0.9877±0.0201(2.414)
2.157±0.0160(3.137)
1.279±0.0215(2.194)
4.531±0.0769(12.805)
No gradient features
1.151±0.0501(2.963)
2.515±0.0460(4.160)
1.426±0.0569(2.583)
5.134±0.0410(15.701)
Funnel
With gradient features
0.5069±0.0061(1.082)
0.1535±0.0032(0.2379)
0.2672±0.0074(0.4131)
0.6550±0.1238(2.128)
No gradient features
0.5200±0.0059(1.095)
0.2003±0.0055(0.3083)
0.2784±0.0061(0.4373)
0.5170±0.0218(1.560)
Banana
With gradient features
1.093±0.0069(1.492)
6.112±0.0565(7.823)
2.127±0.0138(3.341)
4.295±0.0227(6.514)
No gradient features
1.079±0.0040(1.548)
7.048±0.0381(9.012)
2.207±0.0190(4.196)
4.396±0.0934(6.846)
C.2 EM Features Ablation
Here we show the effect of removing the EM update features from §A.1. Table 9 shows that there is no single best choice on all d=25 families, but EM features perform well on the hierarchical and funnel families. We opted to use them on all families to reduce the amount of per-family tuning that occurs.
Table 9: Experimental results showing the effect of the EM features in the adaptation model. Metrics reported follow the convention of Table 1. All targets are at d=25.
Target Family
Method ↓ Metric →
sliced W1prop↓
rev. KL ↓
logZerr.↓
E[x]err.↓
BLR
With EM features
1.174±0.0333(2.600)
409.9±3.154(1.0×103)
374.4±4.126(994.0)
6.832±0.2652(15.645)
No EM features
0.9059±0.0132(1.908)
357.5±5.075(960.2)
335.0±4.293(916.3)
5.496±0.0735(11.569)
Hierarchical
With EM features
0.9877±0.0201(2.414)
2.157±0.0160(3.137)
1.279±0.0215(2.194)
4.531±0.0769(12.805)
No EM features
1.255±0.0103(3.175)
2.683±0.0571(4.568)
1.512±0.0402(2.838)
5.239±0.0698(13.861)
Funnel
With EM features
0.5069±0.0061(1.082)
0.1535±0.0032(0.2379)
0.2672±0.0074(0.4131)
0.6550±0.1238(2.128)
No EM features
0.5486±0.0096(1.218)
0.2895±0.0444(0.4191)
0.2871±0.0020(0.4446)
0.6850±0.0509(2.014)
Banana
With EM features
1.093±0.0069(1.492)
6.112±0.0565(7.823)
2.127±0.0138(3.341)
4.295±0.0227(6.514)
No EM features
1.081±0.0001(1.458)
5.974±0.0550(7.592)
2.057±0.0554(3.302)
4.286±0.0425(6.671)
C.3 Objective Choice
Here we give results for using differing objectives. We give the full results for the use different stochastic divergences D (Table 11), and also investigate the effect of removing the step-wise objective and of removing the pathwise gradient through the rollout.
Table 10 shows the effect of removing one of either the step-wise objective or the gradients propagating through the whole trajectory. There is no one choice that is uniformly best, but using both seems to give the most consistent results.
C.4 Covariance Structure
Here we compare using an isotropic variance, a diagonal variance (as used in our experiments), and a full covariance matrix. Table 12 shows the effect of the different possible covariance parametrisations. We found the diagonal covariance to be the most stable in our experiments.
Table 10: Experimental results showing the effect of three different objective structures, a terminal only objective that uses pathwise gradients that flow through the whole trajectory, and a step-wise objective with no gradients flowing between steps in the trajectory, full model has step-wise objectives and also gradients flowing through the whole trajectory. Metrics reported follow the convention of Table 1. All targets are at d=25.
Target Family
Method ↓ Metric →
sliced W1prop↓
rev. KL ↓
logZerr.↓
E[x]err.↓
BLR
Full model
1.174±0.0333(2.600)
409.9±3.154(1.0×103)
374.4±4.126(994.0)
6.832±0.2652(15.645)
Terminal objective only
2.706±0.6514(3.839)
717.5±101.8(1.3×103)
604.1±97.197(1.1×103)
12.982±3.012(20.797)
Step-wise
0.8079±0.0069(1.701)
320.2±2.461(871.4)
310.9±2.342(858.9)
5.005±0.0412(10.651)
Hierarchical
Full model
0.9877±0.0201(2.414)
2.157±0.0160(3.137)
1.279±0.0215(2.194)
4.531±0.0769(12.805)
Terminal objective only
2.184±0.1925(3.297)
7.913±0.6277(11.317)
2.727±0.2046(4.947)
10.343±0.5920(18.960)
Step-wise
1.227±0.0190(2.463)
2.377±0.0102(4.292)
1.404±0.0219(2.434)
4.881±0.1296(10.874)
Funnel
Full model
0.5069±0.0061(1.082)
0.1535±0.0032(0.2379)
0.2672±0.0074(0.4131)
0.6550±0.1238(2.128)
Terminal objective only
0.5172±0.0042(1.109)
0.1971±0.0094(0.3104)
0.4416±0.0188(0.6401)
0.9632±0.1450(2.622)
Step-wise
0.5615±0.0638(1.201)
0.2207±0.0622(0.3148)
0.2858±0.0114(0.4576)
0.6370±0.0193(1.863)
Banana
Full model
1.093±0.0069(1.492)
6.112±0.0565(7.823)
2.127±0.0138(3.341)
4.295±0.0227(6.514)
Terminal objective only
0.9906±0.0079(1.379)
5.396±0.1244(7.116)
1.543±0.0322(2.646)
4.135±0.0219(6.599)
Step-wise
1.126±0.0014(1.571)
6.778±0.0132(8.601)
2.427±0.0287(3.934)
4.431±0.0575(6.524)
Table 11: Experimental results showing the effect of three different divergences in the objective. Metrics reported follow the convention of Table 1. All targets are at d=25. A “-” indicates that the mean could not be calculated due to a numerical divergence.
Target Family
Method ↓ Metric →
sliced W1prop↓
rev. KL ↓
logZerr.↓
E[x]err.↓
BLR
KL(qt∣p)
1.174±0.0333(2.600)
409.9±3.154(1.0×103)
374.4±4.126(994.0)
6.832±0.2652(15.645)
KL(p∣qt) (SNIS)
118.2±94.077(128.3)
1.3×1014±1.8×1014(2.6×1035)
1.6×103±1.4×103(5.0×103)
21.066±1.232(27.944)
KL(p∣qt) (oracle draws)
2.344±0.4549(3.144)
1.5×1019±2.7×1019(1.1×1014)
583.8±41.198(1.1×103)
11.520±1.502(18.700)
Hierarchical
KL(qt∣p)
0.9877±0.0201(2.414)
2.157±0.0160(3.137)
1.279±0.0215(2.194)
4.531±0.0769(12.805)
KL(p∣qt) (SNIS)
-
-
-
-
KL(p∣qt) (oracle draws)
-
-
-
-
Funnel
KL(qt∣p)
0.5069±0.0061(1.082)
0.1535±0.0032(0.2379)
0.2672±0.0074(0.4131)
0.6550±0.1238(2.128)
KL(p∣qt) (SNIS)
58.695±4.989(64.920)
1.6×103±1.3×103(3.0×103)
4.496±0.7189(6.445)
13.183±0.8694(28.047)
KL(p∣qt) (oracle draws)
1.225±0.3780(2.005)
1.0×1011±1.8×1011(8.1×103)
0.2145±0.0077(0.3352)
0.6345±0.0102(1.753)
Banana
KL(qt∣p)
1.093±0.0069(1.492)
6.112±0.0565(7.823)
2.127±0.0138(3.341)
4.295±0.0227(6.514)
KL(p∣qt) (SNIS)
0.8083±0.0209(0.9314)
94.821±4.839(125.1)
6.705±0.6376(11.362)
7.443±0.0841(10.325)
KL(p∣qt) (oracle draws)
0.5676±0.0151(0.7589)
408.9±88.470(1.1×103)
1.130±0.0392(2.398)
4.552±0.0809(8.082)
Table 12: Experimental results showing the effect of using different parametrisations for the proposal covariance. Metrics reported follow the convention of Table 1. An * indicates that only 2 out of the 3 training seeds were stable. All targets are at d=25.
Target Family
Method ↓ Metric →
sliced W1prop↓
rev. KL ↓
logZerr.↓
E[x]err.↓
BLR
Diagonal
1.174±0.0333(2.600)
409.9±3.154(1.0×103)
374.4±4.126(994.0)
6.832±0.2652(15.645)
Isotropic
1.956±0.2392(2.927)
615.5±45.231(1.1×103)
495.5±40.974(1.0×103)
9.346±1.027(16.318)
Full
262.0±270.3(288.0)
1.4×105±2.5×105(3.8×105)
827.1±34.365(1.5×103)
21.699±1.606(29.616)
Hierarchical
Diagonal
0.9877±0.0201(2.414)
2.157±0.0160(3.137)
1.279±0.0215(2.194)
4.531±0.0769(12.805)
Isotropic*
2.710±0.0008(5.984)
14.136±0.2302(22.366)
5.371±0.0832(13.536)
11.226±0.1195(27.474)
Full
8.314±11.169(12.147)
157.2±256.7(328.0)
11.193±14.756(17.452)
16.326±14.053(29.943)
Funnel
Diagonal
0.5069±0.0061(1.082)
0.1535±0.0032(0.2379)
0.2672±0.0074(0.4131)
0.6550±0.1238(2.128)
Isotropic
1.277±0.0069(2.059)
1.564±0.0150(1.848)
0.8495±0.0168(1.112)
1.459±0.0009(2.102)
Full
0.5139±0.0027(1.108)
0.2111±0.0107(0.3171)
0.2779±0.0064(0.4398)
0.6449±0.0436(1.574)
Banana
Diagonal
1.093±0.0069(1.492)
6.112±0.0565(7.823)
2.127±0.0138(3.341)
4.295±0.0227(6.514)
Isotropic
1.124±0.0019(1.554)
6.739±0.0051(8.484)
2.375±0.0196(3.770)
4.378±0.0107(6.478)
Full*
1.074±0.0008(1.515)
6.078±0.0086(7.864)
2.090±0.0150(3.396)
4.308±0.0083(6.639)
C.5 Equivariance
The scale-equivariance of our AAIS implementation gives the algorithm greater generalisation abilities, at the cost of some performance on the family it was trained on, as can be seen in Tables 13 and 14, where we compare with a non-equivariant adaptation function (§A.3). We hypothesise this is because the non-equivariant sampler learns information about the scale that is useful for sampling within the family, but is detrimental when applied to a modified family.
Table 13: Experimental results showing the effect of using a model that is not scale-equivariant §A.3. Metrics reported follow the convention of Table 1. All targets are at d=25.
Target Family
Method ↓ Metric →
sliced W1prop↓
rev. KL ↓
logZ err. ↓
E[x] err. ↓
BLR
Scale-equivariant
1.174±0.0333(2.600)
409.9±3.154(1.0×103)
374.4±4.126(994.0)
6.832±0.2652(15.645)
Not scale-equivariant
1.461±0.0976(2.529)
542.4±16.950(1.2×103)
466.2±15.175(1.0×103)
8.135±0.4538(14.913)
Hierarchical
Scale-equivariant
0.9877±0.0201(2.414)
2.157±0.0160(3.137)
1.279±0.0215(2.194)
4.531±0.0769(12.805)
Not scale-equivariant
1.052±0.0421(3.274)
2.192±0.1499(3.985)
0.9876±0.0388(1.950)
4.132±0.0887(14.853)
Funnel
Scale-equivariant
0.5069±0.0061(1.082)
0.1535±0.0032(0.2379)
0.2672±0.0074(0.4131)
0.6550±0.1238(2.128)
Not scale-equivariant
0.5076±0.0036(1.105)
0.1486±0.0018(0.2277)
0.2304±0.0044(0.3747)
0.5341±0.0807(1.515)
Banana
Scale-equivariant
1.093±0.0069(1.492)
6.112±0.0565(7.823)
2.127±0.0138(3.341)
4.295±0.0227(6.514)
Not scale-equivariant
1.046±0.0004(1.444)
5.869±0.0307(7.593)
2.008±0.0154(3.319)
4.386±0.0219(6.669)
Table 14: Experimental results showing the generalisation of the equivariant AAIS and a non-equivariant AAIS §A.3 to shifted targets of the same form. Metrics reported follow the convention of Table 1.
Base Target
Shift ↓ Method →
Equivariant
Non-equivariant
Banana (d=5)
Curvature range:
[101,21]→[21,1]
1.365±0.0344(2.459)
1.395±0.0184(2.593)
Curvature range:
[101,21]→[1,2]
2.912±0.0520(5.382)
3.197±0.0251(5.970)
BLR (d=5)
β∗∼N(0,4Ip)→β∗∼N(0,64Ip)
3.980±0.0428(7.859)
4.331±0.0666(8.379)
β∗∼N(0,4Ip)→β∗∼N(0,400Ip)
12.231±0.0404(20.850)
12.897±0.1075(21.379)
nrange:[3p,12p]→[12p,48p]
0.7802±0.0302(2.521)
0.8313±0.0859(2.477)
nrange:[3p,12p]→[48p,192p]
0.8607±0.0162(2.648)
1.086±0.2062(2.863)
Funnel (d=5)
x1 variance range:
[23,3]→[3,29]
3.280±0.0184(7.076)
3.125±0.0261(6.939)
x1 variance range:
[23,3]→[29,6]
21.723±0.0426(59.748)
-
Hierarchical (d=5)
τ range:
[21,8]→[8,20]
1.848±0.1378(5.819)
2.494±0.0916(9.985)
τ range:
[21,8]→[20,32]
- (16.400)
-
Banana (d=25)
Curvature range:
[101,21]→[21,1]
2.493±0.0234(3.211)
2.526±0.0078(3.323)
Curvature range:
[101,21]→[1,2]
4.253±0.0454(5.549)
4.876±0.0158(6.439)
BLR (d=25)
β∗∼N(0,4Ip)→β∗∼N(0,64Ip)
3.366±0.0550(5.645)
5.233±0.0538(6.910)
β∗∼N(0,4Ip)→β∗∼N(0,400Ip)
11.207±0.2200(15.456)
14.769±0.1202(18.548)
nrange:[3p,12p]→[12p,48p]
1.310±0.0673(2.897)
1.763±0.1611(3.148)
nrange:[3p,12p]→[48p,192p]
1.512±0.0747(3.192)
2.107±0.1921(3.678)
Funnel (d=25)
x1 variance range:
[23,3]→[3,29]
3.609±0.0564(8.537)
3.603±0.0229(8.592)
x1 variance range:
[23,3]→[29,6]
24.502±0.0988(65.907)
-
Hierarchical (d=25)
τ range:
[21,8]→[8,20]
3.767±0.0882(7.176)
6.486±0.4556(14.981)
τ range:
[21,8]→[20,32]
- (13.854)
-
C.6 Neural Capacity
Here we show the effect of network capacity by differing the hidden dimension of the neural networks used in the adaptation function. In Table 15 we see generally that increasing the hidden dimension yields better results.
Table 15: Experimental results showing the effect of increasing the hidden dimension used in the MLP layers of the adaptation function (§A.1). Metrics reported follow the convention of Table 1. All targets are at d=25.
Target Family
Hidden dim. ↓ Metric →
sliced W1prop↓
rev. KL ↓
logZerr.↓
E[x]err.↓
BLR
H=64
1.174±0.0333(2.600)
409.9±3.154(1.0×103)
374.4±4.126(994.0)
6.832±0.2652(15.645)
H=16
3.119±0.1201(3.784)
758.6±16.843(1.3×103)
644.2±16.823(1.2×103)
14.417±0.8210(21.133)
H=32
1.808±0.1249(2.609)
602.8±22.304(1.1×103)
484.6±20.098(992.2)
8.506±0.5306(14.841)
H=128
1.687±0.1518(3.390)
527.6±24.223(1.2×103)
448.7±22.353(1.1×103)
8.904±0.9462(18.417)
Hierarchical
H=64
0.9877±0.0201(2.414)
2.157±0.0160(3.137)
1.279±0.0215(2.194)
4.531±0.0769(12.805)
H=16
2.813±0.0464(3.642)
13.661±0.6366(18.976)
3.318±0.1224(5.651)
11.879±0.2681(20.676)
H=32
1.300±0.0295(3.383)
3.207±0.1227(5.951)
1.651±0.0667(3.040)
5.711±0.1024(15.312)
H=128
0.7749±0.0127(1.673)
1.687±0.0207(2.571)
1.059±0.0069(1.824)
3.764±0.0740(10.390)
Funnel
H=64
0.5069±0.0061(1.082)
0.1535±0.0032(0.2379)
0.2672±0.0074(0.4131)
0.6550±0.1238(2.128)
H=16
2.833±0.2592(3.203)
2.200±0.0906(2.840)
1.265±0.0686(1.596)
2.769±0.1653(4.694)
H=32
0.5644±0.0160(1.247)
0.2447±0.0102(0.3586)
0.2977±0.0161(0.4720)
0.5783±0.0436(1.698)
H=128
0.5019±0.0041(1.068)
0.1478±0.0056(0.2205)
0.2610±0.0050(0.4050)
0.6051±0.0082(1.691)
Banana
H=64
1.093±0.0069(1.492)
6.112±0.0565(7.823)
2.127±0.0138(3.341)
4.295±0.0227(6.514)
H=16
0.6292±0.0107(0.8657)
24.527±0.2351(30.369)
6.734±0.1963(10.040)
5.299±0.0465(8.114)
H=32
1.142±0.0098(1.598)
6.902±0.0425(8.885)
2.411±0.0348(3.775)
4.375±0.0058(6.627)
H=128
1.029±0.0021(1.446)
5.004±0.0154(6.429)
1.872±0.0087(2.986)
4.135±0.0205(6.177)
C.7 Generalisation to Dissimilar Families
Here we explore the result of training AAIS on one category of target family and evaluating on another. Table 16 shows that each family is best sampled by the sampler that was trained on it – as expected. The sampler trained on the Banana family appears to generalise the best to the other families. All the samplers show limited generalisation performance when evaluated on the Bayesian hierarchical family.
Table 16: Experimental results showing the generalisation of a trained AAIS algorithm to targets from different families. Metrics reported follow the convention of Table 1.
Trained on ↓
Evaluated on →
Banana
BLR
Funnel
Hierarchical
d=5
Banana
0.5072±0.0042(1.132)
1.790±0.1044(3.365)
0.9594±0.0191(1.709)
3.040±0.0285(6.533)
BLR
1.516±0.0204(2.158)
0.7486±0.0271(2.397)
1.598±0.0177(2.336)
3.607±0.0194(6.645)
Funnel
0.7655±0.0175(1.349)
2.415±0.1542(4.008)
0.4658±0.0016(0.9783)
2.877±0.0391(6.540)
Hierarchical
0.9649±0.0458(1.698)
4.585±1.097(8.091)
1.107±0.0319(1.843)
0.8718±0.0289(1.500)
d=25
Banana
1.093±0.0069(1.492)
1.581±0.0354(2.745)
1.045±0.0203(1.872)
3.985±0.0198(8.518)
BLR
1.610±0.0280(1.955)
1.174±0.0334(2.602)
1.480±0.0490(2.378)
4.234±0.0647(8.567)
Funnel
1.294±0.1043(1.680)
1.848±0.1444(2.702)
0.5069±0.0061(1.082)
3.783±0.0331(8.079)
Hierarchical
1.179±0.0258(1.607)
2.466±0.0576(4.047)
1.152±0.0756(1.931)
0.9878±0.0201(2.414)
C.8 Additional Metrics for Main Text Experiments
Here we give the full set of metrics for the experiments in the main text: funnel (Table 17) and the Bayesian hierarchical family (Table 21). We also show experiments for the banana family (Table 18) and the Bayesian linear regression (Table 20) family, and a mixture of 5 Gaussians (Table 19).
Table 21: Experimental results for the Bayesian hierarchical model d=5,25. Metrics reported follow the convention of Table 1.
Method
Metric →
sliced W1prop↓
sliced W1↓
rev. KL ↓
ESS ↑
logZerr.↓
E[x]err.↓
E∥x∥2err.↓
d=5
AAIS
0.8718±0.029(1.50)
1.077±0.017(2.23)
1.120±0.021(1.43)
0.0358±0.003(0.002)
0.5812±0.007(0.972)
1.678±0.066(4.08)
39.313±1.213(94.82)
DM-PMC
1.594(3.16)
1.650(3.33)
81.933(316.4)
0.0120(0.001)
0.8585(1.69)
2.575(6.85)
62.201(182.2)
M-PMC
2.005(4.31)
1.999(3.93)
10.592(28.46)
0.0081(0.000)
1.674(3.81)
3.707(9.78)
68.642(187.8)
GAPIS
138.7(543.3)
4.140(8.03)
1.8×106(8.9×106)
0.0016(0.000)
2.449(5.90)
6.160(14.54)
86.651(242.6)
True samples
0.3458(0.565)
0.4084(0.665)
0.0000(0.000)
1.000(1.00)
0.0000(0.000)
0.0900(0.182)
1.432(4.17)
d=25
AAIS
0.9877±0.020(2.41)
1.201±0.028(3.01)
2.157±0.016(3.14)
0.0125±0.001(0.001)
1.279±0.022(2.19)
4.531±0.077(12.81)
193.4±1.506(763.2)
DM-PMC
3.675(6.99)
3.815(7.02)
125.9(208.6)
0.0003(0.000)
20.770(33.99)
19.843(39.56)
710.4(2.4×103)
M-PMC
5.413(9.27)
5.420(9.29)
137.3(169.1)
0.0001(0.000)
48.089(76.65)
29.205(52.29)
742.7(2.6×103)
GAPIS
429.0(1.2×103)
8.042(11.18)
7.5×107(2.9×108)
0.0007(0.000)
19.314(41.64)
39.403(60.79)
1.2×103(2.7×103)
True samples
0.3343(0.598)
0.3607(0.657)
0.0000(0.000)
1.000(1.00)
0.0000(0.000)
0.1370(0.274)
3.084(9.11)
Table 22: Experimental results showing the performance of AAIS amortised over a single target vs over a whole family, all targets are at d=25. Metrics reported follow the convention of Table 1.