Title: Implicit Variational Inference for High-Dimensional Posteriors
Venue: NeurIPS 2023
Accepted: yes
Keywords: Implicit models

Variational Inference

Bayesian Deep Learning

Bayesian Inference

Generative Modelling
Abstract: In variational inference, the benefits of Bayesian models rely on accurately capturing the true posterior distribution. We propose using neural samplers that specify implicit distributions, which are well-suited for approximating complex multimodal and correlated posteriors in high-dimensional spaces. Our approach introduces novel bounds for approximate inference using implicit distributions by locally linearising the neural sampler. This is distinct from existing methods that rely on additional discriminator networks and unstable adversarial objectives. Furthermore, we present a new sampler architecture that, for the first time, enables implicit distributions over tens of millions of latent variables, addressing computational concerns by using differentiable numerical approximations. We empirically show that our method is capable of recovering correlations across layers in large Bayesian neural networks, a property that is crucial for a network's performance but notoriously challenging to achieve. To the best of our knowledge, no other method has been shown to accomplish this task for such large models. Through experiments in downstream tasks, we demonstrate that our expressive posteriors outperform state-of-the-art uncertainty quantification methods, validating the effectiveness of our training algorithm and the quality of the learned implicit approximation.

Implicit Variational Inference for High-Dimensional Posteriors

Abstract

In variational inference, the benefits of Bayesian models rely on accurately capturing the true posterior distribution. We propose using neural samplers that specify implicit distributions, which are well-suited for approximating complex multimodal and correlated posteriors in high-dimensional spaces. Our approach advances inference using implicit distributions by introducing novel approximate bounds by locally linearising the neural sampler. This is distinct from existing methods that rely on additional discriminator networks and unstable adversarial objectives. Furthermore, we present a new sampler architecture that, for the first time, enables implicit distributions over tens of millions of latent variables, addressing computational concerns by using differentiable numerical approximations. Our empirical analysis indicates our method is capable of recovering correlations across layers in large Bayesian neural networks, a property that is crucial for a network's performance but notoriously challenging to achieve. To the best of our knowledge, no other method has been shown to accomplish this task for such large models. Through experiments on downstream tasks, we demonstrate that our expressive posteriors outperform state-of-the-art uncertainty quantification methods, validating the effectiveness of our training algorithm and the quality of the learned implicit distribution.

1 Introduction

In the Bayesian approach to statistical inference, information about the data is captured by the posterior distribution over a model's latent variables. By marginalising (averaging) over the variables weighted by the posterior, Bayesian inference can provide excellent generalisation and model calibration. This is particularly compelling for complex models, such as modern deep models, where extreme overparametrisation makes overfitting inevitable unless precaution is taken (Wilson et al., 2020).

Exact Bayesian inference is, however, intractable for all but the simplest models. Practitioners, therefore, rely on approximate inference frameworks, which can be broadly categorised as either sampling-based approaches or variational inference (VI, Saul et al., 1996; Peterson, 1987), the latter being the preferred approach for high-dimensional problems. VI seeks a tractable approximation to the intractable true posterior, limiting us to simple approximations like the isotropic Gaussian, which are often far too crude to satisfactorily cover the posterior, either only narrowly covering a single posterior mode or placing excessive mass in low-probability regions of the posterior (Foong et al., 2019, 2020).

1

0

1

4

2

0

2

4

Mean-field VI

1

0

1

AVB

1

0

1

LIVI

1

0

1

HMC

Mean prediction

Epistemic uncertainty

Epistemic + aleatoric

To achieve more expressive approximations, implicit variational inference (IVI) defines distributions implicitly by transforming samples from a simple distribution. This provides much greater flexibility at the cost of not having a tractable likelihood for the posterior approximation (Diggle et al., 1984; Mohamed et al., 2016) and thus often requires unstable adversarial objectives based on density ratio estimation, which are not easy to scale to high dimensions (Sugiyama et al., 2012; Huszár, 2017).

The different approaches to posterior approximation can be imagined lying on a spectrum illustrated in Fig. 1. On the left, the mean-field VI approximation is much too confident in regions without data. Sampling-based approaches, here represented by Hamiltonian Monte Carlo (HMC) on the right, converge to the true posterior given enough compute, which, however, is typically prohibitively large. Implicit VI approaches, here represented by our proposed approximation, LIVI (Section 4), and Adversarial Variational Bayes (AVB, Mescheder et al., 2017a), which uses a discriminator network for density ratio estimation, hit a tractable middle-ground between the two extremes.

LIVI can produce highly flexible implicit densities approximating the posteriors of complex models through general (non-invertible) stochastic transformations. We present novel, stable training objectives through approximating a lower bound to the model evidence as well as a novel generator architecture, which results in a vastly improved capacity to model expressive distributions, even in millions of dimensions. Specifically, our contributions are:

We derive a novel approximate lower bound for variational inference using an implicit variational approximation to avoid unstable adversarial objectives.

To keep computational overhead at large scale in check, we further lower bound the approximate lower bound reducing memory requirements and run times significantly.

We devise a novel generator architecture capable of specifying highly correlated distributions in high dimensions whilst using a very manageable number of weights and biases, a necessity for modelling high-dimensional distribution.

The paper is organised as follows: Section 2 introduces the background on VI for Bayesian models in general, and VI with implicit distributions (IVI) in particular. Section 3 introduces our proposals to tackle well-known challenges in IVI. Integrating these proposals in Section 4 yields our novel bounds for implicit VI, and Section 5 places our paper in the context of the published literature. In Section 6, we experimentally evaluate our proposed method before summarising and concluding in Section 7.

2 Variational inference for Bayesian models

Consider the supervised learning setting, where we have a training set D = { ( x i , y i ) } n i =1 , X = { x i } n i =1 are the covariates (inputs) and Y = { y i } n i =1 are the labels (outputs), which we wish to fit using a Bayesian model parametrised by θ ∈ R m . That is, assuming a prior p ( θ ) over the parameters and a likelihood p ( D| θ ) , we wish to compute the posterior p ( θ | D ) = p ( D| θ ) p ( θ ) p ( D ) . As

computing this posterior is intractable for all but the simplest models, we turn to the framework of variational inference (VI) which finds the best matching tractable variational distribution, q γ ( θ ) parametrised by γ to the true posterior, p ( θ | D ) . A sensible measure of their closeness is the (intractable) Kullback-Leibler (KL) divergence between the two distributions defined as

Since the evidence, p ( D ) , does not depend on γ , minimising the above divergence is equivalent to maximising L ( γ ) , referred to as the evidence lower bound (ELBO), which then becomes the objective function in VI. It can be further expanded into a likelihood term and a regularisation term as

where the likelihood term encourages the variational approximation to model the data well, and the regularisation term tries to keep the posterior close to the prior.

2.1 Implicit variational inference

In implicit VI (IVI), the variational distribution is only implicitly defined through its generative process which allows sampling from this distribution, but neither its density nor the gradients of its density can be evaluated. One way to draw from an implicit distribution is to push a low-dimensional noise vector through a neural network (Mohamed et al., 2016; Tran et al., 2017; Shi et al., 2018). These models have also been called amortised neural samplers (Kumar et al., 2019), with the generative process z ∼ q ( z ) and θ = g γ ( z ) and the corresponding density

where q ( z ) is a fixed base distribution and g γ : R d → R m is a non-linear, typically non-invertible mapping due to which this integral is non-trivial to solve. The resulting intractability of the density precludes the usage of popular objectives in probabilistic modelling. The likelihood term from Eq. (2) and its gradients can be estimated using Monte Carlo and the reparameterization trick (Kingma et al., 2014). However, the regularisation term involves the entropy of q γ , H q [ q γ ] :

which following the intractability of the density Eq. (3) is not explicitly available. Moreover, critical to consider, q γ is not a well-defined density in the parameter space, as its support lies on a low dimensional manifold and has measure zero. Consequently, the KL divergence in Eq. (1) is not always well-defined (Arjovsky et al., 2017) giving rise to another noteworthy issue with IVI. To tackle this issue, standard IVI approaches (Sugiyama et al., 2012; Huszár, 2017) rely on density ratio estimators based on a discriminator (in GANs) to estimate the regularisation term . Geng et al. (2021) give a tractable and differentiable lower bound on this entropy.

3 A deep latent variable model and its entropy

In this section, we address the issues noted above, I : The implicit density lies on a low dimensional manifold, leading to ill-defined KL (Eq. (1)) and II : The entropy of the implicit density and its gradients are intractable.

3.1 Defining a proper KL divergence

To make the KL in Eq. (1) well-defined, we add Gaussian noise to the output of our neural sampler g γ which has the effect of making the implicit density continuous in the ambient space of θ , see Arjovsky et al. (Lemma 1, 2017) . Accordingly, we switch to the corresponding variational distribution - a Gaussian deep latent variable model (DLVM). This is a special case of the semi-implicit distribution

(Yin et al., 2018; Titsias et al., 2019) and equivalent to the generative model in a Gaussian variational autoencoder (VAE, Kingma et al., 2014; Rezende et al., 2014):

θ ∈ R m and the latent variable z ∈ R d . We assume a Gaussian base density q ( z ) = N ( z | 0 , I d ) . g γ is the neural sampler (or generator) and σ 2 ∈ R + is the fixed, homoscedastic variance of the output density, which we take to be small. Thus, each sample from the base density, z , results in a Gaussian output density, q γ ( θ | z ) . And the marginalisation leads to a very flexible q γ ( θ ) which informally, is an infinite mixture of Gaussians (example 2, Im et al., 2017). Generally, we do not have a closed form for q γ ( θ ) and consequently H [ q γ ] , due to the non-linear function g γ within q γ ( θ | z ) in Eq. (5), so we are still left with challenge II , which we address next.

3.2 Approximating the intractable entropy

With the DLVM, we can expand the entropy of the variational approximation in Eq. (4) as,

