betaFeedback

WorksMathematics

Amortised adaptive importance sampling

Abstract

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.

Code available here.

Introduction

We consider the problem of sampling from a distribution over Rd\mathbb{R}^d with probability density function

p(x)=1Zπ(x),Z=∫Rdπ(x) dx,(1)p(x) = \frac{1}{Z}\pi(x), \qquad Z = \int_{\mathbb{R}^d} \pi(x)\,\mathrm{d}x, \tag*{(1)}

where we assume that we only have access to an unnormalised density π∝p\pi\propto p. We also consider the related problem of estimating integrals of the form:

I=Ex∼p[f(x)]=∫Rdf(x)p(x) dx.(2)I = \mathbb{E}_{x\sim p}[f(x)] = \int_{\mathbb{R}^d} f(x)p(x)\,\mathrm{d}x. \tag*{(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 [22] and statistical mechanics (Noé et al., 2019). One may want to solve both problems for many related distributions pp and test functions ff.

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 ([31, 26, 42, 34]). Another common category of Monte Carlo methods are importance sampling algorithms, which sample particles from some proposal distribution and reweight them ([17]).

There are various iterative versions of importance sampling, with multiple rounds of particle reweighting, including annealed importance sampling ([33]), sequential Monte Carlo ([10]), and methods that adapt the proposal towards the target, known as adaptive importance sampling (AIS; [7, 6, 5]). 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, 2008; Elvira et al., 2023; Akyildiz and Míguez, 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 [20] to expressive dynamics-based approaches [3]. Amortised importance sampling methods include Müller et al. [32], who parametrise the proposal using normalising flows. See Gabrié [21] 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. [23]; Sun et al. [45]; Klein et al. [28]; Klein and Noé [29].

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 (Figure 1). Empirically, we show the benefit of amortisation within an AIS procedure over AIS algorithms with static adaptation rules (Figure 2).

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−1q_{t-1} are supplied to a neural network that predicts the parameters of the next iteration’s proposal qtq_t. During training, the neural network is updated to minimise a divergence between all steps’ proposals and the target distribution pp. Training is over many distributions from a family; once trained, the sampler can be used for new targets in the same family.

Samples generated by the final step proposal for each method

Figure 2. Samples generated by the final step proposal for each method for 50-dimensional funnel (top row) with N=50N = 50 components in the proposal mixture, and 5-dimensional banana (bottom row) with N=10N = 10 components in the proposal mixture, each projected into their first two coordinates.

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.

Preliminaries

Importance Sampling

Importance sampling is a Monte Carlo algorithm that allows for estimating integrals of the form given by (2) without requiring samples from pp. Instead, samples {xs}s=1S\{x_s\}_{s=1}^{S} are drawn from a proposal distribution, qq, and the corresponding Monte Carlo estimator of II is appropriately reweighted:

I^=1SZ∑s=1Sw(xs)f(xs),w(xs)=π(xs)q(xs).(3)\hat{I} = \frac{1}{SZ} \sum_{s=1}^{S} w(x_s)f(x_s), \qquad w(x_s) = \frac{\pi(x_s)}{q(x_s)}. \tag*{(3)}

This estimator is unbiased and consistent, and setting q=pq=p recovers the standard Monte Carlo estimator for (2). If ZZ is unknown, it can be substituted with an estimator:

Z^=1S∑s=1Sw(xs).(4)\hat{Z} = \frac{1}{S}\sum_{s=1}^{S} w(x_s). \tag*{(4)}

Replacing ZZ in (3) with Z^\hat{Z}, we obtain the self-normalised importance sampling (SNIS) estimator:

I^SNIS=∑s=1Sw(xs)f(xs)∑s=1Sw(xs)=∑s=1Swˉ(xs)f(xs),(5)\hat{I}_{\mathrm{SNIS}} = \frac{\sum_{s=1}^{S}w(x_s)f(x_s)}{\sum_{s=1}^{S}w(x_s)} = \sum_{s=1}^{S}\bar{w}(x_s)f(x_s), \tag*{(5)}
wˉ(xs)=w(xs)∑s′=1Sw(xs′).(6)\bar{w}(x_s) = \frac{w(x_s)}{\sum_{s'=1}^{S}w(x_{s'})}. \tag*{(6)}

This estimator is biased but consistent. In our experiments, we only consider the SNIS estimator.

The choice of the proposal distribution qq is crucial to the efficiency of importance sampling. In particular, the variance of Z^\hat{Z} is proportional to the χ2\chi^2 divergence between the target and the proposal, and large discrepancies between the two distributions may lead to highly variable weights and poor estimates [1]. 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.

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 TT steps. Let q1q_1 be the initial proposal, at step tt: sample xs(t)∼qtx_s^{(t)} \sim q_t, s=1,…,Ss=1,\ldots,S; compute weights w(xs(t))w(x_s^{(t)}) using (3); and then adapt the proposal to obtain qt+1q_{t+1}; see Algorithm 1. One option is to construct the self-normalised AIS estimator of II:

I^AIS=∑t=1T+1∑s=1Sw(xs(t))f(xs(t))∑t=1T+1∑s=1Sw(xs(t)).(7)\hat{I}_{\mathrm{AIS}} = \frac{\sum_{t=1}^{T+1}\sum_{s=1}^{S} w(x_s^{(t)})f(x_s^{(t)})}{\sum_{t=1}^{T+1}\sum_{s=1}^{S} w(x_s^{(t)})}. \tag*{(7)}

Beyond improving the efficiency of importance sampling estimators, AIS can be used to construct proposals qtq_t that progressively approximate the target pp. The resulting approximation to pp may be useful in its own right, for example, to draw posterior samples in a Bayesian problem and estimate posterior predictives.

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: SS, TT, initial proposal q1q_1, target density π\pi.
1: for t=1,…,Tt=1,\ldots,T do
2: Draw SS samples {xs(t)}s=1S\{x_s^{(t)}\}_{s=1}^{S} from qtq_t
3: Calculate w(xs(t))w(x_s^{(t)}), s=1,…,Ss=1,\ldots,S
4: Adapt qt→qt+1q_t \to q_{t+1}
5: end for
6: Draw and weight samples from qT+1q_{T+1}
7: return S(T+1)S(T+1) pairs of samples and their weights, {(ws(t),xs(t))}s=1,t=1S,T+1\{(w_s^{(t)},x_s^{(t)})\}_{s=1,t=1}^{S,T+1}, and the proposals q1:T+1q_{1:T+1}.

Table 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 [7, 18]; geometry-based approaches, which exploit gradient and curvature information from the target to adapt the locations and covariance matrices of the proposal components (GAPIS; [19]) (GRAMIS; [16]); and parametric fitting approaches, where the proposal parameters are adapted to better approximate the target. The latter include moment-matching schemes, as in AMIS [9], as well as methods that formulate the adaptation explicitly as the minimisation of a statistical divergence between the proposal and the target [43, 2].

We propose AAIS, which replaces the prespecified adaptation rule of AIS with a learnt function uϕu_\phi. 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ϕu_\phi with learnable parameters ϕ\phi. At step tt, this function takes in the observables, O1:tO_{1:t}, of the AIS rollout up to and including time tt (e.g., target density evaluations, gradients) as well as the proposals up to time tt, q1:tq_{1:t}, and output the new proposal qt+1q_{t+1}.

Let RR denote the output of an AIS procedure (Algorithm 1) – the pairs of samples with their weights from each step and the proposals q1:T+1q_{1:T+1}. The parameters of this adaptation function, uϕu_\phi, can then be trained to minimise some real-valued objective, D(R,π,f)\mathcal{D}(R,\pi,f), which takes in the AIS output, RR, as well as the target density π\pi and, if desired, the function ff for which the expectation in (2) is to be estimated. The output, RR, of AIS is random, so the objective is to minimise:

ℓ(ϕ)=ER[D(R,π,f)],(8)\ell(\phi) = \mathbb{E}_{R}\left[\mathcal{D}(R,\pi,f)\right], \tag*{(8)}

with respect to the parameters ϕ\phi.

An example choice for D\mathcal{D} is the KL divergence of the final proposal to the target π\pi:

D(R,π,f)=KL⁡(qT+1∥p)−log⁡Z(9)\mathcal{D}(R,\pi,f) = \operatorname{KL}(q_{T+1} \mathbin\Vert p) - \log Z \tag*{(9)}
=∫RdqT+1(x)log⁡qT+1(x)π(x) dx.(10)= \int_{\mathbb{R}^{d}} q_{T+1}(x) \log\frac{q_{T+1}(x)}{\pi(x)} \, \mathrm{d}x. \tag*{(10)}

Note that RR depends on ϕ\phi, so extra care is required in order to perform gradient descent on (8). The RE-INFORCE estimator Williams, [46] can be used, or certain choices of the qtq_t can allow reparametrisation.

Many choices for D\mathcal{D} are possible; we explore some of them empirically in § 4.4 and C.3. For notational simplicity, we will drop the dependence of D\mathcal{D} on ff, since in our experiments the objectives do not depend on it.

Amortisation over Distribution Families All AIS algorithms use information about the target distribution pp, via its unnormalised density π\pi 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 Figure 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 π∼Π\pi\sim\Pi, where Π\Pi is a distribution over unnormalised density functions, by minimising (8) in expectation over π\pi:

ℓ(ϕ)=Eπ∼Π[ER[D(R,π)]],(11)\ell(\phi) = \mathbb{E}_{\pi\sim\Pi}\left[\mathbb{E}_{R}\left[\mathcal{D}(R,\pi)\right]\right], \tag*{(11)}

in a similar way to that considered in Paige and Wood [39]; Golinski et al. [23]. Algorithm 2 details the training of the uϕu_\phi. Once trained, the uϕu_\phi 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 RR is dependent on both the adaptation rule parameters ϕ\phi and the target π\pi, so the objective in (11) aims for the best proposal for every individual π\pi sampled from Π\Pi.

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)u_{\pi}^{*}(O_{1:t},q_{1:t}) for a proposal qtq_t with a single target π\pi is:

uπ∗(O1:t,q1:t)=arg⁡min⁡qt+1 ER[D(R,π)∣O1:t,q1:t].(12)u_{\pi}^{*}(O_{1:t},q_{1:t}) = \underset{q_{t+1}}{\arg\min}\ \mathbb{E}_{R}\left[\mathcal{D}(R,\pi) \mid O_{1:t},q_{1:t}\right]. \tag*{(12)}

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 Π\Pi is:

uΠ∗(O1:t,q1:t)=arg⁡min⁡qt+1 Eπ∼Π[ER[D(R,π)∣O1:t,q1:t]]=arg⁡min⁡qt+1 ∫ER[D(R,π)∣O1:t,q1:t] dΠ(π∣O1:t).(13)\begin{aligned} u_{\Pi}^{*}(O_{1:t},q_{1:t}) = \underset{q_{t+1}}{\arg\min}\ \mathbb{E}_{\pi\sim\Pi}\left[\mathbb{E}_{R}\left[\mathcal{D}(R,\pi) \mid O_{1:t},q_{1:t}\right]\right] \\ &= \underset{q_{t+1}}{\arg\min}\ \int\mathbb{E}_{R}\left[\mathcal{D}(R,\pi) \mid O_{1:t},q_{1:t}\right] \, \mathrm{d}\Pi(\pi\mid O_{1:t}). \tag*{(13)} \end{aligned}

Comparing this with the single-target optimal adaptation, we note the additional weighting by the posterior probability of each π\pi given the observed O1:tO_{1:t}. So, in a Bayesian decision theory framework with loss ER[D(R,π)∣O1:t,q1:t]\mathbb{E}_{R}[\mathcal{D}(R,\pi) \mid O_{1:t},q_{1:t}], the optimal AAIS adaptation coincides with the optimal decision.

In the preceding setup, using intermediate targets πt\pi_t in the objective is also possible. The adaptation rule uϕu_\phi 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\mathcal{D}, the parametrisation of uϕu_\phi, and the form of proposal.

We parametrise our proposals as equally-weighted Gaussian mixtures with NN components:

qt(x)=1N∑n=1NN(μn(t),Σn(t)),(14)q_t(x) = \frac{1}{N}\sum_{n=1}^{N} \mathcal{N}\left(\mu_n^{(t)},\Sigma_n^{(t)}\right), \tag*{(14)}

where the μn(t)\mu_n^{(t)} and Σn(t)\Sigma_n^{(t)} are adapted at each step. We use a diagonal Σn(t)\Sigma_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ϕu_\phi produces additive adaptations to the μn(t)\mu_n^{(t)} and multiplicative adaptations to the Σn(t)\Sigma_n^{(t)}, taking in only the current time step’s information and proposal – the samples xs(t)x_s^{(t)}, their weights w(xs(t))w(x_s^{(t)}), target gradient evaluations at the xs(t)x_s^{(t)} and μn(t)\mu_n^{(t)}, the time step tt, and qtq_t. We use a neural network structure similar to Zaheer et al. [48] 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\mathcal{D} is a step-wise KL divergence:

D(R,π)=1T∑t=2T+1KL(qt∥p)+const.(15)\mathcal{D}(R, \pi) = \frac{1}{T}\sum_{t=2}^{T+1}\mathrm{KL}(q_t \mathbin\Vert p) + \mathrm{const}. \tag*{(15)}

To allow for gradients to propagate from KL(qt∥p)\mathrm{KL}(q_t \mathbin\Vert 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. [18], where an equal number of samples are taken from each component in qtq_t.

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.

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. [18]) – a resampling based adaptation rule, mixture PMC (M-PMC; Cappé et al. [6]) – an EM adaptation rule (equivalent to minimising the KL divergence between the target and a Gaussian mixture proposal qtq_t, KL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t)), and the gradient adaptive population importance sampler (GAPIS; Elvira et al. [19]) – 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

– a resampling based adaptation rule, mixture PMC (M-PMC; Cappé et al. [6]) – an EM adaptation rule (equivalent to minimising the KL divergence between the target and a Gaussian mixture proposal qtq_t, KL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t)), and the gradient adaptive population importance sampler (GAPIS; Elvira et al. [19]) – 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. [4]) between the final proposal and the target (sliced W1propW_1^{\mathrm{prop}}), the effective sample size (ESS) using the temporal mixture of all proposals, and the error in the estimated log-normalising constant log⁡Z\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.

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, [34]):

