Abstract
Stochastic gradient Markov Chain Monte Carlo (SGMCMC) is considered the gold standard for Bayesian inference in large-scale models, such as Bayesian neural networks. Since practitioners face speed versus accuracy tradeoffs in these models, variational inference (VI) is often the preferable option. Unfortunately, VI makes strong assumptions on both the factorization and functional form of the posterior. In this work, we propose a new non-parametric variational approximation that makes no assumptions about the approximate posterior's functional form and allows practitioners to specify the exact dependencies the algorithm should respect or break. The approach relies on a new Langevin-type algorithm that operates on a modified energy function, where parts of the latent variables are averaged over samples from earlier iterations of the Markov chain. This way, statistical dependencies can be broken in a controlled way, allowing the chain to mix faster. This scheme can be further modified in a "dropout" manner, leading to even more scalability. We test our scheme for ResNet-20 on CIFAR-10, SVHN, and FMNIST. In all cases, we find improvements in convergence speed and/or final accuracy compared to SG-MCMC and VI.
Introduction
Bayesian Neural Networks (BNNs) are prized for their ability to provide reliable uncertainty estimates, but performing inference on them is notoriously difficult. Practitioners generally choose between two "evils":
- Stochastic Gradient MCMC (SGMCMC): Theoretically exact but painfully slow to "mix" (explore the parameter space) in high dimensions.
- Variational Inference (VI): Fast and scalable, but relies on restrictive parametric assumptions (like assuming the posterior is a simple Gaussian). This often leads to "over-confident" models that underestimate uncertainty and fail to capture multiple modes in the data.
This paper introduces Structured SGMCMC, a novel framework that bridges the gap between the flexibility of MCMC and the speed of VI. By systematically breaking specific posterior correlations using a "self-averaged" energy function, the authors achieve significantly faster mixing times in high-dimensional models without sacrificing the ability to capture complex, multi-modal distributions.
Methodology
The authors propose two primary algorithms that retain the non-parametric flexibility of MCMC while adopting the factorization tricks of VI.
Structured SGMCMC (S-SGMCMC)
Inspired by structured VI, this method partitions model parameters into $M$ groups. It operates on a "self-averaged" posterior energy function. When updating one group of parameters, the other groups are treated as being sampled from their own empirical distributions based on previous iterations. This "decouples" the coordinates, allowing the chain to explore the space much faster.
Structured Dropout SGMCMC ($S_d$-SGMCMC)
To solve the scaling issues of the basic structured version, the authors introduce a "dropout" mechanism. By using stochastic masks to select which parameters to update and which to "self-average," they create a scheme that scales independently of the number of groups. This allows for a smooth interpolation between full SGMCMC (modeling all correlations) and a "mean-field" version (breaking all correlations).
Key Insights
- The Mixing-Accuracy Trade-off: The paper demonstrates that you can trade off the modeling of certain posterior correlations for a massive boost in mixing speed. In many deep learning tasks, the speedup in exploration outweighs the slight loss in correlation accuracy.
- Capturing Multi-modality: As shown in the toy visualizations, the proposed method successfully captures four distinct modes in a multi-modal energy landscape. Standard Gaussian VI collapses to a single mode, highlighting why a non-parametric sampling approach is superior for complex landscapes.
- Dropout as a Dial: The dropout rate $\rho$ in $S_d$-SGMCMC acts as a hyperparameter that lets researchers choose how much "structure" to impose. A high $\rho$ behaves like standard SGMCMC, while a low $\rho$ behaves like a factorized variational approximation.
Experimental Results
The researchers evaluated their approach across a variety of tasks, including regression benchmarks and image classification using a ResNet-20 architecture on CIFAR-10, SVHN, and Fashion MNIST (FMNIST).
- Faster Convergence: On CIFAR-10 and SVHN, $S_d$-SGMCMC reached optimal accuracy significantly faster than standard SGMCMC and even outperformed some VI baselines.
- Improved Mixing: The authors measured "Integrated Autocorrelation Time" (IAC)—a metric for how quickly a chain produces independent samples. Their method showed much lower IAC (better mixing) than standard pSGLD. For example, on CIFAR-10, $S_d$-pSGLD achieved an IAC of 620 compared to 831 for standard pSGLD.
- Competitive Accuracy: In most cases, the structured approach achieved higher final accuracy than parametric VI (MFVI) and matched or exceeded the performance of standard SGMCMC. On FMNIST, $S_d$-pSGLD achieved ~92.5% accuracy, outperforming the 91.1% of standard pSGLD.
Limitations and Future Work
While promising, the method has some trade-offs. The current implementation is more memory-intensive than standard SGMCMC because it requires keeping chains of samples in GPU memory for "self-averaging." Potential fixes include "thinning" the chain or reservoir sampling. Additionally, while $S_d$-SGMCMC is comparable in wall-clock time due to faster mixing, it requires slightly more computation per sample. Finally, finding optimal ways to group parameters for specific architectures remains an open area for exploration.
Summary updated