In principle, a Monte Carlo estimator of Eq. (5) could be used to approximate the q γ ( θ ) term and by extension, this entropy, but this estimator is biased and has high variance. This variance can be reduced with directed sampling via an encoder, but to avoid training an additional network, we derive an encoder-free approximation in the following. To do this, we need to work around the non-linearity of g γ that causes the intractability.

Linearisation of the generator First, to estimate q γ ( θ ) during training with lower variance than a direct Monte Carlo estimate, we consider an analytical approximation of Eq. (7) obtained via a local linearisation of the generator/neural sampler around z ′ :

where J g ( z ′ ) ∈ R m × d is the Jacobian of g γ evaluated in z ′ , which we assume exists. We can approximate g γ ( z ) by the linear function T 1 z ′ ( z ) when z is close to z ′ and obtain a Gaussian approximation of the output density, q γ ( θ | z ) ≈ ˜ q z ′ ( θ | z ) = N ( θ | T 1 z ′ ( z ) , σ 2 I m ) and substitute this into Eq. (5) to approximate q γ ( θ ) :

Now the expectation in Eq. (10) can be analytically solved by integrating over the latent variable (Tipping et al., 1999) and is Gaussian, which gives the closed form of the approximation

where

Approximation of the differential entropy We use the above result to approximate the entropy of the DLVM,

where log ˜ q z ′ = z ( θ ) is Eq. (11) evaluated at the samples z from the outer expectation. Importantly, we do the linearisation of q γ ( θ ) around the latent value z that is used to sample each θ in the expectation, which means that for small σ 2 -values, z is close to z ′ , and the linear approximation will be good. This amounts to using a point-wise Gaussian to approximate the entropy at z in the training objective, whilst sampling from the DLVM noted in Eq. (5). Hence, important to consider here, that the linearisation does not restrict the expressivity of the posterior that we finally obtain.

We could, in principle, evaluate the approximation in Eq. (13) numerically, but it involves the matrix inverse of C ( z ′ ) , which is computationally demanding. In Appendix A, we show that for small values of the output variance σ 2 , we can further approximate the differential entropy by

4 Linearised Implicit Variational Inference

Finally, we arrive at our novel approximation to the ELBO for IVI using Eq. (5) as the variational distribution. Using the entropy approximation from Eq. (14), we obtain the approximate ELBO denoted the Linearised Implicit Variational Inference (LIVI) bound

where c = m 2 + m 2 log 2 π . As the determinant of a matrix is the product of its singular values, the log determinant is the sum of the log of these singular values. If s d ( z ) ≥ . . . ≥ s 1 ( z ) are the non-zero singular values of the Jacobian J g ( z ) , we can write the log determinant term as

To avoid calculating all the singular values of a large Jacobian matrix, we can follow Geng et al. (2021, Eq. 10) and lower-bound Eq. (16) as

We defer the details of Eq. (16) and the algorithm (LOBPCG, Knyazev, 2001) for obtaining s 1 to Appendix C. This allows us to extend our variational approximation to high-dimensional parameter spaces, and using Eq. (17) we obtain a lower bound on L ′ ( γ ) given by

We denote L ′ ( γ ) the approximate LIVI bound with whole Jacobians and L ′′ ( γ ) the LIVI bound with a differentiable lower bound on the determinant. We draw comparisons between how well these bounds estimate the entropy of a DLVM model in Appendix F.5, and write the reparameterised version of both bounds in Appendix B. The relationships between the bounds and the evidence are

Based on the compute budget, the two LIVI bounds offer an accuracy vs compute trade-off. In both cases, entropy maximisation promotes the exploration of the latent space. It is also worthwhile to note that Eq. (15), which uses the entropy approximation in Eq. (13), is fundamentally different from other linearisation approaches in the literature (e.g., Immer et al., 2021), as we do not linearise the Bayesian model. Instead, our approach linearises the generator parameterising q γ ( θ | z ) only when needed to approximate the differential entropy, thus leaving the variational approximation unchanged.

5 Related Work

The usage of a secondary model to generate parameters of a primary model first appeared in the form of hypernetworks (Ha et al., 2017). Our approach is probabilistic and is hence closer to Bayesian hypernetworks (Krueger et al., 2017) that mandate invertibility of the generator. The formulation is exactly like normalising flows and thereby sidesteps the complexities of estimating the entropy term. Flow-based approximations require particular focus on the design of the variational approximation to curb the dimensionality of the flow and the Jacobian matrices. Louizos et al. (2017) use an expressive flow on the multiplicative factors of the weights in each layer and not on all weights jointly. Our method does not necessitate invertibility, making it more general. We also share parallels with works in manifold learning (Brehmer et al., 2020; Caterini et al., 2021) in that they also use noninvertible mappings and have to employ a general form of the standard change of variable formula log det( J g ( z ) ⊺ J g ( z )) in the approximating density. Kristiadi et al. (2022) infers an expressive distribution over a subset of weights by using a post hoc Laplace approximation as the base distribution for a normalising flow. This approach, however, inherits the usual scalability limitations of flows.

Broadly, works in implicit VI have proposed novel ways of estimating the ratio of the variational approximation to the prior (regularisation-term), usually referred to as density-ratio estimation (also referred to as the prior-contrastive formulation by Huszár, 2017). To the best of our knowledge, we are the first to propose and test an entropy approximation for an implicit density used as a variational approximation. In particular, Shi et al. (2018), Tran et al. (2017), and Pawlowski et al. (2017) have successfully demonstrated implicit variational inference using hypernetworks and align well with our goals. Tran et al. (2017) opt for training a discriminator network to maximally distinguish two distributions given only i.i.d. samples from each. This approach, though general, adds to the computational requirements and becomes more challenging in high dimensions (Sugiyama et al., 2012). To mitigate the overhead of training the discriminator for each update of the ELBO, many works limit the discriminator training to a single or few iterations. Furthermore, this approach entails an adversarial objective that is notoriously unstable (Mescheder et al., 2017b). Pawlowski et al. (2017) treat all weights as independent and find that a single discriminator network is inaccurate at estimating log ratios compared to the analytical form of Bayes by backprop (Blundell et al., 2015), and opt to use a kernel method that matches the analytical form more closely.

Shi et al. (2018) propose a novel way of estimating the ratio of the two densities using kernel regression in the space of parameters which obviates the need for a min-max objective but we expect to be inaccurate in estimating high-dimensional density ratios especially given a limited number of samples from both the densities as well as the RBF kernel. Pradier et al. (2018) are also motivated by the possibility of compressing the posterior in a lower-dimensional space and consider the parameters of the generator to be stochastic. They use an inference network with the generator/decoder and hence require empirical latent samples to train which doubles the training steps and limits the scalability. SIVI (Yin et al., 2018) and D-SIVI (Molchanov et al., 2019) use Monte Carlo (MC) averaging to approximate the variational approximation hence precluding an approximation over an intractable entropy as their resultant ELBOs only contains the explicit conditional q γ ( θ | z ) . Their novelties lie in using a general semi-implicit formulation to model all the weights of the network but as noted earlier this MC estimator is biased and has high variance. Yin et al., 2018 propose upper and lower bounds on the ELBO to train with this variational approximation and Molchanov et al. (2019) extend the approach by using an implicit prior.

Recently, several works have considered alternatives to high-dimensional inference by heuristically limiting randomness, e.g., Izmailov et al. (2020), Daxberger et al. (2021a,b), and Sharma et al. (2023). Our work is somewhat orthogonal to these, as we present a general method for performing high-dimensional inference. Indeed, while our focus here has been on inference in full networks, our bounds can readily be applied to subspaces or subnetworks too. A notable difference from the works building on the Laplace approximation, however, is that these works linearise the model during prediction and inference, whereas we do not. We linearise the neural sampler, g γ ( z ) , but only when it is used to estimate the intractable entropy and its gradients, see Eqs. (10) to (12). Thus, the resulting posterior approximation is, still a highly flexible (i.e., non-linearised) implicit distribution.

6 Experiments

We now test the proposed posterior approximation (Section 4) for its generalisation and calibration capabilities in downstream tasks on different established datasets. We use Bayesian Neural Networks (BNNs) for our analysis due to the immense number of global latent variables (i.e., the weights and biases) that are required by modern BNN architectures to perform well with larger datasets, validating our method on previously unreachable and untested scales for implicit VI.

We evaluate multiple posterior approximation schemes for solving various downstream tasks, with the final performance of the BNN serving as a metric for assessing the quality of each method's approximation of the true posterior. Ideally, we wish to understand whether an expressive posterior approximation helps uncertainty quantification in downstream tasks. As this is a challenging question to address directly, we compare LIVI against less flexible baselines to determine whether capturing posterior complexity leads to improved predictive performance and uncertainty estimates.

6.1 Experimental setup

Model definition Briefly, BNNs are standard neural networks with a prior on their parameters, which, post-training, results in a posterior distribution. In a notation similar to that of Section 2, BNNs can be presented as p ( θ | ( x , y )) ∝ p ( y | f θ ( x )) p ( θ ) , where θ represents the parameters of a

neural network denoted by f . The likelihood, p ( y | f θ ) , depends on the given task. In this section, we test proxies to the true posterior p ( θ | ( x , y )) for how well they 1) model the dataset, and 2) model regions away from the dataset.

For regression tasks, we use a Gaussian likelihood and learn the homoscedastic variance, η 2 , using type-II maximum likelihood, p ( y | f θ ( x )) = N ( y | µ = f θ ( x ) , η 2 ) . For classification tasks, we use a categorical likelihood function for the labels with logits produced by f θ .