x1∼N(0,σ2),x2:d∣x1∼N(0,ex1Id−1).(16)x_1 \sim\mathcal{N}(0,\sigma^2), \qquad x_{2:d} \mid x_1 \sim\mathcal{N}(0,e^{x_1}I_{d-1}). \tag*{(16)}
Method ↓ Metric →sliced W1propW_1^{\mathrm{prop}} ↓ESS ↑log ZZ err. ↓
d=5d=5
AAIS0.4658 ±0.002 (0.978)0.2605 ±0.008 (0.015)0.1250 ±0.005 (0.241)
DM-PMC0.9592 (1.69)0.0301 (0.002)0.2691 (0.537)
M-PMC0.7222 (1.43)0.0965 (0.004)0.1777 (0.347)
GAPIS1.678 (2.44)0.0055 (0.001)0.4400 (1.05)
True samples0.4451 (0.848)1.000 (1.00)0.0000 (0.000)
d=25d=25
AAIS0.5069 ±0.006 (1.08)0.1953 ±0.006 (0.003)0.2672 ±0.007 (0.413)
DM-PMC1.423 (2.22)0.0004 (0.000)4.277 (7.06)
M-PMC2.060 (2.85)0.0003 (0.000)10.626 (13.29)
GAPIS1.125 (1.68)0.0013 (0.000)9.789 (12.11)
True samples0.4787 (0.941)1.000 (1.00)0.0000 (0.000)
d=50d=50
AAIS0.5123 ±0.002 (1.11)0.1327 ±0.003 (0.002)0.2921 ±0.003 (0.437)
DM-PMC1.837 (2.65)0.0001 (0.000)18.597 (22.77)
M-PMC2.263 (3.07)0.0001 (0.000)22.685 (26.08)
GAPIS1.070 (1.64)0.0006 (0.000)23.015 (26.58)
True samples0.4830 (0.967)1.000 (1.00)0.0000 (0.000)

Table 1. Experimental results for Funnel d=5,25,50d=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.

We turn this into a family of distributions by randomly sampling σ∼U[32,3]\sigma\sim\mathcal{U}\left[\frac{3}{2},3\right].

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. Figure 2 (top) shows samples taken from the final proposal, qT+1q_{T+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 – Figure 2 (bottom) – where amortisation performs similarly well, see Table 18 for full results.

Method ↓ Metric →sliced W1propW^{\mathrm{prop}}_1 ↓sliced W1W_1 ↓rev. KL ↓ESS ↑log ZZ err. ↓E[x]E[x] err. ↓E∥x∥2E\lVert x\rVert^2 err. ↓
d=5d=5
AAIS0.5072 ±0.004 (1.13)0.5685 ±0.016 (1.25)0.4092 ±0.008 (0.867)0.1301 ±0.003 (0.006)0.1988 ±0.011 (0.453)0.9676 ±0.029 (2.44)9.373 ±0.085 (27.18)
DM-PMC0.7214 (1.38)0.6353 (1.35)3.493 (6.80)0.0466 (0.003)0.2104 (0.473)0.9608 (2.17)9.273 (27.58)
M-PMC0.5467 (1.25)0.5637 (1.27)2.151 (5.65)0.0619 (0.002)0.2597 (0.68)0.9823 (2.41)8.910 (25.39)
GAPIS1.214 (1.69)0.9583 (1.57)162.3 (675.6)0.0053 (0.001)0.5060 (1.09)1.207 (2.30)6.848 (22.08)
True samples0.2041 (0.339)0.2487 (0.408)0.0000 (0.000)1.000 (1.00)0.0000 (0.000)0.0610 (0.117)0.4696 (1.55)
d=25d=25
AAIS1.093 ±0.007 (1.49)1.275 ±0.011 (1.90)6.112 ±0.056 (7.82)0.0032 ±0.000 (0.000)2.127 ±0.014 (3.34)4.295 ±0.023 (6.61)70.088 ±0.358 (113.7)
DM-PMC1.356 (1.91)1.699 (2.29)27.645 (41.22)0.0004 (0.000)5.999 (9.25)6.206 (8.75)58.521 (99.73)
M-PMC2.239 (2.64)2.247 (2.66)114.9 (140.8)0.0001 (0.000)26.816 (36.92)8.774 (11.09)31.910 (88.34)
GAPIS0.5332 (0.645)1.848 (2.51)445.5 (707.8)0.0010 (0.000)10.795 (14.04)6.815 (9.97)40.659 (85.92)
True samples0.2357 (0.292)0.2583 (0.333)0.0000 (0.000)1.000 (1.00)0.0000 (0.000)0.0980 (0.134)0.8277 (2.35)
d=50d=50
AAIS1.196 ±0.016 (1.58)1.482 ±0.006 (2.06)13.702 ±0.186 (16.68)0.0004 ±0.000 (0.000)5.208 ±0.149 (7.47)7.071 ±0.033 (10.02)154.4 ±0.762 (218.1)
DM-PMC1.761 (2.28)2.159 (2.68)75.504 (106.1)0.0001 (0.000)24.740 (34.40)12.437 (16.33)80.898 (163.7)
M-PMC2.394 (2.68)2.397 (2.69)275.8 (303.4)0.0000 (0.000)68.704 (91.90)13.831 (16.22)50.547 (128.0)
GAPIS0.4102 (0.480)2.047 (2.51)101.2 (88.85)0.0004 (0.000)29.252 (34.85)10.948 (14.38)80.799 (152.2)
True samples0.2424 (0.282)0.2470 (0.291)0.0000 (0.000)1.000 (1.00)0.0000 (0.000)0.0857 (0.110)0.7316 (1.99)

Table 18. Experimental results for Banana d=5,25,50d=5,25,50. Metrics reported follow the convention of Table 1.

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:

μ∼N(0,σμ2),log⁡τ∼N(0,στ2),j=1,…,J,(17)\mu\sim\mathcal{N}(0,\sigma_{\mu}^{2}), \qquad\log\tau\sim\mathcal{N}(0,\sigma_{\tau}^{2}), \qquad j=1,\ldots,J, \tag*{(17)}
yj∣θj∼N(θj,σj2),θj∣μ,τ∼N(μ,τ2).(18)y_j \mid\theta_j \sim\mathcal{N}(\theta_j,\sigma_j^{2}), \qquad\theta_j \mid\mu,\tau\sim\mathcal{N}(\mu,\tau^{2}). \tag*{(18)}

The σj2\sigma_j^{2} are assumed to be known, and the task is to infer θ1:J,μ\theta_{1:J},\mu, and τ\tau, so d=J+2d=J+2. To form a family of distributions we randomly sample: observations y1:Jy_{1:J}, the parameters of the data generating process θ1:J,μ,τ\theta_{1:J},\mu,\tau, and the likelihood model parameters σj2\sigma_j^{2}. 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

Method ↓ Metric →sliced W1propW_1^{\mathrm{prop}} ↓ESS ↑log ZZ err. ↓
d=5d=5
AAIS0.8718 ±0.029 (1.50)0.0358 ±0.003 (0.002)0.5812 ±0.007 (0.972)
DM-PMC1.594 (6.19)0.0120 (0.001)0.8585 (1.69)
M-PMC2.005 (4.31)0.0081 (0.000)1.674 (3.81)
GAPIS138.7 (543.3)0.0016 (0.000)2.449 (5.90)
True samples0.3458 (0.565)1.000 (1.00)0.0000 (0.000)
d=25d=25
AAIS0.9877 ±0.020 (2.41)0.0125 ±0.001 (0.001)1.279 ±0.022 (2.19)
DM-PMC3.675 (6.99)0.0003 (0.000)20.770 (33.99)
M-PMC5.413 (9.27)0.0001 (0.000)48.089 (76.65)
GAPIS429.0 (1.2 × 10310^3)0.0007 (0.000)19.314 (41.64)
True samples0.3343 (0.598)1.000 (1.00)0.0000 (0.000)

Table 2. Experimental results for the Bayesian hierarchical model d=5,25d=5,25. Metrics reported follow the convention of Table 1.

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\sigma_j^{2}). We also evaluate performance on a Bayesian linear regression (BLR) problem in Table 20, where AAIS performs similarly well.

Method ↓ Metric →sliced W1propW^{\mathrm{prop}}_1 ↓sliced W1W_1 ↓rev. KL ↓ESS ↑log ZZ err. ↓E[x]E[x] err. ↓E∥x∥2E\lVert x\rVert^2 err. ↓
d=5d=5
AAIS0.7489 ±0.027 (2.39)0.7158 ±0.031 (2.41)25.102 ±1.016 (90.71)0.0140 ±0.001 (0.000)21.971 ±1.398 (85.87)1.869 ±0.081 (6.14)3.852 ±0.125 (17.16)
DM-PMC1.099 (2.20)0.7844 (2.07)2.0×1032.0\times10^3 (6.4×1036.4\times10^3)0.0005 (0.000)14.359 (54.53)1.419 (4.65)3.311 (11.96)
M-PMC2.263 (4.17)2.223 (4.18)114.1 (262.1)0.0016 (0.000)111.3 (257.0)5.941 (11.14)50.751 (91.58)
GAPIS34.469 (163.6)2.999 (4.71)6.8×1036.8\times10^3 (1.5×1041.5\times10^4)0.0003 (0.000)69.437 (144.8)5.895 (10.22)30.323 (75.57)
True samples0.0169 (0.030)0.0199 (0.036)0.0000 (0.000)1.000 (1.00)0.0000 (0.000)0.0048 (0.011)0.0104 (0.027)
d=25d=25
AAIS1.174 ±0.033 (2.60)1.091 ±0.044 (2.49)409.9 ±3.154 (1.0×1031.0\times10^3)0.0004 ±0.000 (0.000)374.4 ±4.126 (994.0)6.832 ±0.265 (15.64)33.606 ±5.746 (140.9)
DM-PMC2.033 (3.41)1.838 (3.33)938.4 (1.8×1031.8\times10^3)0.0001 (0.000)524.6 (1.6×1031.6\times10^3)11.236 (20.26)112.4 (310.3)
M-PMC3.180 (3.95)3.180 (3.95)2.0×1032.0\times10^3 (6.0×1036.0\times10^3)0.0001 (0.000)1.9×1031.9\times10^3 (6.4×1036.4\times10^3)19.805 (24.38)234.6 (350.7)
GAPIS279.4 (1.4×1031.4\times10^3)3.269 (3.95)2.0×1052.0\times10^5 (1.0×1051.0\times10^5)0.0005 (0.000)804.8 (1.4×1031.4\times10^3)19.089 (23.66)225.5 (358.0)
True samples0.0047 (0.009)0.0051 (0.009)0.0000 (0.000)1.000 (1.00)0.0000 (0.000)0.0020 (0.004)0.0056 (0.018)

Table 20. Experimental results for Bayesian linear regression d=5,25d=5,25. Metrics reported follow the convention of Table 1.

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.

Target FamilyAmortised overEvaluated onlog ZZ err. ↓
FunnelSingle target FamilySingle target0.2656 ±0.0062 (0.3187)
0.2647 ±0.0081 (0.3222)
FunnelSingle target FamilyFamily0.2661 ±0.0049 (0.4080)
0.2672 ±0.0074 (0.4131)
BananaSingle target FamilySingle target1.096 ±0.0005 (1.529)
1.500 ±0.0244 (2.102)
Single target FamilyFamily2.563 ±0.0315 (4.500)
2.127 ±0.0138 (3.340)
HierarchicalSingle target FamilySingle target0.9722 ±0.0194 (1.208)
1.281 ±0.0208 (1.572)
Single target FamilyFamily4.720 ±0.1137 (15.600)
1.279 ±0.0214 (2.196)
BLRSingle target FamilySingle target293.7 ±5.751 (335.1)
428.8 ±7.762 (461.9)
Single target FamilyFamily605.2 ±9.940 (1.1 × 10310^3)
374.3 ±4.139 (998.9)

Table 3. Performance of AAIS amortised over a single target vs over a whole family, all targets are at d=25d=25. Metrics reported follow the convention of Table 1.

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 ρ\rho from in (16) from [32,3]\left[\frac{3}{2},3\right] to [3,92]\left[3,\frac{9}{2}\right]. 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.

