Exploring the Uncertainty Properties of Neural Networks' Implicit Priors in the Infinite-Width Limit

Ben Adlam, Jaehoon Lee, Lechao Xiao, Jeffrey Pennington, Jasper Snoek

Introduction

Modern deep learning models achieve incredible accuracy, but they are notoriously "brittle." When faced with out-of-distribution (OOD) data or gradual dataset shifts—such as a self-driving car encountering heavy fog—they tend to provide high-confidence predictions even when they are entirely wrong.

While the community has found that ensembles of neural networks help mitigate this, a fundamental question remains: does this overconfidence stem from the network's architecture (its implicit prior) or the way we train it (the optimization process)? This paper investigates this by leveraging the theoretical framework of the Neural Network Gaussian Process (NNGP). By evaluating networks in the "infinite-width limit"—where they behave mathematically like Gaussian Processes—the authors isolate the effects of the architecture's prior on uncertainty, revealing that these models become significantly better calibrated and more robust to distributional shifts.

Methodology

To understand the pure prior of neural architectures, the authors explore three primary ways to implement infinite-width Bayesian inference:

  1. NNGP Classification (NNGP-C): Uses a softmax link function to build a true probabilistic classifier. Because the Bayesian posterior is mathematically intractable, Elliptical Slice Sampling (ESS)—a sophisticated Markov Chain Monte Carlo method—is used to sample from the posterior.
  2. NNGP Regression (NNGP-R): Treats classification as a regression problem (predicting one-hot labels). This allows for an exact, closed-form solution for the posterior, requiring only a heuristic to convert continuous values back into class probabilities.
  3. NNGP Last-Layer (NNGP-LL): A practical approach for large-scale tasks. A pre-trained feature extractor (like EfficientNet) is used, and only the final layer is replaced with an infinite-width NNGP, mimicking a standard transfer learning workflow.

The models were rigorously evaluated on benchmarks designed to test robustness, including standard in-distribution datasets (CIFAR-10), distributional shift benchmarks (CIFAR-10-C, which applies 15 types of corruptions at five intensity levels), and strict OOD datasets (SVHN).

Key Findings

The Prior is Not the Problem

Standard finite-width neural networks are consistently overconfident. However, the NNGP—which represents the "pure" prior of the architecture without the influence of standard training dynamics—is not. This suggests that the poor calibration of standard networks is likely a byproduct of optimization processes (like SGD or Adam) rather than an inherent flaw in the architecture itself. Across almost every metric, including Expected Calibration Error (ECE) and Brier Score, infinite-width models outperformed their finite-width counterparts.

Robustness to Corruption

As the intensity of data corruption increases, standard models typically become increasingly overconfident as their accuracy drops. In contrast, the NNGP approaches maintain much more reliable confidence estimates.

Expected Calibration Error (ECE) across varying corruption intensities. NNGP methods maintain significantly lower and more stable ECE compared to baselines as corruption increases.

On CIFAR-10, a CNN-based NNGP achieved an impressive ECE of 0.031, compared to 0.283 for a standard finite CNN of the exact same architecture.

Out-of-Distribution (OOD) Detection

When presented with entirely unfamiliar data, a reliable model should express uncertainty. On the SVHN dataset (which is completely out-of-distribution for a model trained on CIFAR-10), the NNGP correctly signaled its own uncertainty by outputting significantly lower confidence scores and higher entropy than standard neural networks.

Density plot of confidence scores for C-NNGP-C and a standard CNN on CIFAR-10 (in-distribution) and SVHN (out-of-distribution). The standard CNN remains highly confident (spike at 1.0) on OOD data, while the NNGP appropriately lowers its confidence.

The "Last-Layer" Sweet Spot

The authors also found that a fully Bayesian infinite-width network isn't strictly necessary to reap these benefits. Combining a powerful pre-trained embedding with an infinite-width final layer (NNGP-LL) provides state-of-the-art calibration while remaining computationally efficient. This approach even outperformed "gold standard" methods like Deep Ensembles and MC-Dropout in terms of calibration under distributional shift, and proved remarkably data-efficient, achieving better calibration with just 1,000 training points than standard methods did with full datasets.

Limitations and Future Work

While infinite-width models offer superior calibration, they come with trade-offs:

  • Computational Cost: Calculating NNGP kernels involves inverting large matrices, scaling cubically ($O(N^3)$) with the number of data points. This makes pure NNGPs difficult to scale to millions of images without approximations.
  • The Accuracy Gap: NNGPs often lag slightly behind the absolute predictive accuracy of the best-tuned finite-width models, which utilize techniques like Batch Normalization and heavy data augmentation that are difficult to mirror exactly in the infinite-width limit.
  • Kernel Complexity: Performance is highly dependent on the choice of kernel. Finding the optimal kernel for complex image tasks remains an open area of research.

Ultimately, this work provides compelling evidence that rethinking how we optimize neural networks—rather than just changing their architectures—may be the key to solving the deep learning overconfidence problem.

Summary updated

Abstract

Modern deep learning models have achieved great success in predictive accuracy for many data modalities. However, their application to many real-world tasks is restricted by poor uncertainty estimates, such as overconfidence on out-of-distribution (OOD) data and ungraceful failing under distributional shift. Previous benchmarks have found that ensembles of neural networks (NNs) are typically the best calibrated models on OOD data. Inspired by this, we leverage recent theoretical advances that characterize the function-space prior of an infinitely-wide NN as a Gaussian process, termed the neural network Gaussian process (NNGP). We use the NNGP with a softmax link function to build a probabilistic model for multi-class classification and marginalize over the latent Gaussian outputs to sample from the posterior. This gives us a better understanding of the implicit prior NNs place on function space and allows a direct comparison of the calibration of the NNGP and its finite-width analogue. We also examine the calibration of previous approaches to classification with the NNGP, which treat classification problems as regression to the one-hot labels. In this case the Bayesian posterior is exact, and we compare several heuristics to generate a categorical distribution over classes. We find these methods are well calibrated under distributional shift. Finally, we consider an infinite-width final layer in conjunction with a pre-trained embedding. This replicates the important practical use case of transfer learning and allows scaling to significantly larger datasets. As well as achieving competitive predictive accuracy, this approach is better calibrated than its finite width analogue.
BibTeX
@inproceedings{adlam2021exploring,
  author = {Ben Adlam and Jaehoon Lee and Lechao Xiao and Jeffrey Pennington and Jasper Snoek},
  title = {{Exploring the Uncertainty Properties of Neural Networks' Implicit Priors in the Infinite-Width Limit}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=HMVcC0JE-9},
}
Figure