Generator architecture To efficiently generate millions of correlated parameters, we introduce a novel architecture for the generator g γ ( z ) . We sample a low-dimensional noise matrix, which is gradually scaled up through the generator network using matrix multiplications (Shi et al., 2018). To generate all the parameters of the BNN, we gradually scale up this noise through the generator. The output from the first matrix multiplication layer is split and fed into a series of disconnected matrix multiplication networks that produce parameters for the individual layers of the BNN. This equates to pruning dense connections deeper in the network. This architecture is designed such that it can capture both within-layer correlations in the BNN (through the individual subnetworks), and across-layer correlations (through the first matrix multiplication), whilst having a manageable number of parameters. The architecture is described in detail in Appendix D and has been used for experiments in Sections 6.5 and 6.6.

Method comparison For LIVI, the generator or hypernetwork, g γ ( z ) , represents the implicit distribution over network parameters for the BNN, which we sample from. We explicitly mention which of the ELBOs, Eqs. (15) and (16), we use in every experiment. We compare our method with other scalable uncertainty quantification methods: Adversarial Variational Bayes (A VB, Mescheder et al., 2017a), last-layer Laplace approximation (LLLA, Daxberger et al., 2021a), deep ensembles (DE, Lakshminarayanan et al., 2017), mean-field VI (MFVI, Saul et al., 1996; Osawa et al., 2019), as well as a simple MAP estimate. We chose DEs over other methods, such as SWAG (Maddox et al., 2019), as Daxberger et al. (2021a) found this to be a stronger baseline. Where possible, we compare against Kernel Implicit Variational Inference (KIVI, Shi et al., 2018); these results are taken from their paper. The only other implicit VI method is A VB, which, in all experiments, uses the exact same generator architecture as LIVI. Where feasible, we compare with HMC as it is the gold-standard posterior approximation technique.

Overview of experiments The first two sections focus on regression; a toy example in Section 6.2 and tests on UCI regression datasets in Section 6.3. Next, we move to classification experiments, focusing on out-of-distribution (OOD) benchmarks. Section 6.4 shows results on MNIST, then Section 6.5 considers images from CIFAR10, allowing us to perform OOD testing of the posterior approximations in millions of dimensions. In Section 6.6, we test on CIFAR100, evaluating our approach on even larger dimensional BNN posteriors 1 . We discuss the metrics used in Appendix E.1.

6.2 Toy data

In Fig. 1, we compare posterior predictives of our method (LIVI) against the standard baselines for posterior inference on a simple sinusoidal toy dataset. We qualitatively assess the epistemic uncertainty, or the variance in the function space, in regions away from training data. The BNN contains 105 parameters and is thus small enough that we can use L ′ , Eq. (15), as the objective function for LIVI, (for the remaining details of the architectures and the training, see Appendix E.3). We observe that both AVB and MFVI dramatically underestimate uncertainties, whereas LIVI is much closer to Hamiltonian Monte Carlo (HMC). We further observe that LIVI's learned posterior approximation has multiple modes and heavy tails, see Appendix F.4.

6.3 UCI datasets

Here, we follow the setups in Lakshminarayanan et al. (2017) and Shi et al. (2018) and choose a single hidden-layered MLP as the BNN for all datasets. Due to the different dimensionalities of the datasets, the number of BNN parameters vary between 501 and 751. Still, at this scale, it is feasible to work with whole Jacobian matrices, which allows us to test L ′ , Eq. (15), as the objective function and

to analyse the performance difference with L ′′ , Eq. (18). Further details of the generator architectures and baseline methods are presented in Appendix E.4.

Our results are summarised in Table 1. Both LIVI bounds, L ′ and L ′′ , perform similarly, giving empirical justification for the lower bound in Eq. (17). Furthermore, both bounds are comparable to HMC. We train our objective with far fewer samples compared to KIVI and outperform it for even small hypernetwork architectures.

6.4 MNIST Dataset

We use three different out-of-distribution tests to examine the estimated uncertainty in downstream tasks. We use the LeNet architecture for the Bayesian neural network with a total of 44 000 parameters, necessitating the use of our second objective L ′′ , Eq. (18). We train on MNIST, achieving an indistribution test accuracy of ∼ 99 . 1% for all methods except MFVI, which achieves 98 . 6% .

OODTest M-C1 In this experiment, we consider three OOD datasets, FMNIST, KMNIST, EMNIST and Table 2 reports the averaged results. We outperform all the methods we compare against in both categories. This signifies that the implicit approximation makes the BNN less over-confident than competing methods when predicting over datasets that the BNN has not encountered in training.

OOD Test M2 We compare our method on another OOD benchmark by rotating the MNIST image by different angles (Daxberger et al., 2021a). For this benchmark, we plot the negative log-likelihoods and expected calibration errors for all rotation angles in Fig. 2, testing all approaches at varying extents of drift. We conclude that we perform the best in these two categories as well.

OODTest M3 As the last benchmark on MNIST, we opt to plot the empirical CDF of predictive entropies across OOD images (Lakshminarayanan et al., 2017; Louizos et al., 2017). Under covariate shift, a well-calibrated model should predict a uniform distribution for never-before-seen data. So, with a model trained on MNIST we calculate predictive entropies on OOD datasets, plotting each method's fraction of high-entropy predictions in Fig. 3. In other words, the smaller the area between the curve and the dashed line, the better the method. We find that LIVI consistently produces

0

30

60

90

120

150

180

Rotation angle °

0.0

2.5

5.0

7.5

NLL

LIVI

DE

LLLA

MFVI

AVB

MAP

0

30

60

90

120

150

180

Rotation angle °

0.0

0.2

0.4

0.6

ECE

NLL on R-MNIST

ECE on R-MNIST

0.0

0.5

1.0

1.5

2.0

Entropy

0.00

0.25

0.50

0.75

1.00

CDF/ counts over whole dataset

EMNIST

0.0

0.5

1.0

1.5

2.0

Entropy

FMNIST

LIVI

DE

LLLA

MFVI

AVB

Uniform

0.0

0.5

1.0

1.5

2.0

Entropy

KMNIST

higher-entropy predictions than competitors, showing that it is less overconfident for any OOD image.

We elaborate on our experimental set-ups in Appendix E.5, keeping the critical training parameters the same across methods and also reporting our computational requirements for these experiments.

6.5 CIFAR10

To test our approach at a larger scale, we consider the CIFAR10 image classification dataset. Here, for the BNN we use the same WideResNet architecture as Daxberger et al. (2021a) with 16 layers and a widen factor of 4 (Zagoruyko et al., 2016). This network architecture contains over 2.7 million trainable parameters, meaning that we again use our second objective L ′′ , Eq. (18). We generate all parameters with our novel hypernetwork architecture, described in Appendix D, with training details in Appendix E.6. All the methods reached very similar accuracies of ∼ 91 . 5% on the in-distribution test set when trained for 200 epochs, except for MFVI, which reached ∼ 88 . 2% .

OODTest M-C1 We report averaged AUROC and confidence to test if the models assign wrong labels with high probability, see Table 2. The set of OOD datasets contains SVHN, LSUN, and CIFAR100. LIVI again outperforms competitors by being less overconfident about OOD predictions.

OOD Test C2 We test the models' performances when presented with corrupted images from CIFAR-10-C (Hendrycks et al., 2019). The negative log-likelihoods (NLL) and expected calibration errors (ECE) for different corruption intensities are plotted in Fig. 4. LIVI retains a low NLL across all corruption intensities, showing that its predictive uncertainty is better calibrated than competitors. Similarly, LIVI achieves consistently low ECEs, showing that its accuracy and confidence are well-aligned (i.e., decrease at a similar rate), even as the corruption intensity increases.

6.6 CIFAR100

Finally, we test our approach on CIFAR100 using a WideResNet(28,10) as the BNN. Not only is this dataset more complex to model, the BNN contains roughly 36.5 million parameters, demonstrating that our approach can scale to large networks. The generator used for LIVI has only about twice

0

1

2

3

4

5

Corruption Intensity

0

2

4

6

8

NLL

LIVI

DE

LLLA

MFVI

MAP

0

1

2

3

4

5

Corruption Intensity

0.1

0.2

0.3

0.4

0.5

ECE

NLL with CIFAR-10-C

ECE with CIFAR-10-C

as many (variational) parameters as the BNN latent variables - the same amount of variational parameters required for a mean-field Gaussian posterior.

We compare our results with those presented by Nado et al. (2021), who use the same BNN architecture, see Table 3. This architecture is also used by Sharma et al. (2023), who test performance on this dataset in various sub-stochastic settings and report on the same metrics, with which our results can therefore also be compared. The results indicate that LIVI's learned posterior approaches the performance of an ensemble with a combined 146 million parameters, nearly twice the roughly 75 million parameters required by LIVI. Moreover, LIVI's posterior approximation appears better than a simpler approximation like MFVI, even though this uses the same amount of parameters.

7 Conclusion

In this paper, we present a novel method to scale implicit variational inference to latent variable models with millions of dimensions by circumventing the need for a discriminator network and an adversarial loss. We find that modelling the posterior with a highly flexible approximation indeed does have benefits in the OOD and data drift scenarios, which may be due to the approximate posterior capturing richer information like correlations and multiple modes. Our method performs better than deep ensembles in a number of OOD benchmarks. Unlike conventional probabilistic methods, we do not fall short on in-distribution accuracy. We empirically evaluated our bound on Bayesian neural networks with millions of latent variables. Our method can also be applied for inference in other latent variable models, such as V AEs (Kingma et al., 2014; Rezende et al., 2014; Mescheder et al., 2017a). Future work includes scaling our methods to models with hundreds of millions of parameters. For this, one could consider independent hypernetworks for each target model layer, thus reducing computational requirements at the cost of losing correlations across the layers. One could also consider efficient ways of putting priors over deep networks to curb dimensionality, such as the works by Karaletsos et al. (2018) and Trinh et al. (2020).

References

Arjovsky, Martin and Leon Bottou (2017). 'Towards Principled Methods for Training Generative Adversarial Networks'. In: International Conference on Learning Representations .