Base TargetShift ↓, Method →AAISDM-PMCM-PMCGAPIS
Banana (d=5d = 5)Curvature range: [110,12]→[12,1]\left[\frac{1}{10},\frac{1}{2}\right] \to\left[\frac{1}{2},1\right]1.365±0.03441.365 \pm0.0344 (2.459)(2.459)1.5301.530 (3.040)(3.040)1.5181.518 (2.951)(2.951)1.3871.387 (1.996)(1.996)
Curvature range: [110,12]→[1,2]\left[\frac{1}{10},\frac{1}{2}\right] \to[1,2]2.912±0.05202.912 \pm0.0520 (5.382)(5.382)3.3703.370 (6.450)(6.450)3.4293.429 (6.192)(6.192)2.2782.278 (4.172)(4.172)
BLR (d=5d = 5)β∗∼N(0,4Ir)→β∗∼N(0,64Ir)\beta^{*} \sim\mathcal{N}(0,4I_r) \to\beta^{*} \sim\mathcal{N}(0,64I_r)3.980±0.04283.980 \pm0.0428 (7.859)(7.859)1.3231.323 (4.059)(4.059)5.1085.108 (9.767)(9.767)131.1131.1 (611.8)(611.8)
β∗∼N(0,4Ir)→β∗∼N(0,400Ir)\beta^{*} \sim\mathcal{N}(0,4I_r) \to\beta^{*} \sim\mathcal{N}(0,400I_r)12.231±0.040412.231 \pm0.0404 (20.850)(20.850)6.7936.793 (16.909)(16.909)13.20313.203 (22.528)(22.528)684.2684.2 (3.8×103)(3.8 \times10^{3})
nn range: [3r,12r]→[12r,48r][3r,12r] \to[12r,48r]0.7802±0.03020.7802 \pm0.0302 (2.521)(2.521)1.1521.152 (2.197)(2.197)2.6242.624 (4.347)(4.347)132.9132.9 (668.3)(668.3)
nn range: [3r,12r]→[48r,192r][3r,12r] \to[48r,192r]0.8607±0.01620.8607 \pm0.0162 (2.648)(2.648)1.1901.190 (2.101)(2.101)2.7532.753 (4.494)(4.494)515.2515.2 (2.5×103)(2.5 \times10^{3})
Funnel (d=5d = 5)x1x_1 variance range: [32,3]→[3,92]\left[\frac{3}{2},3\right] \to\left[3,\frac{9}{2}\right]3.280±0.01843.280 \pm0.0184 (7.076)(7.076)3.9553.955 (7.728)(7.728)3.9703.970 (7.916)(7.916)3.9273.927 (7.551)(7.551)
x1x_1 variance range: [32,3]→[32,6]\left[\frac{3}{2},3\right] \to\left[\frac{3}{2},6\right]21.723±0.042621.723 \pm0.0426 (59.748)(59.748)22.25622.256 (60.264)(60.264)22.38522.385 (60.376)(60.376)21.53121.531 (58.947)(58.947)
Hierarchical (d=5d = 5)τ\tau range: [12,8]→[8,20]\left[\frac{1}{2},8\right] \to[8,20]1.848±0.13781.848 \pm0.1378 (5.819)(5.819)3.5813.581 (8.298)(8.298)4.9294.929 (12.708)(12.708)9.2×10129.2 \times10^{12} (5.0×1013)(5.0 \times10^{13})
τ\tau range: [12,8]→[20,32]\left[\frac{1}{2},8\right] \to[20,32]-9.2209.220 (19.125)(19.125)12.10012.100 (24.291)(24.291)-
Banana (d=25d = 25)Curvature range: [110,12]→[12,1]\left[\frac{1}{10},\frac{1}{2}\right] \to\left[\frac{1}{2},1\right]2.493±0.02342.493 \pm0.0234 (3.211)(3.211)2.7512.751 (3.606)(3.606)3.3403.340 (4.011)(4.011)1.1091.109 (1.684)(1.684)
Curvature range: [110,12]→[1,2]\left[\frac{1}{10},\frac{1}{2}\right] \to[1,2]4.253±0.04544.253 \pm0.0454 (5.549)(5.549)5.1145.114 (6.662)(6.662)5.5565.556 (7.076)(7.076)3.2453.245 (4.806)(4.806)
BLR (d=25d = 25)β∗∼N(0,4Ir)→β∗∼N(0,64Ir)\beta^{*} \sim\mathcal{N}(0,4I_r) \to\beta^{*} \sim\mathcal{N}(0,64I_r)3.366±0.05503.366 \pm0.0550 (5.645)(5.645)4.1644.164 (6.531)(6.531)6.8256.825 (8.417)(8.417)1.4×1031.4 \times10^{3} (7.3×103)(7.3 \times10^{3})
β∗∼N(0,4Ir)→β∗∼N(0,400Ir)\beta^{*} \sim\mathcal{N}(0,4I_r) \to\beta^{*} \sim\mathcal{N}(0,400I_r)11.207±0.220011.207 \pm0.2200 (15.456)(15.456)13.43913.439 (17.379)(17.379)15.99015.990 (19.547)(19.547)7.3×1037.3 \times10^{3} (3.9×104)(3.9 \times10^{4})
nn range: [3r,12r]→[12r,48r][3r,12r] \to[12r,48r]1.310±0.06731.310 \pm0.0673 (2.897)(2.897)1.9611.961 (3.197)(3.197)3.1813.181 (3.852)(3.852)1.1×1031.1 \times10^{3} (5.5×103)(5.5 \times10^{3})
nn range: [3r,12r]→[48r,192r][3r,12r] \to[48r,192r]1.512±0.07471.512 \pm0.0747 (3.192)(3.192)1.9621.962 (3.212)(3.212)3.1773.177 (3.954)(3.954)5.2×1035.2 \times10^{3} (3.0×104)(3.0 \times10^{4})
Funnel (d=25d = 25)x1x_1 variance range: [32,3]→[3,92]\left[\frac{3}{2},3\right] \to\left[3,\frac{9}{2}\right]3.609±0.05643.609 \pm0.0564 (8.537)(8.537)4.6504.650 (9.820)(9.820)5.7605.760 (10.868)(10.868)4.1544.154 (8.906)(8.906)
x1x_1 variance range: [32,3]→[32,6]\left[\frac{3}{2},3\right] \to\left[\frac{3}{2},6\right]24.502±0.098824.502 \pm0.0988 (65.907)(65.907)25.41725.417 (66.595)(66.595)26.83426.834 (67.877)(67.877)24.58024.580 (65.867)(65.867)
Hierarchical (d=25d = 25)τ\tau range: [12,8]→[8,20]\left[\frac{1}{2},8\right] \to[8,20]3.767±0.08823.767 \pm0.0882 (7.176)(7.176)10.28810.288 (14.992)(14.992)12.93612.936 (18.187)(18.187)2.7×10132.7 \times10^{13} (1.1×1014)(1.1 \times10^{14})
τ\tau range: [12,8]→[20,32]\left[\frac{1}{2},8\right] \to[20,32]-19.28119.281 (26.756)(26.756)22.52022.520 (30.694)(30.694)-

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.

Objective Choice

In Table 5 we compare different choices for divergence inside (15) instead of KL⁡(qt∥p)\operatorname{KL}(q_t \mathbin\Vert p). We compare using KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) estimated either with a SNIS-estimator or using true target samples (oracle draws). The KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) estimated with true target samples achieves better performance on the two synthetic densities, but we were unable to achieve stable training of AAIS with either KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) 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.

Target FamilyObjective ↓Metric →log⁡Z\log Z err. ↓
FunnelKL⁡(qt∥p)\operatorname{KL}(q_t \mathbin\Vert p)0.2672±0.00740.2672 \pm0.0074 (0.4131)(0.4131)
KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) (SNIS)4.4960±0.71894.4960 \pm0.7189 (6.445)(6.445)
KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) (oracle draws)0.2145±0.00770.2145 \pm0.0077 (0.3352)(0.3352)
BananaKL⁡(qt∥p)\operatorname{KL}(q_t \mathbin\Vert p)2.127±0.01382.127 \pm0.0138 (3.341)(3.341)
KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) (SNIS)6.7050±0.63766.7050 \pm0.6376 (11.362)(11.362)
KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) (oracle draws)1.130±0.03921.130 \pm0.0392 (2.398)(2.398)
HierarchicalKL⁡(qt∥p)\operatorname{KL}(q_t \mathbin\Vert p)1.279±0.02151.279 \pm0.0215 (2.194)(2.194)
KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) (SNIS)-
KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) (oracle draws)-
BLRKL⁡(qt∥p)\operatorname{KL}(q_t \mathbin\Vert p)374.4±4.126374.4 \pm4.126 (994.0)(994.0)
KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) (SNIS)1.6×103±1.4×1031.6 \times10^{3} \pm1.4 \times10^{3} (5.0×103)(5.0 \times10^{3})
KL⁡(p∥qt)\operatorname{KL}(p \mathbin\Vert q_t) (oracle draws)583.8±41.198583.8 \pm41.198 (1.1×103)(1.1 \times10^{3})

Table 5. Effect of three different divergences in the AAIS objective. Metrics reported follow the convention of Table 1. All targets are at d=25d = 25. A “-” indicates that the mean could not be calculated due to numerical divergence.

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 stepwise 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).

Method ↓ Metric →sliced W1propW^{\mathrm{prop}}_1 ↓sliced W1W_1 ↓rev. KL ↓ESS ↑log ZZ err. ↓E[x]E[x] err. ↓E∥x∥2E\lVert x\rVert^2 err. ↓
d=2d=2
Learn’t0.6752 ±0.008 (1.579)0.4618 ±0.004 (1.200)0.2126 ±0.032 (0.5842)0.4159 ±0.0054 (0.0371)0.1191 ±0.0022 (0.4545)0.4452 ±0.0067 (1.262)0.9646 ±0.1329 (3.482)
DM-PMC1.116 (2.179)0.8316 (1.856)1.199 (2.092)0.1341 (0.0073)0.1933 (0.4949)0.6694 (1.910)1.110 (2.738)
M-PMC0.3899 (0.9256)0.3840 (0.9017)0.254 (0.6037)0.4153 (0.0352)0.0840 (0.3159)0.3541 (1.278)0.6824 (2.382)
GAPIS0.7924 (1.595)0.5031 (1.269)0.4298 (0.9473)0.3072 (0.0115)0.1297 (0.4825)0.4465 (1.477)0.9507 (3.225)
True samples0.1862 (0.3086)0.2578 (0.4077)0.0000 (0.0000)1.0000 (1.0000)0.0000 (0.0000)0.0505 (0.1023)0.1148 (0.2929)
d=5d=5
Learn’t0.7183 ±0.0043 (1.200)0.5029 ±0.0048 (0.9176)0.3738 ±0.0023 (0.7057)0.2325 ±0.0012 (0.0095)0.2625 ±0.0030 (0.5819)0.9929 ±0.0063 (2.060)2.545 ±0.0308 (7.899)
DM-PMC1.251 (2.170)1.208 (2.205)3.393 (4.342)0.0457 (0.0085)0.0494 (1.585)2.559 (5.81)4.223 (10.547)
M-PMC1.578 (2.502)1.588 (2.504)1.532 (2.642)0.0929 (0.0008)1.237 (1.946)3.369 (5.651)6.179 (14.867)
GAPIS0.7138 (1.194)0.4777 (0.8853)0.3551 (0.7013)0.2661 (0.0066)0.2188 (0.5239)0.9343 (2.171)2.116 (6.743)
True samples0.1965 (0.3019)0.2303 (0.3374)0.0000 (0.0000)1.000 (1.000)0.0000 (0.0000)0.0612 (0.1118)0.1294 (0.3106)
d=25d=25
Learn’t0.5869 ±0.0012 (0.9770)0.2691 ±0.0034 (0.5840)0.2416 ±0.0072 (0.5675)0.1370 ±0.0018 (0.0044)0.3041 ±0.0022 (0.5076)1.036 ±0.0124 (3.098)2.918 ±0.0906 (13.044)
DM-PMC1.838 (2.153)2.102 (2.451)22.754 (27.329)0.0004 (0.0001)3.386 (5.442)10.139 (12.222)20.518 (48.346)
M-PMC2.390 (2.634)2.394 (2.633)177.4 (213.7)0.0001 (0.0001)87.586 (115.1)10.349 (12.579)34.230 (70.776)
GAPIS0.5476 (0.9472)0.3533 (0.6209)0.6309 (1.057)0.0284 (0.0018)0.0610 (0.9685)2.163 (5.333)5.237 (17.045)
True samples0.1905 (0.2713)0.2085 (0.3031)0.0000 (0.0000)1.000 (1.000)0.0000 (0.0000)0.0943 (0.1493)0.1951 (0.5108)

Table 19. Experimental results for GMM5 d=2,5,25d=2,5,25. Metrics reported follow the convention of Table 1.

Finally, we also give extra metrics for the results presented in the preceding subsections (§C.8).

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. [14]; Han and Liu [25]; El-Laham and Bugallo [12]; Akyildiz and Míguez [2]; Perello and Akyildiz [40] – these methods learn in an online fashion rather than amortising. Dowling et al. [11] 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 [13] 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. [8]; Sun et al. [44], 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. [28]; Klein and Noé [29]. Closely related is the area of amortised Bayesian inference, where amortisation is over datasets; such works include Ritchie et al. [41]; Paige and Wood [39]; Le et al. (2017), and Golinski et al. (AMCI; [23], 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.

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. [23].

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 ff (see e.g., Owen [37]); the methods suggested by Golinski et al. [23] 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.

Further AAIS details

Here we give details of the AAIS algorithm (Algorithm 2) and our implementation (Algorithm 3).

Algorithm 2 Amortised Adaptive Importance Sampling

Require: SS, TT, adaptation function uϕu_{\phi}, NepochsN_{\mathrm{epochs}}, target family Π\Pi, proposal initialisation family Q\mathcal{Q}, divergence/loss DD, batch size BB.

  1. for epoch =1,…,Nepochs=1,\ldots,N_{\mathrm{epochs}} do

  2. Draw a random batch of targets, πb∼Π\pi_b \sim\Pi, b=1,…,Bb=1,\ldots,B

  3. Draw a random starting proposal qb,1∼Qq_{b,1} \sim\mathcal{Q}

  4. for t=1,…,Tt=1,\ldots,T do

  5. Draw xb,s(t)∼qb,tx_{b,s}^{(t)} \sim q_{b,t}, s=1,…,Ss=1,\ldots,S, b=1,…,Bb=1,\ldots,B.

  6. Calculate wb,s(t)=w(xb,s(t))w_{b,s}^{(t)} = w(x_{b,s}^{(t)}), s=1,…,Ss=1,\ldots,S, b=1,…,Bb=1,\ldots,B, using (3).

  7. Calculate observables Ob,tO_{b,t}, b=1,…,Bb=1,\ldots,B.

  8. Adapt qb,t+1=uϕ(qb,1:t,Ob,1:t)q_{b,t+1}=u_{\phi}(q_{b,1:t},O_{b,1:t}), b=1,…,Bb=1,\ldots,B.

  9. end for

  10. Draw and weight xb,s(T+1)∼qb,T+1x_{b,s}^{(T+1)} \sim q_{b,T+1}, s=1,…,Ss=1,\ldots,S, b=1,…,Bb=1,\ldots,B.

  11. Compute D(q1:T+1,{(xb,n,k(t),wb,s(t))}s=1,t=1S,T+1,π))D(q_{1:T+1},\{(x_{b,n,k}^{(t)},w_{b,s}^{(t)})\}_{s=1,t=1}^{S,T+1},\pi)) for b=1,…,Bb=1,\ldots,B.

  12. Estimate ∇ϕEπ∼Π[E[D(q1:T+1,{(xb,n,k(t),wb,s(t))}s=1,t=1S,T+1,π)]]\nabla_{\phi}\mathbb{E}_{\pi\sim\Pi}[\mathbb{E}[D(q_{1:T+1},\{(x_{b,n,k}^{(t)},w_{b,s}^{(t)})\}_{s=1,t=1}^{S,T+1},\pi)]] and update ϕ\phi.

  13. end for

  14. return uϕu_{\phi}

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.

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, gg, with components gng_n, n=1,…,Nn=1,\ldots,N, fitted to the sample-weight pairs {(xs,ws)}s=1S\{(x_s,w_s)\}_{s=1}^{S}, ws=w(xs)w_s=w(x_s) from (3), as in Cappé et al. [6], is given by the updates:

