Combining Model and Parameter Uncertainty in Bayesian Neural Networks

Aliaksandr Hubin, Geir StorvikarXiv 2019

Abstract

Bayesian neural networks (BNNs) have recently regained a significant amount of attention in the deep learning community due to the development of scalable approximate Bayesian inference techniques. There are several advantages of using Bayesian approach: Parameter and prediction uncertainty become easily available, facilitating rigid statistical analysis. Furthermore, prior knowledge can be incorporated. However so far there have been no scalable techniques capable of combining both model (structural) and parameter uncertainty. In this paper we introduce the concept of model uncertainty in BNNs and hence make inference in the joint space of models and parameters. Moreover, we suggest an adaptation of a scalable variational inference approach with reparametrization of marginal inclusion probabilities to incorporate the model space constraints. Finally, we show that incorporating model uncertainty via Bayesian model averaging and Bayesian model selection allows to drastically sparsify the structure of BNNs.

1. Introduction

Deep learning models are notoriously over-parametrized, leading to high computational costs and a tendency to overfit. While Bayesian Neural Networks (BNNs) provide a robust framework for uncertainty, they traditionally focus on parameter uncertainty—finding the distribution of weights for a fixed architecture. This paper addresses the gap in model uncertainty, treating the network structure itself as a random variable. The primary challenge is the "exponential explosion": a network with $Q$ weights has $2^Q$ possible sub-architectures, making traditional search methods computationally infeasible.

2. Methodology

The authors propose a "joint space" approach, performing inference on both weights ($\beta$) and latent binary indicators ($\gamma$). A weight is active if $\gamma=1$ and pruned if $\gamma=0$.

2.1 Spike-and-Slab Variational Family

To handle the discrete nature of model selection, the authors utilize a variational distribution acting as a mixture: a "spike" (a delta mass at zero) for excluded weights and a "slab" (a Gaussian distribution) for included weights.

2.2 Scalable Inference

To make this differentiable, a reparameterization trick is applied to the marginal inclusion probabilities. This allows the use of standard stochastic gradient descent (ADAM) to learn the optimal architecture. The introduced "doubly stochastic inference" algorithm samples both model structure and weight values during training to explore the architecture space efficiently.

3. Experimental Results

The approach was evaluated on MNIST and Fashion-MNIST (FMNIST) benchmarks, comparing the proposed "Full BNN" against baselines like Dense BNNs, Concrete Dropout, and Horseshoe priors.

3.1 Sparsity and Accuracy Gains

The model achieved extreme sparsity, maintaining a density level of only 5.1% to 8.4% on MNIST. Despite removing over 90% of weights, accuracy remained high. Furthermore, Bayesian Model Averaging (BMA) significantly improved performance; accuracy on MNIST rose from ~95.8% with a single sample to ~97.8% when averaged over multiple samples.

Accuracy improvement as a function of the number of samples used for Bayesian Model Averaging on MNIST (red) and Fashion-MNIST (green).

3.2 Uncertainty and Robustness

The model demonstrated superior out-of-distribution robustness. By analyzing predictive entropy, the authors implemented a "doubt" threshold: if confidence fell below 95%, the model could refuse to classify, leading to near-perfect accuracy on the remaining data. The "Full BNN" assigned high entropy to unfamiliar inputs rather than making confident, incorrect predictions.

Empirical CDF of predictive entropy for various BNN models, illustrating the distribution of uncertainty across different priors and methods.

4. Discussion and Conclusion

This work introduces a scalable method for simultaneous structural and parameter learning in BNNs. The model discovered efficient hierarchical representations, favoring extreme sparsity in early layers. While the training phase requires an additional variational parameter per weight, the resulting sparse models offer significant computational advantages. Future work includes exploring co-dependent weight inclusions and extending the framework to deeper architectures like ResNets.

Summary updated

BibTeX
@misc{hubin2019combining,
  author = {Aliaksandr Hubin and Geir Storvik},
  title = {{Combining Model and Parameter Uncertainty in Bayesian Neural Networks}},
  year = {2019},
  eprint = {1903.07594},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1903.07594},
}
Figure