Bingham, Eli, Jonathan P. Chen, Martin Jankowiak, Fritz Obermeyer, Neeraj Pradhan, Theofanis Karaletsos, Rohit Singh, Paul Szerlip, Paul Horsfall, and Noah D. Goodman (2018). 'Pyro: Deep Universal Probabilistic Programming'. In: Journal of Machine Learning Research .

Blundell, Charles, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra (2015). 'Weight Uncertainty in Neural Network'. In: Proceedings of the 32nd International Conference on Machine Learning . Vol. 37. Proceedings of Machine Learning Research, pp. 1613-1622.

Brehmer, Johann and Kyle Cranmer (2020). 'Flows for simultaneous manifold learning and density estimation'. In: Advances in Neural Information Processing Systems . Vol. 33, pp. 442-453.

Caterini, Anthony L., Gabriel Loaiza-Ganem, Geoff Pleiss, and John P. Cunningham (2021). 'Rectangular Flows for Manifold Learning'. In: Neural Information Processing Systems .

Daxberger, Erik, Agustinus Kristiadi, Alexander Immer, Runa Eschenhagen, Matthias Bauer, and Philipp Hennig (2021a). 'Laplace Redux - Effortless Bayesian Deep Learning'. In: Advances in Neural Information Processing Systems .

Daxberger, Erik, Eric Nalisnick, James U Allingham, Javier Antoran, and Jose Miguel HernandezLobato (2021b). 'Bayesian Deep Learning via Subnetwork Inference'. In: Proceedings of the 38th International Conference on Machine Learning . Vol. 139. Proceedings of Machine Learning Research, pp. 2510-2521.

Detlefsen, Nicki S., Alison Pouplin, Cilie W. Feldager, Cong Geng, Dimitris Kalatzis, Helene Hauschultz, Miguel González-Duque, Frederik Warburg, Marco Miani, and Søren Hauberg (2021). 'StochMan'. In: GitHub. Note: https://github.com/MachineLearningLifeScience/stochman/ .

Diggle, Peter J. and Richard J. Gratton (1984). 'Monte Carlo Methods of Inference for Implicit Statistical Models'. In: Journal of the Royal Statistical Society. Series B (Methodological) 46.2, pp. 193-227.

Foong, Andrew, David Burt, Yingzhen Li, and Richard Turner (2020). 'On the Expressiveness of Approximate Inference in Bayesian Neural Networks'. In: Advances in Neural Information Processing Systems . Vol. 33, pp. 15897-15908.

Foong, Andrew, Yingzhen Li, José Miguel Hernández-Lobato, and Richard E Turner (2019). ''InBetween' Uncertainty in Bayesian Neural Networks'. In: arXiv preprint arXiv:1906.11537 .

Geng, Cong, Jia Wang, Zhiyong Gao, Jes Frellsen, and Søren Hauberg (2021). 'Bounds all around: training energy-based models with bidirectional bounds'. In: Advances in Neural Information Processing Systems . Vol. 34, pp. 19808-19821.

Ha, David, Andrew M. Dai, and Quoc V. Le (2017). 'HyperNetworks'. In: International Conference on Learning Representations .

Hendrycks, Dan and Thomas Dietterich (2019). 'Benchmarking Neural Network Robustness to Common Corruptions and Perturbations'. In: Proceedings of the International Conference on Learning Representations .

Huszár, Ferenc (2017). 'Variational inference using implicit distributions'. In: arXiv preprint arXiv:1702.08235 .

Im, Daniel Jiwoong, Sungjin Ahn, Roland Memisevic, and Yoshua Bengio (2017). 'Denoising Criterion for Variational Auto-Encoding Framework'. In: Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence . AAAI'17. San Francisco, California, USA: AAAI Press, pp. 2059-2065.

Immer, Alexander, Maciej Korzepa, and Matthias Bauer (2021). 'Improving predictions of Bayesian neural nets via local linearization'. In: Proceedings of The 24th International Conference on Artificial Intelligence and Statistics . Ed. by Arindam Banerjee and Kenji Fukumizu. Vol. 130. Proceedings of Machine Learning Research. PMLR, pp. 703-711.

Izmailov, Pavel, Wesley J Maddox, Polina Kirichenko, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson (2020). 'Subspace inference for Bayesian deep learning'. In: Uncertainty in Artificial Intelligence , pp. 1169-1179.

Karaletsos, Theofanis, Peter Dayan, and Zoubin Ghahramani (2018). 'Probabilistic MetaRepresentations Of Neural Networks'. In: arXiv preprint arXiv:1810.00555 .

Kingma, Diederik P and Max Welling (2014). 'Auto-encoding variational Bayes'. In: International Conference on Learning Representations .

Knyazev, Andrew V. (2001). 'Toward the Optimal Preconditioned Eigensolver: Locally Optimal Block Preconditioned Conjugate Gradient Method'. In: SIAM J. Sci. Comput. 23, pp. 517-541.

Krishnan, Ranganath, Pi Esposito, and Mahesh Subedar (2022). Bayesian-Torch: Bayesian neural network layers for uncertainty estimation . https://github.com/IntelLabs/bayesiantorch .

Krishnan, Ranganath, Mahesh Subedar, and Omesh Tickoo (2020). 'Specifying weight priors in bayesian deep neural networks with empirical bayes'. In: Proceedings of the AAAI Conference on Artificial Intelligence . Vol. 34. 04, pp. 4477-4484.

Kristiadi, Agustinus, Runa Eschenhagen, and Philipp Hennig (2022). 'Posterior Refinement Improves Sample Efficiency in Bayesian Neural Networks'. In: Advances in Neural Information Processing Systems . Ed. by S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh. Vol. 35. Curran Associates, Inc., pp. 30333-30346.

Krueger, David, Chin-Wei Huang, Riashat Islam, Ryan Turner, Alexandre Lacoste, and Aaron Courville (2017). 'Bayesian hypernetworks'. In: arXiv preprint arXiv:1710.04759 .

Kumar, Rithesh, Sherjil Ozair, Anirudh Goyal, Aaron Courville, and Yoshua Bengio (2019). 'Maximum entropy generators for energy-based models'. In: arXiv preprint arXiv:1901.08508 .

Lakshminarayanan, Balaji, Alexander Pritzel, and Charles Blundell (2017). 'Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles'. In: Advances in Neural Information Processing Systems . Ed. by I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett. Vol. 30.

Louizos, Christos and Max Welling (2017). 'Multiplicative normalizing flows for variational bayesian neural networks'. In: International Conference on Machine Learning , pp. 2218-2227.

MacKay, David J. C. (May 1992). 'Bayesian Interpolation'. In: Neural Computation 4.3, pp. 415447.

Maddox, Wesley J, Pavel Izmailov, Timur Garipov, Dmitry P Vetrov, and Andrew Gordon Wilson (2019). 'A Simple Baseline for Bayesian Uncertainty in Deep Learning'. In: Advances in Neural Information Processing Systems . Ed. by H. Wallach, H. Larochelle, A. Beygelzimer, F. d'AlchéBuc, E. Fox, and R. Garnett. Vol. 32. Curran Associates, Inc.

Mescheder, Lars, Sebastian Nowozin, and Andreas Geiger (2017a). 'Adversarial Variational Bayes: Unifying Variational Autoencoders and Generative Adversarial Networks'. In: International Conference on Machine Learning (ICML) .

-(2017b). 'The Numerics of GANs'. In: Advances in Neural Information Processing Systems . Vol. 30.

Mohamed, Shakir and Balaji Lakshminarayanan (2016). 'Learning in implicit generative models'. In: arXiv preprint arXiv:1610.03483 .

Molchanov, Dmitry, Valery Kharitonov, Artem Sobolev, and Dmitry Vetrov (2019). 'Doubly SemiImplicit Variational Inference'. In: Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics . Vol. 89. Proceedings of Machine Learning Research.

Nado, Zachary, Neil Band, Mark Collier, Josip Djolonga, Michael W. Dusenberry, Sebastian Farquhar, Qixuan Feng, Angelos Filos, Marton Havasi, Rodolphe Jenatton, Ghassen Jerfel, Jeremiah Liu, Zelda Mariet, Jeremy Nixon, Shreyas Padhy, Jie Ren, Tim G. J. Rudner, Faris Sbahi, Yeming Wen, Florian Wenzel, Kevin Murphy, D. Sculley, Balaji Lakshminarayanan, Jasper Snoek, Yarin Gal, and Dustin Tran (2021). 'Uncertainty Baselines: Benchmarks for Uncertainty & Robustness in Deep Learning'. In: arXiv preprint arXiv:2106.04015 .

Osawa, Kazuki, Siddharth Swaroop, Mohammad Emtiyaz E Khan, Anirudh Jain, Runa Eschenhagen, Richard E Turner, and Rio Yokota (2019). 'Practical Deep Learning with Bayesian Principles'. In: Advances in Neural Information Processing Systems . Vol. 32.

Pawlowski, Nick, Andrew Brock, Matthew CH Lee, Martin Rajchl, and Ben Glocker (2017). 'Implicit weight uncertainty in neural networks'. In: arXiv preprint arXiv:1711.01297 .

Petersen, K. B. and M. S. Pedersen (2012). The Matrix Cookbook . Tech. rep. Version 20121115.

Peterson, Carsten (1987). 'A mean field theory learning algorithm for neural networks'. In: Complex systems 1, pp. 995-1019.

Pradier, Melanie F., Weiwei Pan, Jiayu Yao, Soumya Ghosh, and Finale Doshi-velez (2018). Projected BNNs: Avoiding weight-space pathologies by learning latent representations of neural network weights .

Rezende, Danilo Jimenez, Shakir Mohamed, and Daan Wierstra (2014). 'Stochastic backpropagation and approximate inference in deep generative models'. In: International Conference on Machine Learning .

