Abstract
Variational Bayesian neural networks combine the flexibility of deep learning with Bayesian uncertainty estimation. However, inference procedures for flexible variational posteriors are computationally expensive. A recently proposed method, noisy natural gradient, is a surprisingly simple method to fit expressive posteriors by adding weight noise to regular natural gradient updates. Noisy K-FAC is an instance of noisy natural gradient that fits a matrix-variate Gaussian posterior with minor changes to ordinary K-FAC. Nevertheless, a matrix-variate Gaussian posterior does not capture an accurate diagonal variance. In this work, we extend on noisy K-FAC to obtain a more flexible posterior distribution called eigenvalue corrected matrix-variate Gaussian. The proposed method computes the full diagonal re-scaling factor in Kronecker-factored eigenbasis. Empirically, our approach consistently outperforms existing algorithms (e.g., noisy K-FAC) on regression and classification tasks.
Introduction
Deep learning models are notoriously overconfident, often failing to signal when they encounter data far from their training distribution. Bayesian Neural Networks (BNNs) address this by treating weights as probability distributions rather than fixed values. However, training BNNs is computationally challenging, often requiring simplifying assumptions that limit model expressivity.
Common approximations include the Fully Factorized Gaussian (FFG), which assumes all weights are independent, and the Matrix-Variate Gaussian (MVG) used in K-FAC. While MVG captures some weight correlations, it imposes a rigid structure that cannot accurately represent individual weight variances. This "flexibility gap" arises because standard K-FAC has only $n + p$ degrees of freedom to describe variance, which is insufficient for the $n \times p$ complexity of a typical neural network layer's loss landscape.
Methods: Noisy EK-FAC and the EMVG Posterior
To bridge this gap, we introduce Noisy EK-FAC (Eigenvalue corrected Kronecker-factored Approximate Curvature). This method builds on two core concepts:
- Noisy Natural Gradient: This technique adds adaptive noise to gradient updates, forcing the optimization process to converge to a Bayesian posterior distribution.
- Eigenvalue Correction: While standard K-FAC approximates curvature using a simplified Kronecker structure, EK-FAC projects gradients into an eigenbasis. This allows for the calculation of a unique re-scaling factor for every single dimension.
By combining these ideas, we derive a new posterior distribution called the Eigenvalue Corrected Matrix-Variate Gaussian (EMVG). This distribution is significantly more flexible than standard K-FAC, increasing the degrees of freedom from $n+p$ to $n \times p$ without a massive increase in computational cost. To maintain efficiency, expensive operations like eigendecompositions are amortized and performed only once every few hundred iterations.
Empirical Results
We evaluated Noisy EK-FAC against several baselines, including Bayes By Backprop (BBB), Noisy Adam, and Noisy K-FAC, across regression and classification tasks.
Regression Benchmarks
On 10 standard UCI datasets, Noisy EK-FAC consistently outperformed existing methods. It achieved higher test log-likelihoods, indicating that its uncertainty estimates are more reliable and better calibrated than those of its predecessors.
Image Classification
On the CIFAR-10 dataset using a VGG16 architecture, Noisy EK-FAC achieved 87.07% accuracy without data augmentation, a significant improvement over Noisy K-FAC's 85.52%. When combined with modern techniques like Batch Normalization and Data Augmentation, it maintained a competitive edge, reaching 92.22% accuracy.
Discussion and Limitations
While Noisy EK-FAC provides superior uncertainty quality, it requires careful handling of stability. The second-moment gradient estimates used for eigenvalue correction can be unstable with small batch sizes, requiring periodic re-initialization of the re-scaling matrix. Additionally, the method introduces hyperparameters for damping and weighting that must be tuned for optimal performance. Future research will focus on scaling these techniques to massive architectures like Transformers, where the memory cost of factored matrices remains a challenge.
Summary updated