Learnable uncertainty under Laplace approximations

Agustinus Kristiadi, Matthias Hein, Philipp Hennig

Abstract

Laplace approximations (LA) are classic, computationally lightweight means for constructing Bayesian neural networks (BNNs). As in other approximate BNNs, one cannot necessarily expect the induced predictive uncertainty to be well-calibrated. This paper introduces LULA (Learnable Uncertainty under Laplace Approximations), a method that adds "uncertainty units" to pre-trained networks. These units are designed to leave the network's predictions unchanged while allowing the model to explicitly learn and calibrate its uncertainty landscape, significantly improving out-of-distribution detection with negligible computational cost.

Introduction

Standard neural networks are notoriously overconfident, often assigning high probabilities to incorrect or out-of-distribution (OOD) inputs. Bayesian Neural Networks (BNNs) offer a principled solution by treating weights as distributions, but they are typically expensive to train from scratch. The Laplace Approximation (LA) is a popular post-hoc alternative that fits a Gaussian distribution around the weights of a pre-trained model. However, standard LA is inflexible, often requiring the tuning of a single global prior precision parameter, which is insufficient for complex uncertainty calibration.

The LULA Method

The authors propose a "non-destructive" architectural augmentation to increase the flexibility of LA. By adding "uncertainty units" to each layer of a pre-trained network, they decouple the task of prediction from the task of uncertainty estimation.

Architectural Augmentation

LULA adds extra hidden units with a specific weight structure—partially zeroed out—so that they do not affect the final output of the network. This ensures the point estimate (the prediction) remains identical to the original high-performing model.

Tuning the Uncertainty Landscape

While these units are "silent" during prediction, they change the geometry of the loss landscape by adding new dimensions to the Hessian matrix. The weights of these units are trained using a dedicated uncertainty objective, such as encouraging high entropy on outlier data. This process is highly efficient; using a diagonal Fisher Information Matrix as a proxy for the Hessian allows the tuning phase to complete in seconds.

Conceptual transition from point estimates to LULA: The method expands the parameter space to tune local curvature (uncertainty) without shifting the predictive mean.

Key Results and Discussion

LULA was evaluated across toy datasets and large-scale image classification benchmarks, including MNIST and CIFAR-10/100.

Improved Calibration and OOD Detection

On CIFAR-100, LULA improved the Expected Calibration Error (ECE) from 7.0% to 5.3%. More importantly, LULA-augmented models frequently outperformed Deep Ensembles—the current industry standard—at detecting OOD data, despite the significantly lower computational overhead. Augmenting a WideResNet-16-4 with 512 LULA units took only 20 seconds to train for 10 epochs on a single V100 GPU.

Qualitative Impact

The benefit of LULA is most visible in the uncertainty landscapes it produces. As shown in the "Two Moons" classification task, standard LA often produces broad, uncalibrated uncertainty regions. LULA, by contrast, learns a much more precise and localized confidence region that better reflects the underlying data distribution.

Qualitative comparison on the Two Moons dataset: (a) MAP point estimate is overconfident, (b) standard LA is poorly calibrated, and (c) LULA provides well-localized uncertainty.

Conclusion

LULA provides a powerful, post-hoc method for improving the reliability of neural networks. By exploiting weight-space symmetries, it allows for the fine-tuning of uncertainty without risking the degradation of predictive performance. Its minimal computational requirements make it an attractive choice for deploying robust BNNs in practice.

Summary updated

BibTeX
@inproceedings{kristiadi2021learnable,
  author = {Agustinus Kristiadi and Matthias Hein and Philipp Hennig},
  title = {{Learnable uncertainty under Laplace approximations}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2021},
  url = {https://openreview.net/forum?id=HRGbMmgXHx5},
}
Figure