Exact priors of finite neural networks

Jacob A. Zavatone-Veth, Cengiz PehlevanarXiv 2021

Abstract

In Bayesian deep learning, the choice of prior distribution over network weights significantly influences the resulting function-space prior. While the infinite-width limit of Bayesian neural networks (BNNs) is well-characterized by Gaussian processes, real-world finite-width networks exhibit complex, non-Gaussian behaviors that are empirically superior but theoretically poorly understood. This paper derives the first exact analytical formulas for the marginal prior distributions of finite-width deep linear and ReLU BNNs. By leveraging rotational symmetry and special functions, the authors reveal that finite-width priors are fundamentally heavy-tailed, providing a rigorous foundation that unifies previous approximations and explains the distinct functional properties of finite architectures.

Introduction: The Gap Between Infinite and Finite BNNs

Bayesian neural networks typically employ simple isotropic Gaussian priors over their weights. However, the primary interest lies in the induced prior over the functions the network can represent—the distribution of the network's outputs. Historically, researchers have relied on the infinite-width limit, where the Central Limit Theorem ensures that the function-space prior converges to a Gaussian process.

While mathematically convenient, this limit fails to capture the nuances of finite-width networks used in practice. Finite networks are more flexible and often perform better empirically, yet their priors are highly non-Gaussian. Previous attempts to model these finite priors relied on perturbative approximations, such as Taylor series or Edgeworth expansions around the infinite-width limit. These methods often break down for narrow networks or architectures containing bottlenecks. This research bridges the gap by providing exact, non-approximate mathematical solutions for the function-space priors of finite-width networks.

Methodology: From Fourier Transforms to Meijer G-functions

The authors treat the neural network as an exactly solvable model in statistical physics. Given that the weight priors are isotropic Gaussians, the preactivations at any layer are rotationally symmetric (radial). This symmetry allows for significant mathematical simplification:

  1. Characteristic Functions: The problem is moved to the Fourier domain to analyze the characteristic function of the probability density.
  2. Hankel Transforms: Due to the radial nature of the distributions, multi-dimensional Fourier transforms are reduced to one-dimensional Hankel transforms.
  3. Special Functions: For deep linear networks, the recursive application of these transforms leads to a closed-form solution expressed via the Meijer G-function. This general special function allows for the direct derivation of mathematical properties like moments and tail behavior.
  4. Inductive Proof for ReLU: For networks with ReLU activations, the authors use mathematical induction to prove that the prior is a combinatorial mixture of the priors of narrower linear networks, where weights represent the probability of specific units being active.

Theoretical Insights: Heavy Tails and Special Functions

A central finding of the paper is that finite-width networks possess heavy-tailed priors. Specifically, the authors prove these distributions are sub-Weibull with a tail parameter of $d/2$, where $d$ is the network depth. This is a critical departure from the sub-Gaussian (thin-tailed) behavior assumed in infinite-width limits.

Exact marginal prior distributions for deep linear networks across various depths and widths.

As shown in the figure above, as the width $n$ increases, the distribution slowly converges toward the Gaussian limit ($n=\infty$). Crucially, standard large-width approximations like Edgeworth expansions fail to capture these heavy tails because they mathematically force the distribution to remain thin-tailed. The exact formulas also reveal a "bottleneck effect": a wide network containing a narrow hidden layer behaves more like a uniformly narrow network than a wide one, as the narrowest layer dominates the functional form of the prior.

ReLU Networks: A Combinatorial Mixture

The extension to ReLU networks reveals an elegant relationship: a finite ReLU network's prior is exactly equivalent to a mixture of linear network priors. The mixture weights correspond to the probability of different numbers of ReLU units being "active" (outputting a value greater than zero) in each hidden layer.

Exact marginal prior distributions for deep ReLU networks.

This relationship allows for the derivation of exact moments for ReLU architectures. For instance, the variance of a ReLU network's output is shown to be exactly $2^{1-d}$ times that of a linear network of the same width and depth. The empirical validation using Monte Carlo sampling (up to $10^8$ samples) shows perfect agreement with these analytical formulas across various depths.

Key Results and Empirical Validation

  • Analytical PDFs: The paper provides the first exact probability density functions (PDFs) for output preactivations in both deep linear and ReLU networks.
  • Exact Moments: Analytical formulas for absolute moments were derived, allowing for precise calculation of variance and higher-order statistics without numerical integration.
  • Non-Perturbative Foundation: By providing exact solutions, the work demonstrates why previous perturbative methods failed to capture the heavy-tailed nature of finite BNNs.

Discussion and Future Directions

While this work provides a major theoretical breakthrough, it is currently limited to the marginal prior of a single input example in fully-connected feedforward networks without bias terms. The reliance on rotational invariance makes the inclusion of biases mathematically challenging.

Future research will focus on extending these methods to calculate joint priors over multiple inputs, which is essential for full Bayesian inference. Additionally, these exact solutions provide a new lens through which to investigate phenomena like the "cold posterior" effect, potentially revealing how specific architectural choices and hyperparameters shape the prior in ways that asymptotic bounds cannot capture.

Summary updated

BibTeX
@misc{zavatoneveth2021exact,
  author = {Jacob A. Zavatone-Veth and Cengiz Pehlevan},
  title = {{Exact priors of finite neural networks}},
  year = {2021},
  eprint = {2104.11734},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.11734},
}
Figure