Exact posterior distributions of wide Bayesian neural networks

Jiri Hron, Yasaman Bahri, Roman Novak, Jeffrey Pennington, Jascha Sohl-DicksteinarXiv 2020

Abstract

Recent work has shown that the prior over functions induced by a deep Bayesian neural network (BNN) behaves as a Gaussian process (GP) as the width of all layers becomes large. However, many BNN applications are concerned with the BNN function space posterior. While some empirical evidence of the posterior convergence was provided in the original works of Neal (1996) and Matthews et al. (2018), it is limited to small datasets or architectures due to the notorious difficulty of obtaining and verifying exactness of BNN posterior approximations. We provide the missing theoretical proof that the exact BNN posterior converges (weakly) to the one induced by the GP limit of the prior. For empirical validation, we show how to generate exact samples from a finite BNN on a small dataset via rejection sampling.

Introduction

In the field of Bayesian Deep Learning, the "infinite width limit" is a foundational concept. Research dating back to Radford Neal in the 1990s established that a neural network initialized with random weights—its prior—converges to a Gaussian Process (GP) as its layers become infinitely wide. This convergence allows researchers to study complex neural networks through the lens of well-understood kernel methods. However, a critical gap remained: while the prior convergence was mathematically established, a rigorous proof for the posterior convergence—the distribution after observing data—was missing.

The Challenge of Posterior Convergence

Practitioners are primarily interested in the posterior distribution of functions. Proving that wide BNN posteriors behave like GP posteriors is technically challenging. As the width of a network increases, the number of parameters grows, making it difficult to define convergence within the parameter space. In fact, under standard scaling, individual weights converge to a point mass at zero, rendering parameter-space analysis a "dead end." The meaningful convergence occurs in the function space—the mapping from inputs to outputs.

Methodology

The authors address this problem using a two-pronged approach:

  1. Function Space Theory: They demonstrate that if a sequence of prior distributions converges weakly to a GP prior, the corresponding sequence of posterior distributions will also converge to the GP posterior, provided the likelihood function is continuous and bounded.
  2. Infinite-Width, Finite Fan-Out Construction: To compare networks of varying widths, they employ a mathematical construction that embeds them into a single space, bypassing the issues of a changing parameter count.
  3. Exact Validation via Rejection Sampling: To empirically verify their findings without the bias of approximate samplers (like MCMC), the authors used rejection sampling. Although computationally expensive and limited to small datasets, this method provides a "gold standard" for verifying the exact distribution on small-scale problems.

Key Results

The core theoretical contribution is Proposition 1, which proves the weak convergence of exact BNN function space posteriors to the GP posterior.

Empirical results on a synthetic 1D regression task confirm this theory. As the width $d$ of a 3-layer fully connected network increases from 1 to 1000, the posterior mean and variance of the finite BNN become visually and numerically indistinguishable from the Neural Network Gaussian Process (NNGP) limit.

Empirical convergence of finite BNN posteriors to the NNGP limit as width $d$ increases.

Notably, the experiments highlight a distinction between Bayesian inference and gradient-based training. While the BNN posterior converges to the NNGP, it remains distinct from the Neural Tangent Kernel (NTK) predictions, which describe the behavior of networks trained with gradient descent rather than Bayesian inference.

Limitations and Future Work

While this work bridges a significant theoretical gap, some limitations remain. The rejection sampling used for validation is not scalable to large datasets. Furthermore, while the paper proves distributional convergence, ensuring the convergence of specific moments (like the mean or variance) requires additional technical conditions such as uniform integrability. Future research may further explore the ill-defined mapping from infinite-dimensional parameter vectors to function space.

Summary updated

BibTeX
@misc{hron2020exact,
  author = {Jiri Hron and Yasaman Bahri and Roman Novak and Jeffrey Pennington and Jascha Sohl-Dickstein},
  title = {{Exact posterior distributions of wide Bayesian neural networks}},
  year = {2020},
  eprint = {2006.10541},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.10541},
}
Figure