Sparse Bayesian Neural Networks via Sticky Piecewise Deterministic Markov Processes
Organizations: Department of Mathematics, University of Oslo, NO · Department of Statistics, University of Warwick, UK
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.
Figures & tables
| Sampler | Sparsity | RMSE | NLL | CRPS |
|---|---|---|---|---|
| Boomerang | – | 0.115 | -0.740 | 0.066 |
| ZigZag | – | 0.116 | -0.739 | 0.067 |
| NUTS | – | 0.115 | -0.742 | 0.066 |
| Sticky Boomerang | 85% | 0.109 | -0.801 | 0.062 |
| Sticky ZigZag | 87% | 0.109 | -0.799 | 0.062 |
| LBBNN | 95% | 0.111 | -0.778 | 0.063 |
| Network | Sampler | Sparsity | RMSE | NLL | CRPS | ||
|---|---|---|---|---|---|---|---|
| Boomerang | – | – | 2.88 .19 | 2.48 .08 | 1.58 .10 | 90% | |
| ZigZag | – | – | 2.88 .22 | 2.49 .08 | 1.58 .12 | 91% | |
| NUTS | – | – | 2.86 .22 | 2.48 .08 | 1.57 .12 | 91% | |
| Sticky Boomerang | 0.3 | 64% | 2.98 .18 | 2.51 .06 | 1.62 .10 | 89% | |
| Sticky ZigZag | 0.3 | 67% | 2.97 .23 | 2.51 .08 | 1.63 .12 | 92% | |
| Sticky Boomerang | 0.1 | 85% | 3.07 .19 | 2.54 .06 | 1.67 .10 | 90% |
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| One-dimensional | UCI small | UCI medium | MNIST FFN | MNIST LeNet-5 | |
| Hidden layers | LeNet-5 | ||||
| Activation | ReLU | ||||
| Likelihood | Gaussian, fixed | Gaussian, learned | Gaussian, learned | Categorical | Categorical |
| , | 3, 3 | 1, 1 | 1, 1 | 2, 2 | 2, 2 |
| Noise prior scale | – | per dataset ⋆ | per dataset ⋆ | – | – |
| Inclusion weight | 0.1 | 0.3, 0.1 | 0.3, 0.1 | 0.05 | 0.05 |
| Hernandez | Multiscale | Gap | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sampler | Sparsity | RMSE | NLL | CRPS | Sparsity | RMSE | NLL | CRPS | Sparsity | RMSE | NLL | CRPS |
| Boomerang | – | 4.129 | 2.782 | 2.293 | – | 0.119 | -0.710 | 0.067 | – | 0.199 | -0.277 | 0.118 |
| ZigZag | – | 3.989 | 2.762 | 2.134 | – | 0.119 | -0.707 | 0.066 | – | 0.224 | -0.167 | 0.128 |
| NUTS | – | 4.121 | 2.781 | 2.309 | – | 0.119 | -0.713 | 0.067 | – | 0.214 | -0.275 | 0.116 |
| Sticky Boomerang | 87% | 4.498 | 2.832 | 2.425 | 85% | 0.127 | -0.626 | 0.071 | 85% | 0.210 | -0.140 | 0.117 |
| Sticky ZigZag | 87% | 4.369 | 2.811 | 2.383 | 84% | 0.123 | -0.665 | 0.069 | 86% | 0.196 | -0.141 | 0.111 |
| Network | Sampler | Sparsity | RMSE | NLL | CRPS | ||
|---|---|---|---|---|---|---|---|
| Boomerang | – | – | 0.35 .02 | 0.37 .06 | 0.19 .01 | 90% | |
| ZigZag | – | – | 0.34 .01 | 0.35 .03 | 0.19 .01 | 91% | |
| NUTS | – | – | 0.33 .02 | 0.30 .04 | 0.18 .01 | 91% | |
| Sticky Boomerang | 0.3 | 42% | 0.34 .02 | 0.35 .07 | 0.19 .01 | 90% | |
| Sticky ZigZag | 0.3 | 50% | 0.34 .01 | 0.35 .03 | 0.19 .01 | 91% | |
| Sticky Boomerang | 0.1 | 51% | 0.35 .02 | 0.39 .07 | 0.19 .01 | 88% |
| Network | Sampler | Sparsity | RMSE | NLL | CRPS | ||
|---|---|---|---|---|---|---|---|
| Boomerang | – | – | 4.97 .20 | 3.01 .04 | 2.70 .09 | 87% | |
| ZigZag | – | – | 5.12 .15 | 3.03 .03 | 2.79 .07 | 88% | |
| NUTS | – | – | 5.15 .19 | 3.03 .03 | 2.80 .08 | 89% | |
| Sticky Boomerang | 0.3 | 54% | 5.15 .22 | 3.05 .04 | 2.81 .09 | 88% | |
| Sticky ZigZag | 0.3 | 61% | 5.38 .20 | 3.09 .04 | 2.96 .10 | 88% | |
| Sticky Boomerang | 0.1 | 72% | 5.32 .24 | 3.08 .04 | 2.91 .10 | 87% |
| Network | Sampler | Sparsity | RMSE | NLL | CRPS | ||
|---|---|---|---|---|---|---|---|
| Boomerang | – | – | 0.32 .07 | 0.45 .26 | 0.17 .02 | 92% | |
| ZigZag | – | – | 0.33 .07 | 0.68 .40 | 0.15 .02 | 87% | |
| NUTS | – | – | 0.28 .08 | 0.15 .62 | 0.11 .02 | 88% | |
| Sticky Boomerang | 0.3 | 54% | 0.34 .07 | 0.84 .46 | 0.16 .02 | 85% | |
| Sticky ZigZag | 0.3 | 56% | 0.33 .06 | 0.63 .35 | 0.15 .02 | 86% | |
| Sticky Boomerang | 0.1 | 67% | 0.32 .06 | 0.56 .36 | 0.15 .02 | 85% |
| bulk ESS | bulk ESS per grad. evals | |||||||
|---|---|---|---|---|---|---|---|---|
| Network | Sampler | test RMSE | test RMSE | test RMSE | ||||
| ZigZag | – | 1.00 | 1.00 | 2,362 | 3,799 | 591 | 950 | |
| Boomerang | – | 1.01 | 1.00 | 2,622 | 9,629 | 656 | 2,407 | |
| NUTS | – | 1.00 | 1.00 | 4,854 | 3,961 | 12,965 | 10,580 | |
| Sticky ZigZag | 0.3 | 1.00 | 1.00 | 2,763 | 3,529 | 691 | 882 | |
| Sticky Boomerang | 0.3 | 1.01 | 1.00 | 1,676 | 4,095 | 419 | 1,024 | |
| FFN | LeNet-5 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Model | Sparsity | Acc | ECE | NLL | Brier | Sparsity | Acc | ECE | NLL | Brier |
| SGD | – | 0.9836 | 0.0117 | 0.0854 | 0.0277 | – | 0.9912 | 0.0053 | 0.0342 | 0.0148 |
| – | 0.9812 | 0.0070 | 0.0620 | 0.0284 | – | 0.9908 | 0.0048 | 0.0297 | 0.0146 | |
| ZigZag | – | 0.9756 | 0.0065 | 0.0806 | 0.0370 | – | 0.9923 | 0.0088 | 0.0307 | 0.0142 |
| 91% | 0.9821 | 0.0073 | 0.0585 | 0.0273 | 89% | 0.9909 | 0.0055 | 0.0310 | 0.0144 | |
| Sticky ZigZag | 98% | 0.9797 | 0.0164 | 0.0759 | 0.0339 | 92% | 0.9904 | 0.0107 | 0.0369 | 0.0163 |
| Boston | Energy | Concrete | Yacht | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| RMSE | NLL | CRPS | RMSE | NLL | CRPS | RMSE | NLL | CRPS | RMSE | NLL | CRPS | |
| Boomerang | -.08 | -.08 | -.11 | -.00 | -.03 | -.00 | -.01 | -.03 | -.06 | .01 | .04 | .04 |
| ZigZag | -.11 | -.08 | -.07 | -.00 | -.08 | -.00 | .09 | -.07 | .09 | -.01 | -.31 | -.01 |
| Sticky Boomerang | -.02 | -.01 | .01 | -.00 | -.00 | -.00 | .08 | .03 | .06 | -.00 | .19 | -.00 |
| Sticky ZigZag | .04 | .00 | .03 | -.01 | -.07 | -.00 | .42 | -.00 | .27 | -.01 | -.69 | -.01 |
Bayesian Neural Networks
Bayesian neural networks place probability distributions over neural-network parameters or functions to quantify predictive uncertainty and support robust decisions.
See all 90 papers