Saul, Lawrence K., Tommi Jaakkola, and Michael I. Jordan (1996). 'Mean Field Theory for Sigmoid Belief Networks'. In: J. Artif. Int. Res. 4.1, pp. 61-76.

Sharma, Mrinank, Sebastian Farquhar, Eric Nalisnick, and Tom Rainforth (2023). 'Do Bayesian Neural Networks Need To Be Fully Stochastic?' In: Proceedings of The 26th International Conference on Artificial Intelligence and Statistics . Ed. by Francisco Ruiz, Jennifer Dy, and JanWillem van de Meent. Vol. 206. Proceedings of Machine Learning Research. PMLR, pp. 76947722.

Shi, Jiaxin, Shengyang Sun, and Jun Zhu (2018). 'Kernel Implicit Variational Inference'. In: International Conference on Learning Representations .

Sugiyama, Masashi, Taiji Suzuki, and Takafumi Kanamori (2012). Density Ratio Estimation in Machine Learning . Cambridge University Press.

Tipping, Michael E and Christopher M Bishop (1999). 'Probabilistic principal component analysis'. In: Journal of the Royal Statistical Society: Series B (Statistical Methodology) 61.3, pp. 611-622.

Titsias, Michalis K. and Francisco Ruiz (2019). 'Unbiased Implicit Variational Inference'. In: Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics . Vol. 89. Proceedings of Machine Learning Research, pp. 167-176.

Tran, Dustin, Rajesh Ranganath, and David Blei (2017). 'Hierarchical implicit models and likelihoodfree variational inference'. In: Advances in Neural Information Processing Systems 30.

Trinh, Trung, Samuel Kaski, and Markus Heinonen (2020). 'Scalable Bayesian neural networks by layer-wise input augmentation'. In: arXiv preprint arXiv:2010.13498 .

Wilson, Andrew G and Pavel Izmailov (2020). 'Bayesian Deep Learning and a Probabilistic Perspective of Generalization'. In: Advances in Neural Information Processing Systems . Vol. 33, pp. 4697-4708.

Yin, Mingzhang and Mingyuan Zhou (2018). 'Semi-Implicit Variational Inference'. In: Proceedings of the 35th International Conference on Machine Learning . Vol. 80. Proceedings of Machine Learning Research, pp. 5660-5669.

Zagoruyko, Sergey and Nikos Komodakis (2016). 'Wide Residual Networks'. In: Proceedings of the British Machine Vision Conference (BMVC) .

Implicit Variational Inference for High-Dimensional Posteriors

Supplementary material

A Derivation of the entropy approximation

In this section, we show that the approximation of the differential entropy in Eq. (13) can be further approximated by Eq. (14). Starting from Eq. (13), the entropy of a Gaussian DLVM can be approximated by ˜ H [˜ q ( θ )] , that is

where we use the subscript z ′ = z to specify that ˜ q is a linearised distribution that is linearised at z and distinct for each sample from the base distribution q ( z ) . Using the definition of ˜ q from Eqs. (11) and (12), we have

Our approximation of the entropy is thus

We rewrite the last term of Eq. (A.4) by using Eq. (380) from Petersen et al. (2012) to solve the inner expectation obtaining

where, in Eq. (A.7), we substituted µ ( z ) by g γ ( z ) -J g ( z ) z .

Now, we rewrite the two terms inside the expectation of Eq. (A.7) and apply the limit σ → 0 , following our small noise assumption in Section 3. For the first term inside the expectation, we get

where we obtained Eq. (A.11) using Eq. (159) by Petersen et al. (2012). Now, taking the limit of Eq. (A.12) as σ → 0 , we obtain

For the second term in Eq. (A.7), we use some basic identities for matrix traces and inverse. Namely, a constant term inside a trace can be moved outside, and the trace of a matrix is the sum of its eigenvalues (Petersen et al., 2012, Eq. 12). Furthermore, eigenvalues are reciprocated when the corresponding matrix is inverted (Petersen et al., 2012, Eq. 287). We have that

In Eq. (A.15), we use the squared singular values of J g ( z ) as per singular value decomposition (Petersen et al., 2012, Eq. 292). As before, we consider the limit of Eq. (A.16) as σ → 0 and obtain

For small values of the output variance σ 2 , we approximate the last term of ˜ H [˜ q ( θ )] in Eq. (A.4) by its limit as σ → 0 . Using the limits from Eqs. (A.13) and (A.17), we have

Applying the approximation in Eq. (A.20) to Eq. (A.4), gives us the final approximation

which is also stated in Eq. (14). It is important to note here that every Jacobian (w.r.t. input z ) matrix for generator map g γ is a function of γ , the variational parameters, and hence needs to be differentiable. To obtain whole Jacobian matrices, we use the nnj wrapper from the StochMan library (Detlefsen et al., 2021), which gives us Jacobians in a forward pass rather than requiring a for loop over backward passes.

B Reparameterisation of the LIVI bounds

We note that it is trivial to reparameterise the LIVI bounds as the Gaussian DLVM is straightforward to reparameterise. Using the base variables z , η , the generative process for a Gaussian DLVM, c.f. Appendix D, can be reparameterise as

The reparameterised LIVI with whole Jacobians, corresponding to Eq. (15), is

and the reparameterised LIVI bound with a differentiable lower bound on the determinant, corresponding to Eq. (18), is

C Singular values explained

Here we write out the steps that lead from the entropy approximation in Eq. (15) to the efficient entropy approximation we actually use Eq. (16). The first step is to note that the determinant of a square matrix can be written as the product of its eigenvalues and then the log determinant by extension can be written as the sum of the log of these eigenvalues. Let s 1 ( z ) , . . . , s m ( z ) be the singular values of the Jacobian J g ( z ) ⊺ (including zeros), using Petersen et al. (Eq. 286, 2012) we can write the log determinant term in Eq. (15) as

Strictly speaking, the matrix J g J ⊺ g is not full rank and has only d non-zero singular values, and thus this determinant will be equal to 0. The additional noise added at the output of the generator resolves this issue as it appears in the C ( z ) in Eq. (A.1).

As we do not wish to calculate all the singular values to estimate Eq. (C.3) exactly, because this would be computationally expensive, we resort to using a lower bound in Eq. (17). The terms in the summation in Eq. (C.3) are positive, so estimating this with any one singular value should give us a lower bound.

Depending on what singular value we wish to compute, we can use the LOBPCG algorithm, which iteratively optimises the generalised Rayleigh quotient and converges in linear time. All details about the convergence results are available in Knyazev (2001). We also employ an efficient backward mode to get vector-jacobian products to work with the generalised Rayleigh quotient, and thus we never need to store large Jacobian matrices during the calculation of this singular value. The Rayleigh quotient is given as follows:

D Novel generator architecture

Here we describe the novel generator architecture. A central property is that we drop dense connections deeper into the network. This resulted in an architecture that had fully connected matrix multiplication layers at the start and smaller individual networks deeper into the architecture. In other words, to decrease the number of parameters closer to the output of the network, dense connections are pruned away. The final output vector of parameters is generated via the concatenation of outputs from smaller networks, which can be thought of as producing weights for each layer in the BNN.

The architecture is pictorially represented in Fig. D.1. All computational blocks, as well as the input block in this network, are a matrices, as we follow the standard recipe of the Matrix multiplication neural network (Shi et al., 2018). Starting from the left, we have a large noise vector represented in matrix format. We use the 65x65-dimensional input noise matrix for MNIST experiments and the 130x130 input noise matrix for the CIFAR10 experiments. The noise is sampled from the standard normal distribution. Then we use a matrix multiplication layer to produce a higher dimensional output that is split and passed on to a series of disconnected individual matrix multiplication networks

MM layer

split

MM

MM

MM

MM

MM

MM

MM

MM

output

output

output

output

noise

that produce weights and biases for individual layers of the WideResNet BNN. This way the task of capturing correlations within layers is taken care of by the individual sub-networks towards the end and capturing correlations across layers is taken care of by the homogeneous layer at the start of the network.

E Experiment Details

E.1 Metrics

For regression, we test generalisation by measuring negative log-likelihoods and mean squared error over the test set.

For the classification experiments, we measure the averaged OOD AUROC and confidence (maximum softmax value) (Daxberger et al., 2021a) on OOD datasets. The OOD AUROC and confidence are crucial metrics to understand the behaviour of the BNN on unseen data. A low confidence score indicates that the model is very uncertain about a classification, while a high AUROC score suggests that the model does not misclassify unseen data with high probability or confidence. Such misclassifications would increase the false positive rate, thereby lowering the AUROC. Therefore, these metrics allow us to measure the model's generalisation performance on OOD data hinting at the quality of the posterior. We further consider the negative log-likelihood (NLL) and expected calibration error (ECE) for some OOD classification experiments. These two metrics ensure that the implicit approximation is not placing mass in undesirable regions of the posterior and is learning the right variance in the function space. If the NLL is lower for OOD points, it signifies that the functional variance farther from the data increases, which is desirable. At the same time, a low ECE indicates that the model's predictive confidence falls with its accuracy as per expectations.

E.2 Experimental setup

Details of the architectures used for the generator/hypernetwork and the Bayesian neural network for all of the experiments in Section 6, can be found in Table E.1. For reference, our novel CMMNN architecture is implemented as CorreMMGenerator in our code.

E.3 Toy experiments

We use a 2D toy sinusoidal dataset for this example with 70 training data points. We intentionally leave a gap in the middle to visualise the epistemic uncertainty or the diversity of functions in this

region as this has been reported by Foong et al. (2019) to be tricky or unachievable for simpler variational approximations.

The BNN architecture is shared across all the methods and is a two-hidden-layered MLP with 7 and 10 units and ELU activations trained with losses unique to each of the methods. We also assume homoscedastic noise in the data that is estimated by all the methods using an extra parameter learnt via type II maximum likelihood. This is set in the data generating process at 0.3.

