arXiv:2610.12212cs.AIOct 2026

Manuscript Offprint

arXiv:2610.12212

When Has a Bayesian Neural Network Sampled Enough? Adaptive Inference Time with Statistical Guarantees

Fabian Denoodt, Sibylle Hess

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Bayesian neural network predictions are commonly approximated using a fixed number of Monte Carlo samples per input, without controlling the resulting error that comes from this finite sample. We propose the use of confidence sequences to dynamically determine how many samples are needed while maintaining statistical guarantees. We consider several ways in which predictive probabilities are used, including identifying the most likely class, approximating the full predictive distribution, and resolving probability-threshold decisions. Sampling stops once the corresponding decision can be made with the desired guarantee. Experiments show that the method allocates the computational budget efficiently, assigning more samples to ambiguous inputs than to easy inputs while preserving reliable decisions and reducing overall latency relative to a fixed Monte Carlo budget.

1 Introduction

Bayesian neural networks (BNNs) provide a principled framework for representing predictive uncertainty, which is particularly valuable in high-stakes applications. They typically approximate the posterior predictive distribution p(y⋆∣x⋆,x1:n,y1:n)p(\mathbf{y}^\star \mid \mathbf{x}^\star, \mathbf{x}_{1:n}, \mathbf{y}_{1:n}) by averaging predictions over posterior parameter samples Eθ∼qλ[p(y⋆∣x⋆,θ)]\mathbb{E}_{\boldsymbol{\theta} \sim q_\lambda} [p(\mathbf{y}^\star \mid \mathbf{x}^\star, \boldsymbol{\theta})] [3, 11, 6, 4, 9]. In practice, this average is usually estimated using the same fixed number of stochastic forward passes for every input. Although simple, this ad hoc choice provides no guarantee that the Monte Carlo estimate is sufficiently accurate for the prediction. It may also waste computation on easy inputs while using too few samples for difficult ones.

We instead ask an input- and task-specific question:

When have enough posterior samples been drawn to make the required decision?

The answer depends on how the prediction will be used. If only the most likely label is needed, it suffices to separate the leading class from its competitors. If the full probability vector is required, every coordinate must be estimated accurately enough. Meanwhile, for threshold-based decisions, it is enough to determine whether any class probability exceeds a specified level q. Adapting the number of samples to these objectives would allow the method to concentrate computation on the inputs that need it most.

To make these adaptive decisions in a principled manner, we need uncertainty bounds that remain statistically valid as posterior samples accumulate. We therefore use the multivariate confidence sequence (CS) of Denoodt et al. [5] to track the predicted probability vector and stop once the required decision is certified. Unlike repeatedly checking an ordinary confidence interval, CSs remain valid under repeated inspection and data-dependent stopping [8]. This also distinguishes our approach from the approach of Bethell et al. [1], which stops when changes in the estimated variance remain

40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: E-Values: From Statistics to ML.

below a preset threshold and provides neither statistical guarantees nor an indication of how accurate the final prediction is.

Overall, we (i) formulate anytime-valid stopping rules for various prediction use cases that control the Monte Carlo estimation error under repeated inspection and adaptive stopping, and (ii) show empirically that adaptive sampling uses fewer posterior draws for easy inputs while preserving reliable decisions, reducing overall inference time.