                                      Do BNNs Actually Behave Like Bayesian Models?



The size of the Hessian is quadratically large in the number of model parameters, which is prohibitive for real-world BNNs

of thousands or millions of parameters. This necessitates further approximations. The simplest is a diagonal approximation

to the Hessian or the Fisher information matrix (MacKay, 1992b). Even though it is a restrictive approximation enforcing

independence in the posterior, recent work by Farquhar et al. (2020b) found it to remain expressive for deep networks.

Other approximations produce low-rank or block-diagonal Hessian or Fisher matrices. In particular, the popular Kronecker-

factored approximate curvature (K-FAC) (Martens & Grosse, 2015; Daxberger et al., 2021; Schnaus et al., 2023) block-

diagonal approach further factorizes the per-layer Fishers, which are themselves infeasible to store for large networks.

We note that the diagonal Laplace approximation we evaluate is not the most expressive. However, having run full-rank

Laplace experiments on smaller networks where it is feasible, we have seen no reason to assume these qualitative behaviors

change for more expressive Laplace approximations, including K-FAC.



B.4. SWAG

Stochastic weight averaging (SWA)-Gaussian (SWAG) (Maddox et al., 2019; Wilson & Izmailov, 2020) is a heuristic

post-hoc method of obtaining approximate posteriors of trained deep learning models. Interpreting the loss as the negative

log-likelihood, the trained solution is θMAP . SWAG performs further gradient descent updates on θ with a high learning

rate η, exploring the region of the weight space near θMAP . We record the trajectory of θ and fit a low-rank Gaussian to

these samples to get the approximate posterior.

Its motivations are arguably Bayesian. These include the local quadratic nature of the loss function around θMAP , the same

fact that is exploited by Laplace. The η hyperparameter controls the posterior variance: the larger the learning rate is, the

higher-variance the samples from the trajectory. It has been used by Shwartz-Ziv et al. (2022) in the context of Bayesian

deep learning to pretrain a prior for a transfer learning task.



B.5. SGLD

Stochastic Gradient Langevin Dynamics (Welling & Teh, 2011) is a popular practical Markov Chain-based sampling scheme

for BNNs. The continuous-time Langevin diffusion with stationary measure π(θ | D) is

                                                                      √

                                         dθt = −∇ log π(θ | D)dt + 2Bt



where Bt is a Brownian motion. The score log π(θ | D) makes it tractable to deal with the posterior because the normalizing

constant cancels out. To simulate this continuous-time dynamics, one traditionally uses Euler discretization schemes

                                                                          √

                                         θt+1 = θt − ϵt ∇ log π(θt | D) + 2ϵt ξt ,

                                        i.i.d.

where ϵt is the learning schedule and ξt ∼ N (0, 1). For further computational efficiency, one would take stochastic estimates

of the gradient by estimating it in batches of size b:

                                                                                       

                                                           |D|    X                           √

                          θt+1 = θt − ϵt ∇ log π(θt ) +               ∇ log p(y | θ; x) + 2ϵt ξt .

                                                          |Bt |

                                                               (x,y)∈Bt



For large batch sizes and small ϵ, we expect the chain to be close to the stationary distribution; however, the discretization

and the stochastic gradient estimate both introduce some bias. It is possible to add a Metropolis-Hastings-style accept-reject

step to the algorithm to unbias it, but most practical algorithms choose to skip this step for computational efficiency, arguing

that the bias is compensated for by decreased variance.



B.6. Further Bayesian and Non-Bayesian Alternatives

Other Bayesian approximate inference algorithms include Monte Carlo dropout (Gal & Ghahramani, 2016), and further

variants of stochastic-gradient Monte Carlo (Chen et al., 2014; Zhang et al., 2020; Wenzel et al., 2020).

There are various further methods for averaging over different models or producing uncertainty estimates that are not

traditionally considered Bayesian in their motivation. Deep ensembles (Lakshminarayanan et al., 2017) are state of the art

                                                                                                              (k)

for accuracy and out-of-sample detection on many tasks. They are an ensemble of K different MAP solutions θMAP , often



                                                              17

