# Reliable uncertainty estimates in deep learning with efficient Metropolis-Hastings algorithms

**Authors:** Matthias Schmal, Patrick Mäder

PMC · DOI: 10.1038/s41467-026-70015-z · Nature Communications · 2026-03-17

## TL;DR

This paper introduces efficient Metropolis-Hastings methods to improve uncertainty estimates and prediction accuracy in deep learning models.

## Contribution

The authors propose two lightweight Metropolis-Hastings acceptance steps for Bayesian neural networks to reduce computational costs.

## Key findings

- Prediction accuracy improved by up to 5.8% over deterministic models and 4.3% over Bayesian approaches.
- Sampling methods achieved strong performance with only a third of the ensemble size.
- The methods maintain prediction calibration despite sampling bias.

## Abstract

Approaching problems with data-driven models often requires reliable uncertainty estimates. Bayesian neural networks can offer these for deep learning models. Without the knowledge to set informative prior distributions, sampling methods such as Hamiltonian Monte Carlo are a robust choice. However, these come with prohibitive computational costs. We study two ways to incorporate computationally light-weight Metropolis-Hastings acceptance steps into deep neural networks and stochastic gradient Hamiltonian Monte Carlo. The first method proposes noisy acceptance steps computed on batched training samples rather than the entire set during the simulation of the stochastic dynamics accepting a small minima preserving bias. The second method sacrifices bias-free sampling of Hamiltonian Monte Carlo in favor of stochastic gradient driven trajectories. While the first is analytically plausible, the second is inspired by the Hamiltonian ensemble concept. Prediction accuracy is improved by up to 5.8% over deterministic and by up to 4.3% over Bayesian approaches while still guaranteeing calibration of the predictions. We observe that sampling methods facilitate model predictions with merely a third of the ensemble while maintaining prediction accuracy. In conclusion, the methods combine efficiency and regularization of stochastic gradients, showing strong performance despite the sampling bias.

Here, the authors integrate Metropolis-Hastings acceptance steps into stochastic gradient Hamiltonian Monte Carlo for deep learning models, enhancing accuracy and uncertainty estimation.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12996495/full.md

## Figures

5 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12996495/full.md

## References

47 references — full list in the complete paper: https://tomesphere.com/paper/PMC12996495/full.md

---
Source: https://tomesphere.com/paper/PMC12996495