LIVI: Here, a generator network, which is a one-hidden layered MLP with an 80-dimensional noise input and ELU activations, produces a 105-dimensional output vector which is then used to reparameterise the layers (weights and biases) of a BNN for training.

MFVI: For mean-field VI, we take advantage of the bayesian-torch library (Krishnan et al., 2022). We construct the exact same architecture for the BNN using the reparameterisable layers provided by this library and we slowly warm up the KL term reaching 1 towards the end of training. This is done to help the method converge.

HMC: We sample 10000 samples after a warmup of 2000 samples using the same and neural network architecture. We use the NUTS sampler available in the Pyro (Bingham et al., 2018) package.

AVB: We also compare our method qualitatively against the conventional style of training implicit distributions which uses a density ratio estimating discriminator network. Using the same architecture as above for the BNN, we use a one-hidden layered discriminator network that we retrain within each training loop of the BNN to discriminate 20 samples from the prior and the posterior (generator) each. We run this inner training loop for 10 epochs. The algorithm here is exactly the same as Algorithm 1 in Mescheder et al. (2017a).

E.4 Details of UCI experiments

We use an MLP BNN with 50 units in one hidden layer. We report the RMSE and log-likelihood on held-out data for our method. We use generator architectures with far fewer parameters than Shi et al. (2018) and do not assume independence across layers, i.e., we use one MLP to generate all the weights of the BNN. All of the generator architectures are one hidden layered MLP with a slightly varying number of units depending on the dataset.

We train our method with a homoscedastic assumption, i.e., the variance in the dataset is assumed to be constant and we train an observation noise parameter using type-II maximum likelihood.

E.5 MNIST experiments

Of the wide-ranging approximate inference approaches we compare against, some focus on capturing multiple modes like deep ensembles, while others like MFVI capture information around a single mode sacrificing all correlations for computational feasibility. Similarly, the Laplace approximation, a popular post hoc method (MacKay, 1992), captures unimodal information but can be made much faster by considering a sub-stochastic Bayesian neural network (Daxberger et al., 2021a). Moreover, there is a range of approximations for estimating the hessian that again, trade-off correlations for computational feasibility. In all of these cases, a single MAP estimate remains the easiest baseline to implement and train but represents the minimum amount of information that can be obtained about the posterior surface.

For all methods, we use the same LeNet architecture and for (LLLA, DE & MAP) we train with equal weight decay of 8 × 10 -4 . For MFVI, we use a standard normal prior.

LIVI For all our MNIST experiments we use an MMNN with 65 × 65 input noise, one hidden layer of size 250 × 250 and produce an output matrix of size 350 × 127 , the elements of which are used as weights and biases of the LeNet BNN. For all experiments, we trained without dataset augmentation and with a maximum of 1 to 2 samples (from q γ ( θ ) ) per minibatch. This network generates close to 44 000 parameters for the LeNet BNN while keeping its own parameters appreciably low compared to an MLP hypernetwork conserving computation required for the objective Eq. (18). The weights

and biases of the hypernetwork are the variational parameters that tune the output implicit distribution and here they number slightly over six hundred and ten thousand i.e. these are the total number of weights and biases in the hypernetwork.

LLLA The full Hessian for the last layer can be obtained very cheaply as the last layer Hessian is simply the Generalised Gauss Newton matrix since the network is linear in the last-layer weights (Immer et al., 2021). Hence, we strike a balance between expressivity and computational cost by obtaining the most accurate post-hoc covariance structure over a sub-stochastic network . We use a pretrained LeNet with a weight decay of 8e-4 for this method.

DE To represent deep ensembles we use five LeNet networks trained with different seeds and average over their predictions and use one of these networks to represent the MAP estimate. Each network is trained with a weight decay of 8e-4.

MFVI We use weights from a pre-trained LeNet for initialising the mean and retrain it for several more epochs using the ELBO and a standard normal prior to obtain an isotropic Gaussian posterior. Again this is done using bayesian-torch library and the MOPED functionality (Krishnan et al., 2020).

AVB We again compare our method to the existing adversarial training routine for implicit distributions which is represented by A VB (Algorithm 1, Mescheder et al., 2017a). For this method, we use an MLP discriminator with two hidden layers containing 2500 and 4500 neurons for classifying if a sample comes from the generator or the prior (regularisation term in Eq. (2)). We use 300 samples from the prior and the posterior (generator) for a full batch training of the discriminator for 5 epochs within each minibatch update of the main training loop.

KIVI To compare our method against Shi et al. (2018) we also use MLP BNNs as per their experimental setup and outperform on in-distribution test accuracy reported in Shi et al. (2018, Figure 2, left table). To test fairly against KIVI we use MLP BNN architectures only for this experiment as a LeNet would've been easily able to achieve better accuracy on the in-distribution test set. We find that with the same BNN and hypernetwork architectures we get better test accuracies on MNIST

Training To train LIVI, we use a Matrix Multiplication Neural Network (MMNN, Shi et al., 2018) as the hypernetwork architecture. For the LLLA, we use a complete ('full', Daxberger et al., 2021a) Hessian for the weights and biases in the last layer obtaining all correlations over a smaller parameter set to ensure feasibility. For deep ensembles, we average over five networks trained with weight decay. For one-to-one comparison with AVB we use the exact same generator and training hyperparameters as LIVI. To train LIVI with the aforementioned generator architecture it takes 12 . 3 GPU minutes on a Titax X (Pacal 12gb vram) GPU and consumes 980 megabytes of memory when training with a batch size of 256. On the other hand, to train a LeNet deep neural network with the same batch size on the same GPU it takes 3 . 07 GPU minutes and 700 megabytes of GPU memory.

E.6 CIFAR10 Experiments

LIVI We use our novel generator architecture for this experiment with a noise dimension of 130x130. This architecture and its configuration file for matrix multiplication layers are present in the code. We train with a batch size of 256 and with 2 samples per minibatch. We use Eq. (17) elbo as the objective for training. Our generator architecture produces all the parameters of the BNN, implicitly learning the correlation between and across layers. This hypernetwork contains about 7 million parameters, in other words, these are the number of variational parameters that tune the implicit distribution.

DE We train five WideResNet (Zagoruyko et al., 2016), each 16 layers deep with different initialisations using the same optimiser hyperparameters i.e. with NAdam optimiser with weight decay of 1 × 10 -4 , a learning rate of 7 . 8 × 10 -4 and with cosine annealing of the learning rate. We average predictions from these 5 networks to represent deep ensembles in our experiments.

MAP We train one WideResNet with the same weight decay and optimiser hyperparameters as above and use that for representing the MAP estimate.

LLLA For the last-layer Laplace approximation, we use a network trained similarly to a MAP network and then run post hoc Laplace on it, inferring a full Hessian matrix for all of the last-layer weights. Again this is done to strike a middle ground between inferring a very faithful posterior and keeping the computational requirements in check.

AVB Even though AVB is theoretically very close to our variational approximation, the size of the discriminator to distinguish 2.7 million dimensional samples from the prior and the implicit posterior to estimate the regularisation term in Eq. (2) poses a prohibitively large overhead. Due to this, we could not train A VB for this set of experiments.

Training Interestingly, our method trained using Eq. (16) takes less time to train than a deep ensemble consisting of five networks with the same training parameters and provides better uncertainty quantification than a non-Bayesian ensemble of neural networks. Keeping everything else the same, each network of the ensemble takes 34 minutes to train on CIFAR10 using an A5000(24 gb vram) for a total of 2.83 GPU hours whilst our method/architecture requires 2.30 GPU hours to train on the same dataset using the same GPU. We use Eq. (17) to train our implicit approximation and consume 4.1 GB of memory with a batch size of 256 and training with 2 elbo samples per minibatch. A vanilla WideResNet (MAP)consumes 1.4 GB to train with the same batch size.

E.7 Details of Fig. 1

In Fig. 1, we compare both the objective functions presented in this work for training with implicit variational approximations to different methods for uncertainty quantification for neural networks. All models were trained for five thousand iterations and had to learn observation noise present in the toy sinusoidal dataset. For all methods, we train with a homoscedastic assumption and obtain an observation noise parameter using type-II maximum likelihood. We deliberately removed a part of the data to see if the models tested were able to find in-between uncertainties. All methods were given the same sized 2 hidden layered MLP with 7 and 10 units respectively. We trained 5 MAP networks with different seeds for Deep Ensembles and average their predictions to make the plot. The variance of the predictions was then used for the epistemic uncertainty in blue. We also train the model with an observation noise parameter. For MFVI, we annealed the KL divergence between the prior and the posterior with a weighting term to help it to converge. The weighting term reaches one as the training nears completion. For HMC we sample 10000 samples using the library Pyro . We also tried to make multiplicative normalizing flows converge for this dataset, but with even 20K parameters and training for ten thousand iterations with a very small learning rate did not help. We even tried KL down weighting to reduce the effect of the prior in the initial iterations but that did not work either.

After training, we also plot a KDE-plot of the samples from the generator in Appendix F.4. As a sanity check, we do confirm that the generator is capable of representing non-trivial distributions as we can spot heavy tails and multiple modes in these plots. In this experiment, we qualitatively compare the epistemic uncertainty resulting from the respective inference schemes in the data-scarce regions.

E.8 Computation Graph

Here we provide some details about how the combination of the joint generator-BNN model works. The Bayesian neural network classes for all types of architectures(feed-forward, convolutions, etc.) require a generator in the init function. As such, the generator networks reside inside the BNN and reparametrise it with a simple sample_parameters function. The most important part of this kind of implementation was the layers themselves. PyTorch provides different kinds of mutable layer implementations in nn.module but these layers do not expose their state i.e. their parameters in a manner that allows changes on the fly during training. We reimplemented the layers allowing such resampling to occur with the generator. In the init function of the BNN, we generate one set of parameters with the generator, package it in a dict that has the weight sample as well as a index to know the number of weights used by a previous layer. This counter index is updated by each layer in their init and sample_parameters function. As such, only the parameters of the generator are trainable, the parameters of the BNN are switchable and relay gradients to the generator via the likelihood or the entropy term.