αnEM=∑swsρn,s∑sws,μnEM=∑swsρn,sxs∑sρn,sws,ΣnEM=∑iwsρn,s(xs−μnEM)(xs−μnEM)T∑iwsρs\alpha_n^{EM}=\frac{\sum_s w_s\rho_{n,s}}{\sum_s w_s},\qquad \mu_n^{EM}=\frac{\sum_s w_s\rho_{n,s}x_s}{\sum_s \rho_{n,s}w_s},\qquad \Sigma_n^{EM}=\frac{\sum_i w_s\rho_{n,s}(x_s-\mu_n^{EM})(x_s-\mu_n^{EM})^T}{\sum_i w_s\rho_s}

where

ρn,s=1c(s)=n,\rho_{n,s}=\mathbb{1}_{c(s)=n},

where c(i)c(i) denotes the index of the component that generated sample xix_i.

The M-PMC ([6]) algorithm we use as a baseline makes use of the suggested Rao-Blackwellised version where instead ρn,s=αngn(xs)∑j=1Nαjgj(xs)\rho_{n,s}=\frac{\alpha_n g_n(x_s)}{\sum_{j=1}^{N}\alpha_j g_j(x_s)} is the probability of xsx_s being generated by proposal nn, 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 π\pi as an input. This is used as notational convenience to mean that density evaluations and gradient evaluations of π\pi are used as input, see §A.1.

