Abstract
Artificial neural networks are powerful machine learning methods used in many modern applications. A common issue is that they have millions or billions of parameters, and therefore tend to overfit. Bayesian neural networks (BNN) can improve on this since they incorporate parameter uncertainty. Latent binary Bayesian neural networks (LBBNN) further take into account structural uncertainty by allowing the weights to be turned on or off, enabling inference in the joint space of weights and structures. Mean-field variational inference is typically used for computation within such models. In this paper, we consider two extensions of variational inference for the LBBNN: Firstly, by using the local reparametrization trick (LCRT), we improve computational efficiency. Secondly, and more importantly, by using normalizing flows on the variational posterior distribution of the LBBNN parameters, we learn a more flexible variational posterior than the mean field Gaussian. Experimental results on real data show that this improves predictive power compared to using mean field variational inference on the LBBNN method, while also obtaining sparser networks. We also perform two simulation studies. In the first, we consider variable selection in a logistic regression setting, where the more flexible variational distribution improves results. In the second study, we compare predictive uncertainty based on data generated from two-dimensional Gaussian distributions. Here, we argue that our Bayesian methods lead to more realistic estimates of predictive uncertainty.
Introduction
Modern deep learning models are frequently over-parameterized, often containing billions of weights. This leads to two primary challenges: overfitting, where the model memorizes noise rather than learning underlying patterns, and overconfidence, where the model provides incorrect predictions with high certainty.
Bayesian Neural Networks (BNNs) address these issues by treating weights as probability distributions. However, standard BNNs often rely on a "mean-field" assumption, which posits that every weight in the network is independent of every other weight. In practice, weights are highly correlated. Furthermore, most BNNs remain "dense," keeping all parameters active. This research introduces LBBNN-FLOW, a framework designed to create BNNs that are both sparse (removing unnecessary connections) and flexible enough to model complex parameter relationships.
Methodology
Latent Binary Variables and Structural Sparsity
The foundation of this approach is the Latent Binary Bayesian Neural Network (LBBNN), which utilizes a "spike-and-slab" prior. In this setup, every weight is associated with a latent binary variable ($\gamma$). When $\gamma = 1$, the weight is active (the "slab"); when $\gamma = 0$, the weight is effectively deleted (the "spike" at zero). This allows the model to perform inference over the network structure itself, learning which connections are essential for the task.
Multiplicative Normalizing Flows (MNF)
To overcome the limitations of the mean-field assumption, the authors integrate Multiplicative Normalizing Flows (MNF). By using Inverse Autoregressive Flows (IAF), the model transforms a simple distribution into a complex, multi-modal one. This enables the network to capture dependencies between weights—for instance, learning how the inclusion of one weight might depend on the presence of another.
Computational Efficiency via LCRT
To maintain computational feasibility, the researchers employed the Local Reparametrization Trick (LCRT). By sampling the "pre-activations" (the signals transmitted between layers) directly rather than the weights themselves, the model reduces variance during training. This leads to faster and more reliable convergence.
Experimental Evaluation
The LBBNN-FLOW approach was evaluated across several benchmarks, including simulated logistic regression with highly correlated variables, image classification (MNIST, Fashion-MNIST, KMNIST, and CIFAR-10), and various tabular datasets from the UCI repository.
Key Results
- Superior Sparsity: On the KMNIST dataset, LBBNN-FLOW achieved a network density of just 0.074 to 0.096. This indicates that the model successfully pruned over 90% of the weights while still outperforming dense models in accuracy.
- Variable Selection: In simulation studies involving correlated features, LBBNN-FLOW achieved a True Positive Rate (TPR) of 0.972, significantly outperforming the baseline LBBNN-LCRT (0.838) and the classic Carbonetto-Stephens algorithm (0.681).
- Uncertainty Calibration: The flow-based models demonstrated lower Expected Calibration Error (ECE), suggesting they are better at knowing when they are likely to be wrong, which is critical for safety-sensitive applications.
Discussion and Conclusion
The research highlights that breaking the independence assumption is vital when dealing with correlated input features. By treating sparsity as an inherent part of the Bayesian inference process rather than an ad-hoc post-processing step, the model learns the most probable sparse explanation for the data.
While the "Bayesian Tax"—the increased computational cost of training with normalizing flows—is real (approximately 4x longer per epoch), the resulting networks are significantly smaller and more robust. Future work may explore scaling these techniques to foundational models like large-scale Transformers and investigating "skip connections" that the model can autonomously deactivate to choose between linear and non-linear representations.
Summary updated