F Additional results

In this section, we report additional results. In particular, we consider multiplicative normalising flows (MNF, Louizos et al., 2017), as well as two versions of full Laplace, 1) a non-linearised full network Laplace using a low-rank approximation to the Hessian (FLAP), and 2) a linearised full network Laplace using a Kronecker factored structure of the Generalised Gauss-Newton approximation to the Hessian (FLLA).

While we show results for linearised Laplace, as this method often achieves state-of-the-art performance, it must be emphasised that, for LIVI, we do not linearise the posterior; we linearise the neural sampler g γ ( z ) , but only when it is used within the estimation the intractable entropy and its gradients, see Eqs. (10) to (12). The resulting posterior approximation is, therefore, still a highly flexible (that is, non-linearised) implicit distribution. Linearised Laplace and LIVI are, therefore, fundamentally different approaches. Whereas linearised Laplace linearises the BNN and the predictive function, we linearise the neural sampler/hyper-network within the variational distribution q γ ( θ | z ) , thus obtaining the approximation ˜ q z ′ ( θ | z ) , but only when it is needed to approximate the entropy. This is also the reason why we do not linearise our BNN for predictions, which is common practice with linearised Laplace.

F.1 Additional results for UCI datasets

In Tables F.1 and F.2, we report additional results for experiments on the UCI datasets. Overall, LIVI ( L ′ , Eq. (15)) performs competitively, either outperforming or being on par with HMC, which is considered the gold standard. The multiplicative normalising flow (MNF) is difficult to get to converge, and both the training time and memory consumption are worse than for LIVI (see Appendix F.3).

We do not show results for full Laplace here, as we repeatedly ran into errors thrown by the secondorder backends ( BackPack and Asdl ) of the laplace library (Daxberger et al., 2021a) when used regression tasks.

F.2 Additional results for OOD experiments

We show further results for the OOD experiment Test M-C1 in Table F.3, as well as Test M2 and M3 in Figs. F.1 and F.2, respectively. Note that we were unable to scale all the methods listed in Table F.3 to work on CIFAR10. In the table and both figures, the non-linearised version of full Laplace (FLAP) underfits due to the quite crude approximation to the posterior over the full network and generates

0

30

60

90

120

150

180

Rotation angle °

0.0

2.5

5.0

7.5

NLL

LIVI

DE

LLLA

MFVI

AVB

MAP

MNF

FLLA

FLAP

0

30

60

90

120

150

180

Rotation angle °

0.0

0.2

0.4

0.6

ECE

NLL on R-MNIST

ECE on R-MNIST

poor samples. The linearised version (FLLA) works slightly better than LIVI in terms of ECE and NLL on the rotated-MNIST benchmark (Fig. F.1) and in the OOD entropy-CDF test (Fig. F.2). As noted before in Section 5 and ?? , our approach is fundamentally different from linearised Laplace approaches as we do not linearise the model during prediction and inference and hence these methods are not directly comparable.

F.3 Runtime analysis

We report training times until convergence as well as memory consumption for LIVI and four competitors on MNIST in Table F.4. The methods were all run on the same single-GPU (NVIDIA RTX A4000) machine. Compared to other expressive VI methods like AVB and MNF, LIVI is faster to train and consumes less memory. In particular, the hypernetworks used for LIVI in all experiments only contain about twice as many parameters as the networks they are modelling the posterior over the same amount of parameters required for mean-field VI. Interestingly, even though the memory requirements for LIVI are higher than that of DE, LIVI trains in a shorter amount of time.

0.0

0.5

1.0

1.5

2.0

Entropy

0.00

0.25

0.50

0.75

1.00

CDF/ counts over whole dataset

EMNIST

0.0

0.5

1.0

1.5

2.0

Entropy

FMNIST

LIVI

DE

LLLA

MFVI

AVB

Uniform

FLLA

MNF

0.0

0.5

1.0

1.5

2.0

Entropy

KMNIST

Kernel Density Estimate(single weight)

0.5

0.4

0.3

0.2

0.1

0

2

4

6

8

10

Density

0.2

0.1

0.0

0.1

0.2

0

1

2

3

4

5

6

Density

0.1

0.0

0.1

0.2

0

2

4

6

8

10

Density

0.1

0.0

0.1

0

2

4

6

8

10

12

14

16

Density

4

2

0

2

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

Density

0.2

0.1

0.0

0.1

0.2

0.3

0

1

2

3

4

5

6

7

Density

1.0

0.5

0.0

0.5

1.0

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Density

0.25

0.50

0.75

1.00

1.25

1.50

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

Density

F.4 KDE plot

Figure F.3 shows a KDE plot of weights randomly chosen from samples obtained from a trained generator used for the toy dataset, see section 6.2.

F.5 Testing the entropy approximation

Because our proposal relies on approximating the entropy of an intractable variational approximation through linearisation, we test our approximation in isolation against an importance-sampled estimate of the entropy of a V AE's generative model.

For Fig. F.4, we estimate the entropy of a VAE decoder with a very small output variance using importance sampling as the ground truth. We choose a small output variance as this emulates our generator Section 3 which is, by construction very similar to a Gaussian V AE. Noteworthy here, the implicit variational approximation presented Section 3 does not involve an encoder architecture that parameterises the reverse distribution ˜ q ( z | θ ) and is only part of this experiment. For this analysis, the VAE was trained on HMC samples from a small BNN trained on toy sinusoidal data similar to Fig. 1. As such this VAE's decoder learns the generative distribution over parameters of a BNN very similar to the generator that parameterises the implicit variational approximation presented in this paper. The architecture of this V AE is also the same as the generator architectures used for experiments. The results here depict that even though the entropy estimated by the importance sampled ground truth and our bound in Eq. (17) are numerically different, our approximation Eq. (15) and the smallest singular value lower bound do retain and follow the characteristics of the ground truth making them viable estimators of this quantity.

0

0.5

1

1.5

2

2.5

3.0

3.5

4.0

4.5

5.0

VAE training iterations in 1000s

-135

-130

-125

-120

-115

-110

-105

-100

Entropy of the model in nats

Entropy Estimators

LIVI (eq 14)

LIVI (eq 17)

importance sampled

G Future Work

Scaling our method to models with hundreds of millions of parameters is an important line of future research. For this, one could consider independent hypernetworks for each layer of the BNN, thus reducing computational requirements at the cost of losing correlations across the layers. One could also consider efficient ways of putting priors over deep networks to curb dimensionality, such as the works by Karaletsos et al. (2018) and Trinh et al. (2020).