Require: Number of components NN, number of samples per component KK, TT, adaptation function uϕu_{\phi}, NepochsN_{\mathrm{epochs}}, target family Π\Pi, batch size BB, temperature schedule κ\kappa

  1. for epoch =1,…,Nepochs=1,\ldots,N_{\mathrm{epochs}} do

  2. Draw batch of random target unnormalised densities πb∼Π\pi_b \sim\Pi, b=1,…,Bb=1,\ldots,B.

  3. Temper the density πb(x)=πb(x)1κ(epoch)\pi_b(x)=\pi_b(x)^{\frac{1}{\kappa(\mathrm{epoch})}}

  4. Draw random starting proposal parameters θb,1={μb,n(1),Lb,n(1)}n=1N\theta_{b,1}=\{\mu_{b,n}^{(1)},L_{b,n}^{(1)}\}_{n=1}^{N} parametrising qb,1q_{b,1}.

  5. for t=1,…,Tt=1,\ldots,T do

  6. ϵb,n,k∼N(0,Id)\epsilon_{b,n,k}\sim\mathcal{N}(0,I_d), b=1,…,Bb=1,\ldots,B, n=1,…,Nn=1,\ldots,N, k=1,…,Kk=1,\ldots,K.

  7. xb,n,k(t)=μb,n(t)+Lb,n(t)ϵb,n,kx_{b,n,k}^{(t)}=\mu_{b,n}^{(t)}+L_{b,n}^{(t)}\epsilon_{b,n,k}

  8. wb,n,k(t)=πb(xb,n,k(t))qb,t(xb,n,k(t))w_{b,n,k}^{(t)}=\frac{\pi_b(x_{b,n,k}^{(t)})}{q_{b,t}(x_{b,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)\theta_{b,t+1}=u_{\phi}\left(\theta_{b,t},\{(x_{b,n,k}^{(t)},w_{b,n,k}^{(t)})\}_{k=1,n=1}^{K,N},\pi,\frac{t-1}{T-1}\right).

  10. end for

  11. ϵb,n,k∼N(0,Id)\epsilon_{b,n,k}\sim\mathcal{N}(0,I_d), b=1,…,Bb=1,\ldots,B, n=1,…,Nn=1,\ldots,N, k=1,…,Kk=1,\ldots,K.

  12. xb,n,k=μb,n(T+1)+Lb,n(T+1)ϵb,n,kx_{b,n,k}=\mu_{b,n}^{(T+1)}+L_{b,n}^{(T+1)}\epsilon_{b,n,k}

  13. Estimate ∇ϕEπ∼Π[1T∑t=2T+1KL⁡(qt∥p)]\nabla_{\phi}\mathbb{E}_{\pi\sim\Pi}\left[\frac{1}{T}\sum_{t=2}^{T+1}\operatorname{KL}(q_t\mathbin\Vert p)\right] (21) using collected samples and perform a gradient step on ϕ\phi.

  14. end for

  15. return uϕu_{\phi}

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)(x_s,w_s) is processed. Let c(s)c(s) denote the index of the proposal component that generated xsx_s, we calculate features:

zs=Lc(s)−1(xs−μc(s))z_s=L_{c(s)}^{-1}(x_s-\mu_{c(s)})
wˉs=log⁡ws1∣{j:c(j)=c(s)}∣∑jwj1(c(j)=c(s))\bar{w}_s=\log\frac{w_s}{\frac{1}{|\{j:c(j)=c(s)\}|}\sum_j w_j\mathbf{1}_{(c(j)=c(s))}}
gs=LnT∇log⁡π(xs).g_s=L_n^{T}\nabla\log\pi(x_s).

These are then passed through an MLP, ξ\xi, with: an input layer, a SiLU activation, and a single hidden-layer. Passing the features through ξ:R2d+1→RH\xi:\mathbb{R}^{2d+1}\to\mathbb{R}^{H}, where HH is the hidden-dimension, gives a per-particle encoding. These are pooled over each generating component:

hn=1∣{j:c(j)=n}∣∑s=1Sξ(zs,wˉs,gs)1c(s)=n.h_n=\frac{1}{|\{j:c(j)=n\}|}\sum_{s=1}^{S}\xi(z_s,\bar{w}_s,g_s)\mathbf{1}_{c(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:

ζ2=1Nd∑n=1N∑j=1d((μn)j−(μˉ)j)2+1Nd∑n=1N∑j=1d(Σn)jj,μˉ=1N∑n=1Nμn.(19)\zeta^2 = \frac{1}{Nd}\sum_{n=1}^{N}\sum_{j=1}^{d}\left((\mu_n)_j-(\bar{\mu})_j\right)^2+\frac{1}{Nd}\sum_{n=1}^{N}\sum_{j=1}^{d}(\Sigma_n)_{jj},\qquad\bar{\mu}=\frac{1}{N}\sum_{n=1}^{N}\mu_n. \tag*{(19)}

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(μnEM−μ),Cn=Ln−1ΣEMLn−T.\nu_n=L_n^{-1}(\mu_n^{EM}-\mu),\qquad C_n=L_n^{-1}\Sigma^{EM}L_n^{-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 [19] 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.

FeatureDimension
hnh_n – the pooled particle encodings.HH
(μn−μˉ)ζ\frac{(\mu_n-\bar{\mu})}{\zeta}, position relative to the ensemble.dd
12log⁡Σn,jj−log⁡ζ\frac{1}{2}\log\Sigma_{n,jj}-\log\zeta, variance relative to the ensemble.dd
Correlations of Σn\Sigma_n.d(d−1)/2d(d-1)/2
log⁡Nmn\log Nm_n – EM mass share.11
log⁡Nαn\log N\alpha_n – Current mixture weight multiplied by NN.11
t−1T−1\frac{t-1}{T-1} – Step index, normalised to [0,1][0,1].11
νn\nu_n – scaled EM mean residual.dd
log⁡diag⁡(Cn)\log\operatorname{diag}(C_n) – log of the residual EM covariance diagonal.dd
Correlations of CnC_n.d(d−1)/2d(d-1)/2
LnT∇log⁡π(μn)L_n^T\nabla\log\pi(\mu_n) – Scaled target gradient at the component mean.dd

Table 6. Summary of component level features.

The features log⁡Nmn\log Nm_n, log⁡Nαn\log N\alpha_n, log⁡diag⁡(Cn)\log\operatorname{diag}(C_n), and LnT∇log⁡π(μn)L_n^T\nabla\log\pi(\mu_n) are clipped with the function f(x)=15clip⁡(x,±20)f(x)=\frac{1}{5}\operatorname{clip}(x,\pm20).

Proposal Parameter Updating The component features in the previous section, denoted featn_n are passed through 2 single-layer MLP’s with SiLU activation functions – ψ∈Rdcomp→RH\psi\in\mathbb{R}^{d_{\mathrm{comp}}}\to\mathbb{R}^{H}, ψcross∈R2H→RH\psi_{\mathrm{cross}}\in\mathbb{R}^{2H}\to\mathbb{R}^{H} where dcompd_{\mathrm{comp}} 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:

zn=ψ(featn),zn=ψcross(zn,1N∑n=1Nzn),Δn=Wzn+b.z_n=\psi(\mathrm{feat}_n),\qquad z_n=\psi_{\mathrm{cross}}\left(z_n,\frac{1}{N}\sum_{n=1}^{N}z_n\right),\qquad\Delta_n=Wz_n+b.

We split the output Δn=(Δμn′,ΔLn′)\Delta_n=(\Delta\mu'_n,\Delta L'_n), and apply a smooth clamping to the outputs to constrain the maximum adaptation to the proposal:

Δμn=Δμmax⁡tanh⁡(Δμn′Δμmax⁡).(20)\Delta\mu_n=\Delta\mu_{\max}\tanh\left(\frac{\Delta\mu'_n}{\Delta\mu_{\max}}\right). \tag*{(20)}

The means are adapted as

μn←μn+LnΔμn.\mu_n \leftarrow\mu_n + L_n\Delta\mu_n.

To adapt the covariances Σn\Sigma_n, we split ΔLn′∈Rd(d+1)2\Delta L'_n \in\mathbb{R}^{\frac{d(d+1)}{2}} into a dd-dimensional component Δlog⁡σ′\Delta\log\sigma', and (if the full covariance is used to parametrise the mixture) a matrix, Kn′K'_n, with lower triangular values given by the remaining d(d−1)2\frac{d(d-1)}{2} components. These adaptations are constrained as Δlog⁡σ=12ΔLmax⁡tanh⁡(Δlog⁡σ′ΔLmax⁡)\Delta\log\sigma= \frac{1}{2}\Delta L_{\max}\tanh\left(\frac{\Delta\log\sigma'}{\Delta L_{\max}}\right) and (Kn)ij=ΔLmax⁡tanh⁡((Kn′)ijΔLmax⁡)(K_n)_{ij} = \Delta L_{\max}\tanh\left(\frac{(K'_n)_{ij}}{\Delta L_{\max}}\right). Then, adapt the current LnL_n by:

Ln←LnAn,An=diag⁡(eΔlog⁡σ)+Kn.L_n \leftarrow L_n A_n,\qquad A_n = \operatorname{diag}\left(e^{\Delta\log\sigma}\right) + K_n.

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+3d_{\mathrm{comp}} = H + 5d + 3. This gives a parameter count of ((2d+1)H+H+H2+H)+(dcompH+H)+(2H2+H)+(2dH+2d)((2d + 1)H + H + H^2 + H) + (d_{\mathrm{comp}}H + H) + (2H^2 + H) + (2dH + 2d), where we have used brackets to separate the parameter counts for ξ\xi, ψ\psi, ψcross\psi_{\mathrm{cross}}, and the final layer (W,b)(W,b). See Table 7 for the exact parameter count in our experiments.

TargetFamilyddNNTTKK (AAIS)KK (DM-PMC)KK (M-PMC)KK (GAPIS)λ\lambda (GAPIS)Δμmax⁡\Delta\mu_{\max}HHNum. params.
BLR d551015153232251e-053.0325802
Hierarchical d551015153232251e-051.0325802
Funnel d551015153232250.011.0325802
Banana d551015153232250.031.0325802
BLR d2525251515323261e-053.06431346
Hierarchical d2525251515323261e-051.06431346
Funnel d2525251515323260.00031.06431346
Banana d2525251515323260.031.06431346
Funnel d5050501525535350.00011.0128124260
Banana d5050501525535350.031.0128124260

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.

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).C = 2N(K + 1)(T + 1).

This is calculated as: NK(T+1)NK(T + 1) evaluations of the density and its gradient at the samples xsx_s with cost 2NK(T+1)2NK(T + 1), added to the gradient at the component means μn\mu_n giving a further 2N(T+1)2N(T + 1) cost.

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)=π(x−ba)\pi^*(x) = \pi\left(\frac{x-b}{a}\right) and uϕu_\phi be the AAIS adaptation function as in §A.1, then, if we denote the output parameters from the adaptation function as

{μnnew}n=1N,{Lnnew}n=1N=uϕ({μnold,Lnold}n=1N,{xs}s=1S,π,t−1T−1),\left\{\mu_n^{new}\right\}_{n=1}^{N}, \left\{L_n^{new}\right\}_{n=1}^{N} = u_\phi\left(\left\{\mu_n^{old}, L_n^{old}\right\}_{n=1}^{N}, \left\{x_s\right\}_{s=1}^{S}, \pi, \frac{t-1}{T-1}\right),

we have the following:

{aμnnew+b}n=1N,{aLnnew}n=1N=uϕ({aμnold+b,aLnold}n=1N,{axs+b}s=1S,π∗,t−1T−1).\left\{a\mu_n^{new} + b\right\}_{n=1}^{N}, \left\{aL_n^{new}\right\}_{n=1}^{N} = u_\phi\left(\left\{a\mu_n^{old} + b, aL_n^{old}\right\}_{n=1}^{N}, \left\{ax_s+b\right\}_{s=1}^{S}, \pi^*, \frac{t-1}{T-1}\right).

Proof. The proof proceeds by showing the scale-invariance of the procedure which produces the Δn\Delta_n. From there, the adaptation to μn\mu_n is:

aμn+b←aμn+b+aLnΔμn=a(μn+LnΔμn)+b,a\mu_n + b \leftarrow a\mu_n + b + aL_n\Delta\mu_n = a(\mu_n + L_n\Delta\mu_n) + b,

and the covariance adaptation is:

aLn←aLnAn,An=(diag⁡(eΔlog⁡σ2)+Kn).aL_n \leftarrow aL_nA_n,\qquad A_n = \left(\operatorname{diag}\left(e^{\Delta\log\sigma^2}\right) + K_n\right).

Starting with the per-particle features which are encoded, note first that the weights wsw_s will be identical because of the way π∗\pi^* is defined, let ys=axs+by_s = ax_s+b be the transformed particles given to the function, then:

z~s=1aLn−1(yc(s)−aμc(s)−b)=1aLn−1(axc(s)+b−aμc(s)−b)=Ln−1(xc(s)−μc(s)),\tilde{z}_s = \frac{1}{a}L_n^{-1}(y_{c(s)} - a\mu_{c(s)} - b) = \frac{1}{a}L_n^{-1}(ax_{c(s)} + b - a\mu_{c(s)} - b) = L_n^{-1}(x_{c(s)} - \mu_{c(s)}),
gs=aLnT∇ylog⁡π∗(ys)=aLnT∇ylog⁡π(ys−ba)=aLnT∇xlog⁡π(xs)⋅1a=LnT∇xlog⁡π(xs).g_s = aL_n^{T}\nabla_y \log\pi^*(y_s) = aL_n^{T}\nabla_y \log\pi\left(\frac{y_s-b}{a}\right) = aL_n^{T}\nabla_x \log\pi(x_s)\cdot\frac{1}{a} = L_n^{T}\nabla_x \log\pi(x_s).

Proving the invariance for the component-level features follows the same pattern as above and so we skip it, only noting that:

ζ2=1Nd∑n=1N∑j=1d((aμn+b)j−(aμˉ+b)j)2+1Nd∑n=1N∑j=1d(a2Σn)jj=a2(1Nd∑n=1N∑j=1d((μn)j−(μˉ)j)2+1Nd∑n=1N∑j=1d(Σn)jj),\begin{aligned} \zeta^2 = \frac{1}{Nd}\sum_{n=1}^{N}\sum_{j=1}^{d}\left((a\mu_n+b)_j-(a\bar{\mu}+b)_j\right)^2+\frac{1}{Nd}\sum_{n=1}^{N}\sum_{j=1}^{d}\left(a^2\Sigma_n\right)_{jj} \\ &= a^2\left(\frac{1}{Nd}\sum_{n=1}^{N}\sum_{j=1}^{d}\left((\mu_n)_j-(\bar{\mu})_j\right)^2+\frac{1}{Nd}\sum_{n=1}^{N}\sum_{j=1}^{d}\left(\Sigma_n\right)_{jj}\right), \end{aligned}

so the pooled variance scales as we would expect it to.

Thus all the features that lead into producing Δn\Delta_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\{\mu_n^{(t)}, L_n^{(t)}\}_{n=1,t=1}^{N,T+1} then, assuming that the target is changed such that the new target π∗(x)=π(x−ba)\pi^*(x)=\pi\left(\frac{x-b}{a}\right) 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\{a\mu_n^{(1)}+b,aL_n^{(1)}\}_{n=1}^{N} will give the sequence of proposal parameters {aμn(t)+b,aLn(t)}n=1,t=1N,T+1\{a\mu_n^{(t)}+b,aL_n^{(t)}\}_{n=1,t=1}^{N,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 ϕ\phi 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 μ\mu and variance σ2\sigma^2 well, then it will be able to sample a Gaussian of mean aμ+ba\mu+b and variance a2σ2a^2\sigma^2 in the same fashion as long as the starting proposal parameters are transformed accordingly.

Non-equivariant Version

The non-equivariant version of AAIS, evaluated in Table 13 and Table 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\mu_n, log⁡diag⁡(Ln)\log\operatorname{diag}(L_n), log⁡s\log s – 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 dd values Δμnabs\Delta\mu_n^{\mathrm{abs}} and the mean adaptation becomes μn←μn+LnΔμn+lϕΔμnabs\mu_n\leftarrow\mu_n+L_n\Delta\mu_n+l_\phi\Delta\mu_n^{\mathrm{abs}} where lϕ∈Rl_\phi\in\mathbb{R} is a learnt scale for the adaptation.

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=25d = 25.

Target FamilyMethod ↓Metric →sliced W1propW^{\mathrm{prop}}_{1} ↓rev. KL ↓log ZZ err. ↓E[x]\mathbb{E}[x] err. ↓
BLRScale-equivariant1.174±0.03331.174 \pm0.0333 (2.600)409.9±3.154409.9 \pm3.154 (1.0×1031.0 \times10^{3})374.4±4.126374.4 \pm4.126 (994.0)6.832±0.26526.832 \pm0.2652 (15.645)
BLRNot scale-equivariant1.461±0.09761.461 \pm0.0976 (2.529)542.4±16.950542.4 \pm16.950 (1.2×1031.2 \times10^{3})466.2±15.175466.2 \pm15.175 (1.0×1031.0 \times10^{3})8.135±0.45388.135 \pm0.4538 (14.913)
HierarchicalScale-equivariant0.9877±0.02010.9877 \pm0.0201 (2.414)2.157±0.01602.157 \pm0.0160 (3.137)1.279±0.02151.279 \pm0.0215 (2.194)4.531±0.07694.531 \pm0.0769 (12.805)
HierarchicalNot scale-equivariant1.052±0.04211.052 \pm0.0421 (3.274)2.192±0.14992.192 \pm0.1499 (3.985)0.9876±0.03880.9876 \pm0.0388 (1.950)4.132±0.08874.132 \pm0.0887 (14.853)
FunnelScale-equivariant0.5069±0.00610.5069 \pm0.0061 (1.082)0.1535±0.00320.1535 \pm0.0032 (0.2379)0.2672±0.00740.2672 \pm0.0074 (0.4131)0.6550±0.12380.6550 \pm0.1238 (2.128)
FunnelNot scale-equivariant0.5076±0.00360.5076 \pm0.0036 (1.105)0.1486±0.00180.1486 \pm0.0018 (0.2277)0.2304±0.00440.2304 \pm0.0044 (0.3747)0.5341±0.08070.5341 \pm0.0807 (1.515)
BananaScale-equivariant1.093±0.00691.093 \pm0.0069 (1.492)6.112±0.05656.112 \pm0.0565 (7.823)2.127±0.01382.127 \pm0.0138 (3.341)4.295±0.02274.295 \pm0.0227 (6.514)
BananaNot scale-equivariant1.046±0.00041.046 \pm0.0004 (1.444)5.869±0.03075.869 \pm0.0307 (7.593)2.008±0.01542.008 \pm0.0154 (3.319)4.386±0.02194.386 \pm0.0219 (6.669)

Table 13.

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 TargetShift ↓Method → EquivariantNon-equivariant
Banana (d=5d = 5)Curvature range: [110,12]→[12,1]\left[\frac{1}{10}, \frac{1}{2}\right] \to\left[\frac{1}{2}, 1\right]1.365±0.03441.365 \pm0.0344 (2.459)1.395±0.01841.395 \pm0.0184 (2.593)
Banana (d=5d = 5)Curvature range: [110,12]→[1,2]\left[\frac{1}{10}, \frac{1}{2}\right] \to[1, 2]2.912±0.05202.912 \pm0.0520 (5.382)3.197±0.02513.197 \pm0.0251 (5.970)
BLR (d=5d = 5)β∗∼N(0,4Ip)→β∗∼N(0,64Ip)\beta^{*} \sim\mathcal{N}(0, 4I_{p}) \to\beta^{*} \sim\mathcal{N}(0, 64I_{p})3.980±0.04283.980 \pm0.0428 (7.859)4.331±0.06664.331 \pm0.0666 (8.379)
BLR (d=5d = 5)β∗∼N(0,4Ip)→β∗∼N(0,400Ip)\beta^{*} \sim\mathcal{N}(0, 4I_{p}) \to\beta^{*} \sim\mathcal{N}(0, 400I_{p})12.231±0.040412.231 \pm0.0404 (20.850)12.897±0.107512.897 \pm0.1075 (21.379)
BLR (d=5d = 5)nn range: [3p,12p]→[12p,48p][3p, 12p] \to[12p, 48p]0.7802±0.03020.7802 \pm0.0302 (2.521)0.8313±0.08590.8313 \pm0.0859 (2.477)
BLR (d=5d = 5)nn range: [3p,12p]→[48p,192p][3p, 12p] \to[48p, 192p]0.8607±0.01620.8607 \pm0.0162 (2.648)1.086±0.20621.086 \pm0.2062 (2.863)
Funnel (d=5d = 5)x1x_{1} variance range: [32,3]→[3,92]\left[\frac{3}{2}, 3\right] \to\left[3, \frac{9}{2}\right]3.280±0.01843.280 \pm0.0184 (7.076)3.125±0.02613.125 \pm0.0261 (6.939)
Funnel (d=5d = 5)x1x_{1} variance range: [32,3]→[92,6]\left[\frac{3}{2}, 3\right] \to\left[\frac{9}{2}, 6\right]21.723±0.042621.723 \pm0.0426 (59.748)-
Hierarchical (d=5d = 5)τ\tau range: [12,8]→[8,20]\left[\frac{1}{2}, 8\right] \to[8, 20]1.848±0.13781.848 \pm0.1378 (5.819)2.494±0.09162.494 \pm0.0916 (9.985)
Hierarchical (d=5d = 5)τ\tau range: [12,8]→[20,32]\left[\frac{1}{2}, 8\right] \to[20, 32]- (16.400)-
Banana (d=25d = 25)Curvature range: [110,12]→[12,1]\left[\frac{1}{10}, \frac{1}{2}\right] \to\left[\frac{1}{2}, 1\right]2.493±0.02342.493 \pm0.0234 (3.211)2.526±0.00782.526 \pm0.0078 (3.323)
Banana (d=25d = 25)Curvature range: [110,12]→[1,2]\left[\frac{1}{10}, \frac{1}{2}\right] \to[1, 2]4.253±0.04544.253 \pm0.0454 (5.549)4.876±0.01584.876 \pm0.0158 (6.439)
BLR (d=25d = 25)β∗∼N(0,4Ip)→β∗∼N(0,64Ip)\beta^{*} \sim\mathcal{N}(0, 4I_{p}) \to\beta^{*} \sim\mathcal{N}(0, 64I_{p})3.366±0.05503.366 \pm0.0550 (5.645)5.233±0.05385.233 \pm0.0538 (6.910)
BLR (d=25d = 25)β∗∼N(0,4Ip)→β∗∼N(0,400Ip)\beta^{*} \sim\mathcal{N}(0, 4I_{p}) \to\beta^{*} \sim\mathcal{N}(0, 400I_{p})11.207±0.020011.207 \pm0.0200 (15.456)14.769±0.120214.769 \pm0.1202 (18.548)
BLR (d=25d = 25)nn range: [3p,12p]→[12p,48p][3p, 12p] \to[12p, 48p]1.310±0.06731.310 \pm0.0673 (2.897)1.763±0.16111.763 \pm0.1611 (3.148)
BLR (d=25d = 25)nn range: [3p,12p]→[48p,192p][3p, 12p] \to[48p, 192p]1.512±0.07471.512 \pm0.0747 (3.192)2.107±0.19212.107 \pm0.1921 (3.678)
Funnel (d=25d = 25)x1x_{1} variance range: [32,3]→[3,92]\left[\frac{3}{2}, 3\right] \to\left[3, \frac{9}{2}\right]3.609±0.05643.609 \pm0.0564 (8.537)3.603±0.02293.603 \pm0.0229 (8.592)
Funnel (d=25d = 25)x1x_{1} variance range: [32,3]→[92,6]\left[\frac{3}{2}, 3\right] \to\left[\frac{9}{2}, 6\right]24.502±0.098824.502 \pm0.0988 (65.907)-
Hierarchical (d=25d = 25)τ\tau range: [12,8]→[8,20]\left[\frac{1}{2}, 8\right] \to[8, 20]3.767±0.08823.767 \pm0.0882 (7.176)6.486±0.45566.486 \pm0.4556 (14.981)
Hierarchical (d=25d = 25)τ\tau range: [12,8]→[20,32]\left[\frac{1}{2}, 8\right] \to[20, 32]- (13.854)-

Table 14.

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=50d=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.

Training Details

Our objective function requires estimation of KL⁡(qt∥p)\operatorname{KL}(q_t\mathbin\Vert p). In order to maintain stable training when qq and π\pi are mismatched, we use compression with arcsin on the log-density ratio, the estimator we use is:

KL⁡^(qt∥p)=1NK∑n=1N∑k=1KCarcsin⁡(g(xn,k)C)+const,g(xn,k)=log⁡qt(xn,k)−log⁡π(xn,k).(21)\widehat{\operatorname{KL}}(q_t\mathbin\Vert p)=\frac{1}{NK}\sum_{n=1}^{N}\sum_{k=1}^{K}C\arcsin\left(\frac{g(x_{n,k})}{C}\right)+\mathrm{const},\qquad g(x_{n,k})=\log q_t(x_{n,k})-\log\pi(x_{n,k}). \tag*{(21)}

C=30C=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 [27] is used with a cosine scheduled learning rate starting at 3×10−33 \times10^{-3} and with minimum learning rate (3×10−3)⋅120(3 \times10^{-3}) \cdot\frac{1}{20}.

Annealing was performed through training to aid stability with a temperature schedule, as in Algorithm 3, κ(epoch)=0.3+(1−0.3)⋅min⁡(1,epoch0.1⋅Nepochs)\kappa(\mathit{epoch}) = 0.3 + (1 - 0.3) \cdot\min\left(1, \frac{\mathit{epoch}}{0.1 \cdot N_{\mathit{epochs}}}\right).

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.

Target Densities

Here we detail the different choices for target families Π\Pi. Both Bayesian posteriors are based on similar posteriors from Gelman et al. [22].

Funnel A family consisting of Neal’s funnel [34] in dd-dimensions, a single target has the form:

x1∼N(0,σ2),xi∣x1∼N(0,ex1),i=2,…,d.x_1 \sim\mathcal{N}(0,\sigma^2), \qquad x_i \mid x_1 \sim\mathcal{N}(0,e^{x_1}), \qquad i=2,\ldots,d.

The family of distributions obtained by sampling σ∼U[23,3]\sigma\sim U\left[\frac{2}{3},3\right].

Banana A product of independent 2-dimensional banana distributions as in Haario et al. [24]. An individual block is given by:

x1∼N(0,σ12),x2∼N(b(x12−σ12),σ22),x_1 \sim\mathcal{N}(0,\sigma_1^2), \qquad x_2 \sim\mathcal{N}\left(b(x_1^2-\sigma_1^2),\sigma_2^2\right),

where σ12,σ22\sigma_1^2,\sigma_2^2 and bb are the variances and the curvature. The samples are then rotated by some angle θ\theta. The parameters for every block are sampled as b∼U[110,15],σ1∼U[1,3],σ2∼U[12,32],θ∼U[0,2π]b \sim U\left[\frac{1}{10},\frac{1}{5}\right], \sigma_1 \sim U[1,3], \sigma_2 \sim U\left[\frac{1}{2},\frac{3}{2}\right], \theta\sim U[0,2\pi], and, if dd is even, an individual target is formed by composing d2\frac{d}{2} blocks, if dd is odd then d−12\frac{d-1}{2} blocks are composed along with a final independent Gaussian N(0,σ12)\mathcal{N}(0,\sigma_1^2).

Bayesian Linear Regression Posterior This is a Bayesian linear regression model. Let rr be the number of parameters of the linear model, define a design matrix X∈Rndata×rX \in\mathbb{R}^{n_{\mathit{data}} \times r}, parameter vector β∈Rr\beta\in\mathbb{R}^{r}, variance σ2∈R\sigma^2 \in\mathbb{R}, and the hyperparameters a,b∈Ra,b \in\mathbb{R}. Let y∈Rndatay \in\mathbb{R}^{n_{\mathit{data}}} be the response, the model is:

y∣β∼N(Xβ,σ2Indata),β∣σ2∼N(0,σ2V0−1),σ2∼Inv-Gamma⁡(a0,b0),y \mid\beta\sim\mathcal{N}\left(X\beta,\sigma^2 I_{n_{\mathit{data}}}\right), \qquad\beta\mid\sigma^2 \sim\mathcal{N}\left(0,\sigma^2 V_0^{-1}\right), \qquad\sigma^2 \sim\operatorname{Inv\text{-}Gamma}(a_0,b_0),

where inference is over the β\beta and σ2\sigma^2 so the dimension of the posterior is d=p+1d=p+1.

This has posterior:

π(β,σ2)=N(β;μ,σ2V−1)⋅Inv-Gamma⁡(σ2;a∗,b∗),\pi(\beta,\sigma^2)=\mathcal{N}(\beta;\mu,\sigma^2V^{-1})\cdot\operatorname{Inv\text{-}Gamma}(\sigma^2;a^*,b^*),
V=XTX+V0,μ=V−1XTy,a∗=a0+ndata2,b∗=b0+12(yTy−μTVμ),V=X^{T}X+V_0,\qquad\mu=V^{-1}X^{T}y,\qquad a^*=a_0+\frac{n_{\mathit{data}}}{2},\qquad b^*=b_0+\frac{1}{2}(y^{T}y-\mu^{T}V\mu),

which can be tractably sampled from by sampling σ2∼Inv-Gamma⁡(a∗,b∗)\sigma^2 \sim\operatorname{Inv\text{-}Gamma}(a^*,b^*) followed by β∣σ2∼N(μ,σ2V−1)\beta\mid\sigma^2 \sim\mathcal{N}(\mu,\sigma^2V^{-1}). To ensure every sampling method produces valid σ2\sigma^2 values, each method produces samples of log⁡σ2\log\sigma^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=110IrV_0=\frac{1}{10}I_r, a0=b0=1a_0=b_0=1, μ0=0\mu_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 XX such that the family has a range of different difficulties within it; we do this by randomly sampling XX with a given condition number κ\kappa (approximately) and with a random rotation:

Xi∼N(0,Σ), i=1,…,r,Σ=QDQT(22)X_i \sim\mathcal{N}(0,\Sigma),\ i=1,\ldots,r,\qquad\Sigma=QDQ^{T} \tag*{(22)}

where QQ is a random orthogonal r×rr \times r matrix formed by taking the QR decomposition of a r×rr \times r matrix of i.i.d. standard Gaussian random variables, and DD is the diagonal matrix with elements si2s_i^2 where log⁡si=i−1rlog⁡κ−\log s_i=\frac{i-1}{r}\log\kappa- this gives the smallest and largest singular values of Σ\Sigma as 11 and κ2\kappa^2 respectively, so the condition number of Σ\Sigma is exactly κ2\kappa^2, for each target we sample log⁡10κ∼U[0,2]\log_{10}\kappa\sim\mathcal{U}[0,2] so κ∈[1,100]\kappa\in[1,100].

After generating XX, the data is produced as:

yi∼N(Xβ∗,(σ∗)2), i=1,…,ndata,(23)y_i \sim\mathcal{N}\left(X\beta^*,(\sigma^*)^2\right),\ i=1,\ldots,n_{\mathrm{data}}, \tag*{(23)}

where remaining parameters are sampled as β∗∼N(0,4Ir)\beta^* \sim\mathcal{N}(0,4I_r) and σ∗∼U[310,32]\sigma^* \sim\mathcal{U}\left[\frac{3}{10},\frac{3}{2}\right]. We also randomise the number of data points ndata∼U[3r,12r]n_{\mathrm{data}} \sim\mathcal{U}[3r,12r].

Hierarchical Bayesian Posterior This is a hierarchical Bayesian model. In dd-dimensions, let J=d−2J=d-2, then the model is given by:

yj∣θj∼N(θj,σj2),θj∣μ,τ∼N(μ,τ2),μ∼N(0,σμ2),log⁡τ∼N(0,στ2),y_j \mid\theta_j \sim\mathcal{N}(\theta_j,\sigma_j^2),\quad\theta_j \mid\mu,\tau\sim\mathcal{N}(\mu,\tau^2),\quad\mu\sim\mathcal{N}(0,\sigma_\mu^2),\quad\log\tau\sim\mathcal{N}(0,\sigma_\tau^2),

where all values belong to R\mathbb{R}, the σj2\sigma_j^2 are known, and inference is over the θ1:J\theta_{1:J}, μ\mu, and τ\tau.

This has posterior density:

π(θ1,…,θJ,μ,τ)=N(μ,σμ2)N(log⁡τ,στ2)∏j=1J(N(yj;θj,σj2)N(θj;μ,τ2)).\pi(\theta_1,\ldots,\theta_J,\mu,\tau)=\mathcal{N}(\mu,\sigma_\mu^2)\mathcal{N}(\log\tau,\sigma_\tau^2)\prod_{j=1}^{J}\left(\mathcal{N}(y_j;\theta_j,\sigma_j^2)\mathcal{N}(\theta_j;\mu,\tau^2)\right).

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 μ∗\mu^*, τ∗\tau^*, θj∗\theta_j^* to indicate the true parameters used in the data generation for a particular target, then the data generating process is μ∗∼N(0,25)\mu^* \sim\mathcal{N}(0,25), τ∗∼U[12,8]\tau^* \sim\mathcal{U}\left[\frac{1}{2},8\right], θj∗∼N(μ∗,(τ∗)2)\theta_j^* \sim\mathcal{N}(\mu^*,(\tau^*)^2), yj∼N(θj∗,σj2)y_j \sim\mathcal{N}(\theta_j^*,\sigma_j^2), we also randomise the known σj2\sigma_j^2 as σj2∼U[2,18]\sigma_j^2 \sim\mathcal{U}[2,18], so each target not only varies in the data yy 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 (μ,τ)(\mu,\tau), we can simply sample θj\theta_j as

θj∣y,μ,τ∼N(a,b),a=μ+τ2σj2+τ2(y−μ),b=σj2τ2σj2+τ2.\theta_j \mid y,\mu,\tau\sim\mathcal{N}(a,b),\quad a=\mu+\frac{\tau^2}{\sigma_j^2+\tau^2}(y-\mu),\quad b=\frac{\sigma_j^2\tau^2}{\sigma_j^2+\tau^2}.

In order to sample (μ,τ)(\mu,\tau), note first that we can marginalise out the θj\theta_j to obtain:

π(μ,τ)=N(μ,σμ2)N(log⁡τ,στ2)∏j=1JN(yj,μ,σj2+τ2),\pi(\mu,\tau)=\mathcal{N}(\mu,\sigma_\mu^2)\mathcal{N}(\log\tau,\sigma_\tau^2)\prod_{j=1}^{J}\mathcal{N}(y_j,\mu,\sigma_j^2+\tau^2),

which we then sample from using the inverse-CDF approximated by quadrature over a sufficiently fine grid.

Metrics

Here we give details on the metrics reported in the tables in both the main text and those in §C.

Sliced 1-Wasserstein Distance [4] This is a tractable surrogate for the 1-Wasserstein distance W1(qT+1,π)\mathcal{W}_1(q_{T+1},\pi):

W1(qT+1,p)=inf⁡γ∈Γ(qT+1,p)∫∣x−y∣ dγ(x,y)(24)\mathcal{W}_1(q_{T+1},p)=\inf_{\gamma\in\Gamma(q_{T+1},p)}\int|x-y|\,\mathrm{d}\gamma(x,y) \tag*{(24)}
SWD⁡1(qT+1,p)=Eω∼U(Sd−1)[W1((τω)#qT+1,(τω)#p)],(25)\operatorname{SWD}_1(q_{T+1},p)=\mathbb{E}_{\omega\sim\mathcal{U}(\mathbb{S}^{d-1})}\left[\mathcal{W}_1((\tau_\omega)_\#q_{T+1},(\tau_\omega)_\#p)\right], \tag*{(25)}

where Γ(qT+1,p)\Gamma(q_{T+1},p) is the set of probability measures with marginals qT+1q_{T+1} and pp, Sd−1={ω∈Rd:∥ω∥=1}\mathbb{S}^{d-1}=\{\omega\in\mathbb{R}^d:\lVert\omega\rVert=1\}, τω(x)=ωTx\tau_\omega(x)=\omega^\mathsf{T}x is the projection of x∈Rdx\in\mathbb{R}^d onto ω\omega, and (τω)#p(\tau_\omega)_\#p is the pushforward of pp by τω\tau_\omega. We compute the Monte Carlo estimate of this by sampling projections ω\omega, and we calculate the distance between the empirical distributions of qT+1q_{T+1} and pp formed by 300 samples from each. This metric is denoted “sliced W1prop\mathcal{W}_1^{\mathrm{prop}}” 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\{w(x_s^{(t)})\}_{s=1,t=1}^{S,T+1} is

ESS⁡=(∑t∑sw(xs(t)))2∑t∑sw(xs(t))2,(26)\operatorname{ESS}=\frac{\left(\sum_t\sum_s w(x_s^{(t)})\right)^2}{\sum_t\sum_s w(x_s^{(t)})^2}, \tag*{(26)}

and we report the normalised version 1S(T+1)ESS⁡∈[0,1]\frac{1}{S(T+1)}\operatorname{ESS}\in[0,1].

Error in Log-Estimate of Normalising Constant We compute the estimate of ZZ:

Z^=1S(T+1)∑t=1T+1∑s=1Sw(xs(t)),(27)\widehat{Z} = \frac{1}{S(T+1)} \sum_{t=1}^{T+1} \sum_{s=1}^{S} w(x_s^{(t)}), \tag*{(27)}

and then report ∣log⁡Z^−log⁡Z∣|\log\widehat{Z} - \log Z|.

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+1q_{T+1} is not formed from new samples from the final proposal, but instead by sampling with replacement from the final SS samples on the last step of the AIS procedure proportional to their importance weights.

KL divergence We compute the estimated KL⁡(qT+1∥p)\operatorname{KL}(q_{T+1} \mathbin\Vert p) as

KL⁡^(qT+1∥p)=∑s=1300(log⁡qT+1(xs)−log⁡π(xs)),(28)\widehat{\operatorname{KL}}(q_{T+1} \mathbin\Vert p) = \sum_{s=1}^{300} \left(\log q_{T+1}(x_s) - \log\pi(x_s)\right), \tag*{(28)}

where we draw 300 samples xs∼qT+1x_s \sim q_{T+1}.

Expectation Estimation Errors We compute the estimate of E[f(x)]\mathbb{E}[f(x)]:

E^[f(x)]=1∑t=1T+1∑s=1Sw(xs(t))∑t=1T+1∑s=1Sw(xs(t))f(xs(t)),(29)\widehat{\mathbb{E}}[f(x)] = \frac{1}{\sum_{t=1}^{T+1}\sum_{s=1}^{S} w(x_s^{(t)})} \sum_{t=1}^{T+1}\sum_{s=1}^{S} w(x_s^{(t)})f(x_s^{(t)}), \tag*{(29)}

and then take the absolute error between this and E[f(x)]\mathbb{E}[f(x)] estimated by 20000 draws from π\pi.

Hyperparameters

Table 7 gives the hyperparameters used in the experiments. We vary the value of KK in order to maintain a matched cost for each sampler. The GAPIS step size λ\lambda 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⁡\Delta\mu_{\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=1500N_{\mathrm{epochs}} = 1500, and the target batch size used during training B=32B = 32.

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.

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.

Target FamilyMethod ↓Metric → sliced W1propW_{1}^{\mathrm{prop}} ↓rev. KL ↓log Z err. ↓E[xx] err. ↓
BLRWith gradient features1.174±0.03331.174 \pm0.0333 (2.600)409.9±3.154409.9 \pm3.154 (1.0×1031.0 \times10^{3})374.4±4.126374.4 \pm4.126 (994.0)6.832±0.26526.832 \pm0.2652 (15.645)
No gradient features5.300±1.4315.300 \pm1.431 (6.316)1.1×103±157.71.1 \times10^{3} \pm157.7 (1.8×1031.8 \times10^{3})790.1±22.984790.1 \pm22.984 (1.4×1031.4 \times10^{3})19.601±1.30419.601 \pm1.304 (25.856)
HierarchicalWith gradient features0.9877±0.02010.9877 \pm0.0201 (2.414)2.157±0.01602.157 \pm0.0160 (3.137)1.279±0.02151.279 \pm0.0215 (2.194)4.531±0.07694.531 \pm0.0769 (12.805)
No gradient features1.151±0.05011.151 \pm0.0501 (2.963)2.515±0.04602.515 \pm0.0460 (4.160)1.426±0.05691.426 \pm0.0569 (2.583)5.134±0.04105.134 \pm0.0410 (15.701)
FunnelWith gradient features0.5069±0.00610.5069 \pm0.0061 (1.082)0.1535±0.00320.1535 \pm0.0032 (0.2379)0.2672±0.00740.2672 \pm0.0074 (0.4131)0.6550±0.12380.6550 \pm0.1238 (2.128)
No gradient features0.5200±0.00590.5200 \pm0.0059 (1.095)0.2003±0.00550.2003 \pm0.0055 (0.3083)0.2784±0.00610.2784 \pm0.0061 (0.4373)0.5170±0.02180.5170 \pm0.0218 (1.560)
BananaWith gradient features1.093±0.00691.093 \pm0.0069 (1.492)6.112±0.05656.112 \pm0.0565 (7.823)2.127±0.01382.127 \pm0.0138 (3.341)4.295±0.02274.295 \pm0.0227 (6.514)
No gradient features1.079±0.00401.079 \pm0.0040 (1.548)7.048±0.03817.048 \pm0.0381 (9.012)2.207±0.01902.207 \pm0.0190 (4.196)4.396±0.09344.396 \pm0.0934 (6.846)

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=25d = 25.

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=25d = 25.

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=25d = 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.

Target FamilyMethod ↓Metric → sliced W1propW_{1}^{\mathrm{prop}} ↓rev. KL ↓log Z err. ↓E[xx] err. ↓
BLRWith EM features1.174±0.03331.174 \pm0.0333 (2.600)409.9±3.154409.9 \pm3.154 (1.0×1031.0 \times10^{3})374.4±4.126374.4 \pm4.126 (994.0)6.832±0.26526.832 \pm0.2652 (15.645)
No EM features0.9059±0.01320.9059 \pm0.0132 (1.908)357.5±5.075357.5 \pm5.075 (960.2)335.0±4.293335.0 \pm4.293 (916.3)5.496±0.07355.496 \pm0.0735 (11.569)
HierarchicalWith EM features0.9877±0.02010.9877 \pm0.0201 (2.414)2.157±0.01602.157 \pm0.0160 (3.137)1.279±0.02151.279 \pm0.0215 (2.194)4.531±0.07694.531 \pm0.0769 (12.805)
No EM features1.255±0.05031.255 \pm0.0503 (3.175)2.683±0.05712.683 \pm0.0571 (4.568)1.512±0.02041.512 \pm0.0204 (2.838)5.239±0.06985.239 \pm0.0698 (13.861)
FunnelWith EM features0.5069±0.00610.5069 \pm0.0061 (1.082)0.1535±0.00320.1535 \pm0.0032 (0.2379)0.2672±0.00740.2672 \pm0.0074 (0.4131)0.6550±0.12380.6550 \pm0.1238 (2.128)
No EM features0.5486±0.00960.5486 \pm0.0096 (1.218)0.2895±0.04440.2895 \pm0.0444 (0.4191)0.2871±0.00200.2871 \pm0.0020 (0.4446)0.6850±0.05090.6850 \pm0.0509 (2.014)
BananaWith EM features1.093±0.00691.093 \pm0.0069 (1.492)6.112±0.05656.112 \pm0.0565 (7.823)2.127±0.01382.127 \pm0.0138 (3.341)4.295±0.02274.295 \pm0.0227 (6.514)
No EM features1.081±0.00011.081 \pm0.0001 (1.458)5.974±0.05505.974 \pm0.0550 (7.592)2.057±0.05542.057 \pm0.0554 (3.302)4.286±0.04254.286 \pm0.0425 (6.671)

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=25d = 25.

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=25d = 25.

Objective Choice

Here we give results for using differing objectives. We give the full results for the use different stochastic divergences DD (Table 11), and also investigate the effect of removing the step-wise objective and of removing the pathwise gradient through the rollout.

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=25d = 25. A “-” indicates that the mean could not be calculated due to a numerical divergence.

Target FamilyMethod ↓Metric →sliced W1propW_{1}^{\mathrm{prop}} ↓rev. KL ↓log ZZ err. ↓E[x]\mathbb{E}[x] err. ↓
BLRKL(qt∥p)\mathrm{KL}(q_t \mathbin\Vert p)1.174 ±0.0333 (2.600)409.9 ±3.154 (1.0×10³)374.4 ±4.126 (994.0)6.832 ±0.2652 (15.645)
BLRKL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t) (SNIS)118.2 ±94.077 (128.3)1.3×10¹⁴ ±1.8×10¹⁴ (2.6×10³⁵)1.6×10³ ±1.4×10³ (5.0×10³)21.066 ±1.232 (27.944)
BLRKL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t) (oracle draws)2.344 ±0.4549 (3.144)1.5×10¹⁹ ±2.7×10¹⁹ (1.1×10¹⁴)583.8 ±41.198 (1.1×10³)11.520 ±1.502 (18.700)
HierarchicalKL(qt∥p)\mathrm{KL}(q_t \mathbin\Vert 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)
HierarchicalKL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t) (SNIS)----
HierarchicalKL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t) (oracle draws)----
FunnelKL(qt∥p)\mathrm{KL}(q_t \mathbin\Vert 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)
FunnelKL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t) (SNIS)58.695 ±4.989 (64.920)1.6×10³ ±1.3×10³ (3.0×10³)4.496 ±0.7189 (6.445)13.183 ±0.8694 (28.047)
FunnelKL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t) (oracle draws)1.225 ±0.3780 (2.005)1.0×10¹¹ ±1.8×10¹¹ (8.1×10³)0.2145 ±0.0077 (0.3352)0.6345 ±0.0102 (1.753)
BananaKL(qt∥p)\mathrm{KL}(q_t \mathbin\Vert 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)
BananaKL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t) (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)
BananaKL(p∥qt)\mathrm{KL}(p \mathbin\Vert q_t) (oracle draws)0.5676 ±0.0151 (0.7589)408.9 ±88.470 (1.1×10³)1.130 ±0.0392 (2.398)4.552 ±0.0809 (8.082)

Table 11.

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.

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=25d = 25.

Target FamilyMethod ↓Metric →sliced W1propW_{1}^{\mathrm{prop}} ↓rev. KL ↓log ZZ err. ↓E[x]\mathbb{E}[x] err. ↓
BLRFull model1.174 ±0.0333 (2.600)409.9 ±3.154 (1.0×10³)374.4 ±4.126 (994.0)6.832 ±0.2652 (15.645)
BLRTerminal objective only2.706 ±0.6514 (3.839)717.5 ±101.8 (1.3×10³)604.1 ±97.197 (1.1×10³)12.982 ±3.012 (20.797)
BLRStep-wise0.8079 ±0.0069 (1.701)320.2 ±2.461 (871.4)310.9 ±2.342 (858.9)5.005 ±0.0412 (10.651)
HierarchicalFull model0.9877 ±0.0201 (2.414)2.157 ±0.0160 (3.137)1.279 ±0.0215 (2.194)4.531 ±0.0769 (12.805)
HierarchicalTerminal objective only2.184 ±0.1925 (3.297)7.913 ±0.6277 (11.317)2.727 ±0.2046 (4.947)10.343 ±0.5920 (18.960)
HierarchicalStep-wise1.227 ±0.0190 (2.463)2.377 ±0.0102 (4.292)1.404 ±0.0219 (2.434)4.881 ±0.1296 (10.874)
FunnelFull model0.5069 ±0.0061 (1.082)0.1535 ±0.0032 (0.2379)0.2672 ±0.0074 (0.4131)0.6550 ±0.1238 (2.128)
FunnelTerminal objective only0.5172 ±0.0042 (1.109)0.1971 ±0.0094 (0.3104)0.4416 ±0.0188 (0.6401)0.9632 ±0.1450 (2.622)
FunnelStep-wise0.5615 ±0.0638 (1.201)0.2207 ±0.0622 (0.3148)0.2858 ±0.0114 (0.4576)0.6370 ±0.0193 (1.863)
BananaFull model1.093 ±0.0069 (1.492)6.112 ±0.0565 (7.823)2.127 ±0.0138 (3.341)4.295 ±0.0227 (6.514)
BananaTerminal objective only0.9906 ±0.0079 (1.379)5.396 ±0.1244 (7.116)1.543 ±0.0322 (2.646)4.135 ±0.0219 (6.599)
BananaStep-wise1.126 ±0.0014 (1.571)6.778 ±0.0132 (8.601)2.427 ±0.0287 (3.934)4.431 ±0.0575 (6.524)

Table 10.

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 parameterisations. We found the diagonal covariance to be the most stable in our experiments.

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=25d = 25.

Target FamilyMethod ↓Metric →sliced W1propW_{1}^{\mathrm{prop}} ↓rev. KL ↓log ZZ err. ↓E[x]\mathbb{E}[x] err. ↓
BLRDiagonal1.174 ±0.0333 (2.600)409.9 ±3.154 (1.0×10³)374.4 ±4.126 (994.0)6.832 ±0.2652 (15.645)
BLRIsotropic1.956 ±0.0392 (2.927)615.5 ±45.231 (1.1×10³)495.5 ±45.231 (1.0×10³)9.346 ±0.1797 (16.318)
BLRFull262.0 ±270.3 (288.0)1.4×10⁵ ±2.5×10⁵ (3.8×10⁵)827.1 ±34.365 (1.5×10³)21.699 ±1.606 (29.616)
HierarchicalDiagonal0.9877 ±0.0201 (2.414)2.157 ±0.0160 (3.137)1.279 ±0.0215 (2.194)4.531 ±0.0769 (12.805)
HierarchicalIsotropic*2.710 ±0.0008 (5.984)14.136 ±0.2302 (22.366)5.371 ±0.0832 (13.536)11.226 ±0.1195 (27.474)
HierarchicalFull8.314 ±11.169 (12.147)157.2 ±25.67 (328.0)11.193 ±14.756 (17.452)16.326 ±14.053 (29.943)
FunnelDiagonal0.5069 ±0.0061 (1.082)0.1535 ±0.0032 (0.2379)0.2672 ±0.0074 (0.4131)0.6550 ±0.1238 (2.128)
FunnelIsotropic1.277 ±0.0069 (2.059)1.564 ±0.0150 (1.848)0.8495 ±0.0168 (1.112)1.459 ±0.0009 (2.102)
FunnelFull0.5139 ±0.0027 (1.108)0.2111 ±0.0107 (0.3171)0.2779 ±0.0064 (0.4398)0.6449 ±0.0436 (1.574)
BananaDiagonal1.093 ±0.0069 (1.492)6.112 ±0.0565 (7.823)2.127 ±0.0138 (3.341)4.295 ±0.0227 (6.514)
BananaIsotropic1.124 ±0.0019 (1.554)6.739 ±0.0051 (8.484)2.375 ±0.0196 (3.770)4.378 ±0.0107 (6.478)
BananaFull*1.074 ±0.0008 (1.515)6.078 ±0.0086 (7.864)2.090 ±0.0150 (3.396)4.308 ±0.0083 (6.639)

Table 12.

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 Table 13 and Table 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.

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.

Target FamilyHidden dim. ↓Metric →sliced W1propW_1^{\mathrm{prop}} ↓rev. KL ↓log Z err. ↓E[xx] err. ↓
BLRH=64H = 641.174 ±0.0333 (2.600)409.9 ±3.154 (1.0×10³)374.4 ±4.126 (994.0)6.832 ±0.2652 (15.645)
BLRH=16H = 163.119 ±0.1201 (3.784)758.6 ±16.843 (1.3×10³)644.2 ±16.823 (1.2×10³)14.417 ±0.8210 (21.133)
BLRH=32H = 321.808 ±0.1249 (2.609)602.8 ±22.304 (1.1×10³)484.6 ±20.098 (992.2)8.506 ±0.5306 (14.841)
BLRH=128H = 1281.687 ±0.1518 (3.390)527.6 ±24.223 (1.2×10³)448.7 ±22.353 (1.1×10³)8.904 ±0.9462 (18.417)
HierarchicalH=64H = 640.9877 ±0.0201 (2.414)2.157 ±0.0160 (3.137)1.279 ±0.0215 (2.194)4.531 ±0.0769 (12.805)
HierarchicalH=16H = 162.813 ±0.0464 (3.642)13.661 ±0.6366 (18.976)3.318 ±0.1224 (5.651)11.879 ±0.2681 (20.676)
HierarchicalH=32H = 321.300 ±0.0295 (3.383)3.207 ±0.1227 (5.951)1.651 ±0.0667 (3.040)5.711 ±0.1024 (15.312)
HierarchicalH=128H = 1280.7749 ±0.0127 (1.673)1.687 ±0.0207 (2.571)1.059 ±0.0069 (1.824)3.764 ±0.0740 (10.390)
FunnelH=64H = 640.5069 ±0.0061 (1.082)0.1535 ±0.0032 (0.2379)0.2672 ±0.0074 (0.4131)0.6550 ±0.1238 (2.128)
FunnelH=16H = 162.833 ±0.2592 (3.203)2.200 ±0.0906 (2.840)1.265 ±0.0686 (1.596)2.769 ±0.1653 (4.694)
FunnelH=32H = 320.5644 ±0.0160 (1.247)0.2447 ±0.0102 (0.3586)0.2977 ±0.0161 (0.4720)0.5783 ±0.0436 (1.698)
FunnelH=128H = 1280.5019 ±0.0041 (1.068)0.1478 ±0.0056 (0.2205)0.2610 ±0.0050 (0.4050)0.6051 ±0.0082 (1.691)
BananaH=64H = 641.093 ±0.0069 (1.492)6.112 ±0.0565 (7.823)2.127 ±0.0138 (3.341)4.295 ±0.0227 (6.514)
BananaH=16H = 160.6292 ±0.0107 (0.8657)24.527 ±0.2351 (30.369)6.734 ±0.1963 (10.040)5.299 ±0.0465 (8.114)
BananaH=32H = 321.142 ±0.0098 (1.598)6.902 ±0.0425 (8.885)2.411 ±0.0348 (3.775)4.375 ±0.0058 (6.627)
BananaH=128H = 1281.029 ±0.0021 (1.446)5.004 ±0.0154 (6.429)1.872 ±0.0087 (2.986)4.135 ±0.0205 (6.177)

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=25d = 25.

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.

Trained on ↓Evaluated on →BananaBLRFunnelHierarchical
d=5d = 5Banana0.5072 ±0.0042 (1.132)1.790 ±0.1044 (3.365)0.9594 ±0.0191 (1.709)3.040 ±0.0285 (6.533)
d=5d = 5BLR1.516 ±0.0204 (2.158)0.7486 ±0.0271 (2.397)1.598 ±0.0177 (2.336)3.607 ±0.0194 (6.645)
d=5d = 5Funnel0.7655 ±0.0175 (1.349)2.415 ±0.1542 (4.008)0.4658 ±0.0016 (0.9783)2.877 ±0.0391 (6.540)
d=5d = 5Hierarchical0.9649 ±0.0458 (1.698)4.585 ±1.097 (8.091)1.107 ±0.0319 (1.843)0.8718 ±0.0289 (1.500)
d=25d = 25Banana1.093 ±0.0069 (1.492)1.581 ±0.0354 (2.745)1.045 ±0.0203 (1.872)3.985 ±0.0198 (8.518)
d=25d = 25BLR1.610 ±0.0280 (1.955)1.174 ±0.0334 (2.602)1.480 ±0.0490 (2.378)4.234 ±0.0647 (8.567)
d=25d = 25Funnel1.294 ±0.1043 (1.680)1.848 ±0.1444 (2.702)0.5069 ±0.0061 (1.082)3.783 ±0.0331 (8.079)
d=25d = 25Hierarchical1.179 ±0.0258 (1.607)2.466 ±0.0576 (4.047)1.152 ±0.0756 (1.931)0.9878 ±0.0201 (2.414)

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.

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).

Method ↓ Metric →sliced W1propW^{\mathrm{prop}}_1 ↓sliced W1W_1 ↓rev. KL ↓ESS ↑log ZZ err. ↓E[x]E[x] err. ↓E∥x∥2E\lVert x\rVert^2 err. ↓
d=5d=5
AAIS0.4658 ±0.002 (0.978)0.5919 ±0.004 (1.21)0.1224 ±0.003 (0.194)0.2605 ±0.008 (0.015)0.1250 ±0.005 (0.241)0.3619 ±0.006 (1.07)70.126 ±0.267 (246.6)
DM-PMC0.9592 (1.69)0.9823 (1.83)11.360 (31.36)0.0301 (0.002)0.2691 (0.537)0.5487 (1.31)83.221 (267.1)
M-PMC0.7222 (1.43)0.7588 (1.57)0.7444 (1.52)0.0965 (0.004)0.1777 (0.347)0.5617 (1.43)78.737 (258.9)
GAPIS1.678 (2.44)1.425 (2.44)1.6×10251.6\times10^{25} (1.1×10121.1\times10^{12})0.0055 (0.001)0.4400 (1.05)0.9232 (1.94)71.511 (259.7)
True samples0.4451 (0.848)0.5206 (0.967)0.0000 (0.000)1.000 (1.00)0.0000 (0.000)0.1113 (0.241)15.528 (73.76)
d=25d=25
AAIS0.5069 ±0.006 (1.08)0.5561 ±0.008 (1.16)0.1535 ±0.003 (0.238)0.1953 ±0.006 (0.003)0.2672 ±0.007 (0.413)0.6550 ±0.124 (2.13)428.2 ±7.106 (1.6×1031.6\times10^3)
DM-PMC1.423 (2.22)1.706 (2.67)27.603 (37.52)0.0004 (0.000)4.277 (7.06)3.920 (6.95)483.0 (1.7×1031.7\times10^3)
M-PMC2.060 (2.85)2.074 (2.88)97.424 (126.9)0.0003 (0.000)10.626 (13.29)5.674 (8.45)461.2 (1.6×1031.6\times10^3)
GAPIS1.125 (1.68)2.045 (2.83)152.6 (207.5)0.0013 (0.000)9.789 (12.11)5.947 (8.63)448.7 (1.6×1031.6\times10^3)
True samples0.4787 (0.941)0.5088 (1.08)0.0000 (0.000)1.000 (1.00)0.0000 (0.000)0.1816 (0.397)79.879 (329.9)
d=50d=50
AAIS0.5123 ±0.002 (1.11)0.5039 ±0.012 (1.09)0.1306 ±0.001 (0.214)0.1327 ±0.003 (0.002)0.2921 ±0.003 (0.437)0.7300 ±0.110 (1.90)875.2 ±3.980 (3.3×1033.3\times10^3)
DM-PMC1.837 (2.65)2.090 (3.05)60.322 (76.70)0.0001 (0.000)18.597 (22.77)9.295 (12.86)934.0 (3.4×1033.4\times10^3)
M-PMC2.263 (3.07)2.266 (3.06)245.1 (260.7)0.0001 (0.000)22.685 (26.08)9.375 (12.92)925.8 (3.3×1033.3\times10^3)
GAPIS1.070 (1.64)2.160 (3.07)356.6 (464.3)0.0006 (0.000)23.015 (26.58)9.638 (13.59)909.4 (3.4×1033.4\times10^3)
True samples0.4830 (0.967)0.4836 (0.910)0.0000 (0.000)1.000 (1.00)0.0000 (0.000)0.1553 (0.315)99.954 (431.2)

Table 17. Experimental results for Funnel d=5,25,50d=5,25,50. Metrics reported follow the convention of Table 1.

Method ↓ Metric →sliced W1propW_1^{\mathrm{prop}} ↓sliced W1W_1 ↓rev. KL ↓ESS ↑log ZZ err. ↓E[x]\mathbb{E}[x] err. ↓E∥x∥2\mathbb{E}\lVert x\rVert^2 err. ↓
AAIS0.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-PMC1.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-PMC2.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)
GAPIS138.7 (543.3)4.140 (8.03)1.8×1061.8 \times10^6 (8.9×1068.9 \times10^6)0.0016 (0.000)2.449 (5.90)6.160 (14.54)86.651 (242.6)
True samples0.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)
AAIS0.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-PMC3.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×1032.4 \times10^3)
M-PMC5.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×1032.6 \times10^3)
GAPIS429.0 (1.2×1031.2 \times10^3)8.042 (11.18)7.5×1077.5 \times10^7 (2.9×1082.9 \times10^8)0.0007 (0.000)19.314 (41.64)39.403 (60.79)1.2×1031.2 \times10^3 (2.7×1032.7 \times10^3)
True samples0.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 21. Experimental results for the Bayesian hierarchical model d=5,25d = 5, 25. Metrics reported follow the convention of Table 1.

