arXiv:2610.32753stat.MLOct 2026

Manuscript Offprint

arXiv:2610.32753

Sparse Bayesian Neural Networks via Sticky Piecewise Deterministic Markov Processes

August Arnstad, Geir Olve Storvik, Filippo Pagani, Leiv Rønneberg

Abstract

There is growing evidence that the performance of a neural network depends largely on a small subset of its weights, which are typically identified by training a dense network and pruning it afterwards. Within a Bayesian framework, pruning can be directly incorporated through a spike-and-slab prior, providing a proper treatment of the uncertainties involved, both with respect to pruning and to parameter uncertainty. In Bayesian neural networks (BNNs), sampling by MCMC is notoriously hard. We demonstrate that modern Monte Carlo methods based on piecewise deterministic Markov processes (PDMPs) can be used to sample posteriors of BNNs asymptotically exact whenever numerically constructed rate bounds hold. Spike-and-slab priors can be incorporated through sticky versions of the PDMPs, setting weights exactly to zero during sampling. We examine the predictive performance and convergence of the samplers, and show that sparse BNNs sampled this way can be more robust to input noise than dense ones.

1 Introduction

Bayesian neural networks (BNNs) quantify uncertainty for models that are otherwise prone to overconfidence, but characterizing their posterior over the network weights is difficult. Variational inference (Graves, 2011) replaces the posterior with a tractable distribution, whereas stochastic gradient samplers (Welling and Teh, 2011; Chen et al., 2014) use minibatches, which scales well but introduces bias. Asymptotically exact samplers target the posterior without bias and have been shown feasible for larger networks (Izmailov et al., 2021b; Sommer et al., 2024), but remain too costly to be practical.

Computational cost is not the only problem in BNNs. The networks are highly over-parametrized, which makes Bayesian inference difficult as the parameters are not identifiable due to symmetries (Papamarkou et al., 2022). Furthermore, weights that do not affect the data fit, such as those connected to inputs that are zero across the training set, retain their prior variance in the posterior, which can make BNNs less robust to covariate shift than networks trained by SGD (Izmailov et al., 2021b,a). Setting such weights to zero removes this source of variance, and BNNs can indeed be pruned substantially with little loss of predictive performance (Molchanov et al., 2017; Hubin and Storvik, 2024), suggesting that a subset of the parameters suffices to characterize the posterior predictive. The canonical method for sparsifying a Bayesian model is the spike-and-slab prior (Mitchell and Beauchamp, 1988), which places positive prior probability on parameters being exactly zero, so that parameters the data do not inform are exactly zero in most draws. Traditionally, it has been hard to make use of spike-and-slab priors in Bayesian deep learning, as the efficient gradient-based samplers require a differentiable density, which a prior with point masses at zero does not have. Thus, such priors have been applied only approximately (Hubin and Storvik, 2024).

Piecewise deterministic Markov process samplers (PDMPs, Fearnhead et al., 2018) are a class of non-reversible, continuous-time Markov chain Monte Carlo (MCMC) samplers. A trajectory is simulated over a time horizon T from a process that evolves deterministically between random event times, constructed so that the target distribution is the position marginal of its stationary distribution. Once the trajectory is long enough, samples are obtained by evaluating the position at time points along the path. Such methods have received great interest recently (Bierkens et al., 2019; Corbella et al., 2022; Fearnhead et al.,

*Corresponding authors: augusa@math.uio.no, filippo.pagani@warwick.ac.uk, ltronneb@math.uio.no

Figure

φ(βx+b)\varphi(\beta x + b)

f(x)

Figure 1: Sticky PDMPs sample exact zeros. (a) Example of a sticky ZigZag parameter path. (b) Posterior inclusion probabilities of weights in a BNN sampled with sticky PDMPs. (c) Inclusion probabilities of the MNIST input pixel weights, low where pixels carry no information.

2024; Chevallier et al., 2025), as exact subsampling can keep their cost per effective sample constant in the dataset size (super-efficiency). Furthermore, the PDMP samplers can be made sticky (Bierkens et al., 2023b), so that they target the posterior under a spike-and-slab prior directly, and sparsity arises during sampling without any post-processing or thresholding.

Contributions In this paper, we show that PDMPs can sample the posterior of a BNN under a spike-and-slab prior, which mixes a continuous density with a point mass at zero. With full-batch gradients, the sampling is asymptotically exact, provided the numerical bounds used to simulate the event times hold. This brings PDMPs closer to practical use in Bayesian deep learning. In particular, we

• adapt sticky and non-sticky PDMPs to BNNs with cheap numerical bounds;

• provide a PyTorch implementation for any network module with GPU acceleration;

• evaluate the samplers against NUTS and a sparse variational method;

• show that exact zeros give high sparsity and can improve robustness to input noise.

References (100)

Couldn't load all references. Reload the page to try again.