Wealso leave for the future applications of this implicit approximation to sequential learning problems like continual learning(see section 4.4 of Daxberger et al., 2021a) and also the several possible extensions of Eq. (18). We use a very simple yet potent individual singular value to approximate a log det term but expect that this term can be better approximated minimising information loss from the Jacobian matrices without compromising computational efficiency.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper proposes LIVI a variational-inference-based approach for Bayesian NNs. It hinges on implicit VI (IVI) which allows to easily sample from an arbitrary distribution, yet obtaining the gradients w.r.t its parameters or the density is hard. As the ELBO in VI decomposes to two terms, an expected likelihood term and a KL term, under this framing the KL term cannot be evaluated, and even may be ill-defined. To remedy that, the authors propose to use a Gaussian deep latent variable model (DLVM), i.e., the generator network in VAEs, as a replacement for the implicit density. And, to approximate the entropy term in the KL divergence the authors propose to linearize the output of the network. The authors also propose a lower-bound to the ELBO by approximating the log-determinant of the covariance using the minimal singular value, which can be calculated more efficiently compared to all of the values. The authors compare their method to several Bayesian methods on in-distribution and out-of-distribution tasks showing improved performance over baseline methods.\n\nSTRENGTHS:\n* A novel approach for using hyper-networks to learn a Bayesian model using VI.\n* Good results on OOD tasks compared to baseline methods.\n* The paper is written clearly and addresses relevant related studies.\n* The results seem to be reproducible - exact experiential details were given along with the code.\n\nWEAKNESSES:\n**Method**\n* Although I think the idea is nice a major shortcoming of this method is that it is challenging to apply it to large networks because of the use of Hyper-networks. Even in the experimental section, the largest network has 2.7 million parameters which is considered small these days. How do the authors propose to handle that issue and scale it to networks of 1-2 orders of magnitude larger?\n* To estimate the entropy term the std of the noise is taken to be zero on only one summand (the bilinear function), but not on the logdet of the covariance. How do the authors justify that?\n\n**Experiments**\n* The compared methods are somewhat outdated. Many Bayesian models were published in recent years, and all of them show that they beat deep ensembles in one way or another. I believe that more recent baselines should have been evaluated.\n* I find it a bit odd that the authors didn't compare LIVI to methods with similar pipelines, such as flow-based methods [1, 2].\n* The method was evaluated on UCI benchmarks, MNIST and CIFAR-10. In my opinion, it is not enough to showcase the advantage of the method and more challenging datasets should be considered.\n\n\n[1] Krueger, D., Huang, C. W., Islam, R., Turner, R., Lacoste, A., & Courville, A. (2017). Bayesian hypernetworks. arXiv preprint arXiv:1710.04759.\n[2] Louizos, C., & Welling, M. (2017, July). Multiplicative normalizing flows for variational bayesian neural networks. In International Conference on Machine Learning (pp. 2218-2227). PMLR.\n\nQUESTIONS:\n* How did your method of approximating the entropy is compared to standard MC sampling as suggested in the beginning of section 3.2?\n* How does your method perform compared to baseline methods in terms of memory and run-time?\n\nLIMITATIONS:\nThe authors did not address the limitations of their method.", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-03"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis work proposes one approach to implicit variational inference that avoids using adversarial training. This is achieved by first applying a small amount of Gaussian noise to the implicitly generated weights $\\theta$ to ensure that they are equipped with a valid distribution (enabling valid divergences), and then the now valid ELBO is approximated through linearizing the entropy regularization term. A further lower bound to this approximation is also proposed that allows for better scaling in high-dimensional settings, which is common for applying VI to neural models.\n\nSTRENGTHS:\nI felt that the approach presented was well justified, easy to follow in terms of motivation and development, and enables much more complex settings for variational inference to be applied to (in a stable manner) without having to suffer from the typical limiting mean-field assumptions.\n\nThe experimental results were impressive as well, seemingly achieving much better uncertainty quantification than the other competing methods while still retaining quality predictive performance.\n\nWEAKNESSES:\nThe paper states in the contributions (line 49) that it \"derive[s] a novel lower bound for variational inference\"; however, I believe this is not quite the case. It is my understanding that the \"novel lower bound\" being mentioned here refers to $\\mathcal{L}'$ and the further lower bound $\\mathcal{L}''$ used for better scaling. This statement is in direct contradiction to equation 18 that states:\n$\\log p(\\mathcal{D}) \\geq \\mathcal{L}(\\gamma) \\approx \\mathcal{L}'(\\gamma) \\geq \\mathcal{L}''(\\gamma)$. Strictly speaking, $\\mathcal{L}'$ is not a lower bound, but rather an approximation to an actual lower bound $\\mathcal{L}$. To be clear, I do not think this is bad by any means, it just needs to be communicated clearly. \n\nAside from this, I think the experiments can be bolstered with a few additional comparisons. Namely:\n- The impact of using $\\mathcal{L}''$ over $\\mathcal{L}'$ when the latter is still eligible (i.e., when using smaller models such as the UCI dataset tasks).\n- How much performance (both in and out of distribution) differs between your proposed method and HMC (or other MCMC methods). This again would need to be done in low-dimensional settings, but I believe it should be feasible for at least a smaller neural network or linear model on some of the UCI dataset tasks.\n\nLastly, one of the contributions listed cited a novel generator architecture (line 53); however, the details of this seem to be relegated to the appendix. In future revisions, I believe if you are going to cite this as one of the major contributions then the details should at least be partially included in the main paper. I understand this probably wasn't done due to space limitations, but it is worth considering in my opinion.\n\nQUESTIONS:\nI do not have any direct questions, see the weaknesses for my main comments to be addressed please.\n\nLIMITATIONS:\nThe authors did discuss the limitations adequately. Negative societal impact is not directly applicable here in my opinion.", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-06"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper studies the problem of approximating high-dimensional multi-modal posteriors through neural samplers specifying implicit distributions. While Bayesian methods promise a variety of benefits in terms of generalization and calibrated predictions, in practice they have seen limited success due to intractability of exact Bayesian approaches and the tradeoffs made in approximate Bayesian methods. Implicit Variational Inference provides an alternative to approximating exact Bayesian posteriors by maintaining distributions implicitly by transforming samples from simple distributions, allowing it to admit much richer distributions. Implicit Variational Inference typically requires some density ratio based adversarial objectives, which can fail on high-dimensional problems (e.g. parameters of neural networks). The authors note two major issues in existing approaches a) KL being ill-defined due to the implicit density lying on a low dimensional manifold b) intractability of the entropy of the implicit density and its gradients. To tackle these issues, the authors first introduce Gaussian noise to the output of the sampler making it a Gaussian DLVM resulting in a well-defined KL over the parameter space.  Next the authors approximate the generator with a local linearization resulting in a Gaussian approximation of the output density, and obtain easy to compute approximation of the differential entropy of the output density. This results in a novel approximation to the ELBO based on the entropy approximation, which is scalable to high dimensional parameters. The authors discuss two variants based on computing the whole Jacobian or using a differentiable lower bound on the the determinant, which trade-off compute and quality of the approximation. Finally, the authors evaluate the method on a variety of tasks including impressive results on fairly large BNNs (WideResNet).\n\nSTRENGTHS:\n* The paper studies the important problem of approximating expressive Bayesian posteriors on high-dimensional spaces. Due to the general applicability and promising results, the work is significant and relevant to the community. \n* To the best of my knowledge the main contributions of the paper namely addressing the ill-defined KL, local linearization for the entropy and the LIVI bound on the ELBO, are all novel.\n* Introducing Gaussian noise to the sampler to induce a Gaussian DLVM is a neat and simple way of fixing the KL with minimal additional restrictions to the model\n* Similarly, the local linearization of the neural sampler is a nice idea to obtain a cheaper estimator for the entropy. \n* The experimental results are quite impressive - in particular the results on the WideResNet. I also appreciate the authors including the code with their submission to aid reproducibility of the results. \n* Overall the paper is well-written with a clear exposition of ideas and most relevant details covered.\n\nWEAKNESSES:\n* The paper proposes a local linearization to make the entropy computation tractable. However, what is not clear to me is how the local-linearization affects the expressivity of the posterior and general performance. The experiments indicate that the effect is not large, but these are still “relatively” simple tasks so a thorough study of this would be useful \n* The empirical comparisons also do not consider alternative approximate Bayesian methods. \n* Some recent work [1] proposes a closely related approach which might be worth discussing in the paper\n\n[1] Posterior Refinement Improves Sample Efficiency in Bayesian Neural Networks. Kristiadi et al., NeurIPS 2022.\n\nQUESTIONS:\n* What do you think would be the critical challenges in applying the method to even larger modern networks, e.g. transformers? \n* What is the challenge in implementing the KIVI baseline? (since that is not included in all the experiments as the authors note)\n* The runtime of the method is not explicitly mentioned anywhere in the paper except for the remark relative to Deep Ensembles in the appendix. This is important information which should be included in the main paper. \n* Minor typos: L117 “in the following” -> “in this section” L123 “aGaussian” -> “a Gaussian”\n\nLIMITATIONS:\nDespite the impressive results in the paper, there still remains a gap between the models studied in the paper and the size of models considered in practice.", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-06"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\n## Post Rebuttal Update \n\nI have engaged with the authors for the rebuttal, and found their responses informative, prompting me to increase my score from a 7 to an 8.\n\n## Original Review\n\nThe paper addresses two issues that are common in implicit variational inference methods such as amortised neural samplers, namely - \n\n1. The implicit density often lies on low dimensional manifolds making the KL infinite/ill-defined\n2. The gradients and entropy of the implicit density are intractable\n\nThe paper addresses these issues by (i) adding Gaussian noise to the output of the neural sampler, making it continuous w.r.t $\\theta$, and (ii) linearising the neural sampler, resulting in a Bayesian linear model approximation to the non-linear model, giving closed-form solutions for the distributions. On different benchmarks the authors show that these methods work well on a range of small scale experiments compared to other state-of-the-art, such as last-layer Laplace and deep ensembles.\n\nSTRENGTHS:\nThe paper is well motivated, has clear mathematical development, and solves common issues in implicit variational inference models. I like the use of linearisation to make the entropy and gradients tractable by getting closed-form solutions. The experiments are clear, and the baselines are well-considered. The results are also quite impressive in this domain, as it is often really difficult to beat deep ensembles, and the method seems to consistently perform really well.\n\nWEAKNESSES:\nIn general I think the paper is well-written, however I have one major criticism - \n\n1. I'm not convinced that the current approximation to $\\log(J J^T)$ has been well-motivated or properly ablated. It would be nice to see some ablations on smaller-scale problems where calculating the full log determinant is tractable, and comparing it to the approximation made using just the highest singular value. Or doing a sweep over adding subsets of singular values vs the highest. Or even, plotting the eigenspectrum of $J J^T$ to show that it is true that the highest singular value is often much more dominant than the others.\n2. If the paper is using the full-rank Jacobian of the neural sampler in order to estimate the entropy, I think a fairer comparison to make would be against full Laplace, not last-layer Laplace, which should be possible for UCI datasets and MNIST at least, using the Laplace library the authors cite.\n\nQUESTIONS:\nI think there are some really interesting connections between the obtained linearised implicit variational model, and existing methods such as linearised Laplace and regular variational inference, and I would love for there to be a small discussion about these things potentially. For example, in linearised Laplace, you assume a fully Bayesian posterior over a NN parameterised by $\\theta$, then linearise the model around the MAP estimate, resulting in a tractable Gaussian approximation to the posterior. However, this posterior is more rich compared to a mean-field variational approximation, because the covariance of the posterior is given by $J_{\\theta}^T \\Lambda J_{\\theta} + \\sigma^2 I$, where $\\Lambda$ is the prior over weights, and $\\sigma^2$ is the noise variance. This form of the posterior looks very close to what is obtained by implicit variational inference, where the neural sampler can be considered similar to the NN model in linearised Laplace. I would be really interested in seeing discussions about these potential connections if possible. In fact, optimising the marginal likelihood for a linearised Laplace model is akin to doing ELBO with a Gaussian approximation. I would be really interested in seeing these parallels.\n2. Given that the authors are using the entirety of the Jacobian of their neural sampler, and comparing to only last-layer Laplace, where only the last layer is modelled probabilistically, I would be really interested in seeing if they can run experiments on full linearised Laplace, especially on the small UCI and MNIST datasets, where this should be tractable. In fact, there are methods that perform full probabilistic inference for linearised Laplace using samples from the posterior, such as in [1].\n3. I am also really interested in seeing what approximations to the Jacobian are best for estimating log det (J J^T), such as last-layer only, or through samples using Hutchinson's estimate, or by using more than one singular value and ablating through what the optimal number of singular values to consider is.\n\n[1] Antorán, Javier, et al. \"Sampling-based inference for large linear models, with application to linearised Laplace.\" arXiv preprint arXiv:2210.04994 (2022).\n\nLIMITATIONS:\nN/A.", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-09"}