Target FamilyAmortised overEvaluated onsliced W1propW_1^{\mathrm{prop}} ↓rev. KL ↓log ZZ err. ↓E[x]\mathbb{E}[x] err. ↓
BananaSingle-targetSingle-target0.6679 ±0.0009 (0.7235)3.445 ±0.0024 (3.675)1.096 ±0.0005 (1.529)2.821 ±0.0426 (5.602)
BananaFamilySingle-target0.8139 ±0.0048 (0.8673)4.671 ±0.0535 (4.920)1.500 ±0.0244 (2.102)3.160 ±0.0164 (5.759)
BananaSingle-targetFamily0.8439 ±0.0201 (1.162)147.0 ±17.239 (500.2)2.563 ±0.0315 (4.500)4.627 ±0.0680 (7.142)
BananaFamilyFamily1.093 ±0.0069 (1.492)6.112 ±0.0565 (7.823)2.127 ±0.0138 (3.340)4.295 ±0.0227 (6.514)
FunnelSingle-targetSingle-target0.3999 ±0.0002 (0.5568)0.1336 ±0.0009 (0.1866)0.2656 ±0.0062 (0.3187)0.6306 ±0.0416 (2.064)
FunnelFamilySingle-target0.4041 ±0.0032 (0.5610)0.1309 ±0.0023 (0.1845)0.2647 ±0.0081 (0.3222)0.6437 ±0.0836 (2.051)
FunnelSingle-targetFamily0.5072 ±0.0044 (1.051)0.1622 ±0.0017 (0.2438)0.2661 ±0.0049 (0.4080)0.6296 ±0.0358 (2.098)
FunnelFamilyFamily0.5069 ±0.0061 (1.082)0.1535 ±0.0032 (0.2379)0.2672 ±0.0074 (0.4131)0.6550 ±0.1238 (2.128)
BLRSingle-targetSingle-target1.308 ±0.0322 (1.420)412.6 ±3.939 (432.2)293.7 ±5.751 (335.1)4.827 ±0.1062 (5.905)
BLRFamilySingle-target1.399 ±0.1051 (1.609)461.4 ±4.167 (492.9)428.8 ±7.762 (461.9)7.790 ±0.5420 (9.006)
BLRSingle-targetFamily2.481 ±0.0830 (3.223)786.0 ±5.995 (1.4×1031.4 \times10^3)605.2 ±9.940 (1.1×1031.1 \times10^3)12.123 ±0.3951 (18.309)
BLRFamilyFamily1.174 ±0.0332 (2.600)409.9 ±2.980 (1.1×1031.1 \times10^3)374.3 ±4.139 (998.9)6.826 ±0.2540 (15.623)
HierarchicalSingle-targetSingle-target0.4696 ±0.0058 (0.6323)1.405 ±0.0140 (1.546)0.9722 ±0.0194 (1.546)2.012 ±0.0388 (4.466)
HierarchicalFamilySingle-target0.5641 ±0.0198 (0.7198)1.849 ±0.0380 (1.994)1.281 ±0.0208 (1.572)2.601 ±0.0934 (5.415)
HierarchicalSingle-targetFamily3.399 ±0.1079 (7.696)9.786 ±0.8974 (29.533)4.720 ±0.1137 (15.600)13.206 ±0.1720 (36.371)
HierarchicalFamilyFamily0.9878 ±0.0201 (2.414)2.157 ±0.0160 (3.137)1.279 ±0.0214 (2.196)4.530 ±0.0764 (12.802)

Table 22. Experimental results showing the performance of AAIS amortised over a single target vs over a whole family, all targets are at d=25d = 25. Metrics reported follow the convention of Table 1.

References

  1. [1]Agapiou, S., Papaspiliopoulos, O., Sanz-Alonso, D., and Stuart, A. M. (2017). Importance sampling: Intrinsic dimension and computational cost. Statistical Science, pages 405–431.arxiv.org/abs/1511.06196
  2. [2]Akyildiz, Ö. D. and Míguez, J. (2021). Convergence rates for optimised adaptive importance samplers. Statistics and Computing, 31(2):12.
  3. [3]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).arxiv.org/abs/2501.06148
  4. [4]Bonneel, N., Rabin, J., Peyré, G., and Pfister, H. (2015). Sliced and Radon Wasserstein barycenters of measures. Journal of Mathematical Imaging and Vision.
  5. [5]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.DOI
  6. [6]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.
  7. [7]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.DOI
  8. [8]Chen, Z., Naslidnyk, M., Gretton, A., and Briol, F.-X. (2024). Conditional Bayesian quadrature. Uncertainty in Artificial Intelligence (UAI).arxiv.org/abs/2406.16530
  9. [9]Cornuet, J.-M., Marin, J.-M., Mira, A., and Robert, C. P. (2012). Adaptive multiple importance sampling. Scandinavian Journal of Statistics.
  10. [10]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.
  11. [11]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).DOI
  12. [12]El-Laham, Y. and Bugallo, M. F. (2019). Stochastic gradient population Monte Carlo. IEEE Signal Processing Letters.
  13. [13]El-Laham, Y. and Bugallo, M. F. (2021). Policy gradient importance sampling for Bayesian inference. IEEE Transactions on Signal Processing.
  14. [14]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).
  15. [16]Elvira, V., Chouzenoux, E., Akyildiz, Ö. D., and Martino, L. (2023). Gradient-based adaptive importance samplers. Journal of the Franklin Institute, 360(13):9490–9514.arxiv.org/abs/2210.10785
  16. [17]Elvira, V. and Martino, L. (2021). Advances in importance sampling. Wiley Interdisciplinary Reviews: Computational Statistics, pages 1–14.DOI
  17. [18]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.
  18. [19]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).DOI
  19. [20]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).DOI
  20. [21]Gabrié, M. (2026). Leveraging generative models to assist Monte Carlo sampling. arXiv preprint arXiv:2608.07648.arxiv.org/abs/2608.07648
  21. [22]Gelman, A., Carlin, J. B., Stern, H. S., and Rubin, D. B. (1995). Bayesian data analysis. chapman and hall/CRC.
  22. [23]Golinski, A., Wood, F., and Rainforth, T. (2019). Amortized Monte Carlo integration. International Conference on Machine Learning (ICML).arxiv.org/abs/1907.08082
  23. [24]Haario, H., Saksman, E., and Tamminen, J. (1999). Adaptive proposal distribution for random walk Metropolis algorithm. Computational statistics, 14(3):375–395.DOI
  24. [25]Han, J. and Liu, Q. (2017). Stein variational adaptive importance sampling. Uncertainty in Artificial Intelligence (UAI).arxiv.org/abs/1704.05201
  25. [26]Hastings, W. K. (1970). Monte Carlo sampling methods using Markov chains and their applications. Biometrika, 57:97–109.
  26. [27]Kingma, D. P. and Ba, J. (2015). Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR).arxiv.org/abs/1412.6980
  27. [28]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).arxiv.org/abs/2302.01170
  28. [29]Klein, L. and Noé, F. (2024). Transferable Boltzmann generators. Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2406.14426
  29. [31]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.
  30. [32]Müller, T., Mcwilliams, B., Rousselle, F., Gross, M., and Novák, J. (2019). Neural importance sampling. ACM Transactions on Graphics.
  31. [33]Neal, R. M. (2001). Annealed importance sampling. Statistics and computing, 11(2):125–139.
  32. [34]Neal, R. M. (2003). Slice sampling. The Annals of Statistics, 31(3):705–767.
  33. [37]Owen, A. B. (2013). Monte Carlo theory, methods and examples. https://artowen.su.domains/mc/.
  34. [39]Paige, B. and Wood, F. (2016). Inference networks for sequential Monte Carlo in graphical models. International Conference on Machine Learning (ICML).arxiv.org/abs/1602.06701
  35. [40]Perello, C. A. and Akyildiz, Ö. D. (2023). Adaptively optimised adaptive importance samplers. arXiv preprint arXiv:2307.09341.arxiv.org/abs/2307.09341
  36. [41]Ritchie, D., Horsfall, P., and Goodman, N. D. (2016). Deep amortized inference for probabilistic programs. arXiv preprint arXiv:1610.05735.arxiv.org/abs/1610.05735
  37. [42]Roberts, G. O. and Rosenthal, J. S. (2004). General state space Markov chains and MCMC algorithms. Probability Surveys.DOI
  38. [43]Ryu, E. K. (2016). Convex optimization for Monte Carlo: Stochastic optimization for importance sampling. Stanford University.
  39. [44]Sun, Z., Barp, A., and Briol, F.-X. (2023a). Vector-valued control variates. International Conference on Machine Learning (ICML).
  40. [45]Sun, Z., Oates, C. J., and Briol, F.-X. (2023b). Meta-learning control variates: Variance reduction with limited data. Uncertainty in Artificial Intelligence (UAI).
  41. [46]Williams, R. J. (1992). Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3):229–256.
  42. [48]Zaheer, M., Kottur, S., Ravanbakhsh, S., Poczos, B., Salakhutdinov, R. R., and Smola, A. (2017). Deep sets. Neural Information Processing Systems (NeurIPS).

Paper details

vlnc:W_nw7eubch
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 9

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Generative AI tools

View statement
Looking for related papers…
Contents