TL;DR
This paper introduces "Structured Stochastic Gradient MCMC" (S-SGMCMC), a novel sampling method that bridges the gap between computationally expensive but accurate MCMC and faster but assumption-heavy Variational Inference (VI). By allowing users to specify which posterior correlations to break, S-SGMCMC achieves faster mixing times and improved accuracy compared to standard SGMCMC, especially in deep learning models.
What Problem Does This Paper Address?
Bayesian Neural Networks (BNNs) offer robust uncertainty estimates, but training them typically relies on Markov Chain Monte Carlo (MCMC) methods. For large-scale models, standard MCMC is too slow. Stochastic Gradient MCMC (SGMCMC) offers a scalable alternative by using mini-batches of data, but it can still suffer from slow "mixing" (the chain takes a long time to explore the parameter space). Variational Inference (VI) is faster but makes strong assumptions about the posterior's form (e.g., it's factorized) and can lead to underestimation of uncertainty. This paper aims to combine the strengths of both: the flexibility and accuracy of MCMC with the speed and scalability of VI, without the restrictive assumptions of traditional VI.
Methods
The core idea is to modify the energy function used in SGMCMC. Instead of treating the entire posterior as a single, complex entity, S-SGMCMC partitions the model parameters into groups. The algorithm then effectively marginalizes out some parameters within these groups by averaging over samples from previous iterations. This process breaks certain posterior correlations in a controlled way, allowing the sampling chain to mix faster.
Key techniques include:
- Structured Energy Function: A new energy function, $U^{(S)}(\theta)$, is derived by partially marginalizing the original energy function $U(\theta)$ with respect to parameter groups. This allows for a "structured" approximation of the posterior.
- Structured SGMCMC (S-SGMCMC): This is the main algorithm that runs standard SGMCMC (like SGLD, pSGLD, SGHMC) on the structured energy function. Users can specify which parameter groups to keep correlated and which to break.
- Structured Dropout SGMCMC (Sa-SGMCMC): To further improve scalability, especially when the number of parameter groups ($M$) is large, a "dropout-inspired" approximation is introduced. This technique allows for interpolation between full SGMCMC and a "mean-field" version (where all correlations are broken), offering a tunable trade-off between speed and accuracy.
Datasets
The paper evaluates its methods on several standard datasets:
- Image Classification: CIFAR-10, SVHN, and Fashion MNIST.
- Regression: Wine quality, Boston housing, obesity levels, Seoul bike-sharing, concrete compressive strength, and airfoil self-noise datasets.
Key Insights and Ideas
- Controlled Posterior Factorization: The ability to explicitly define which parameter correlations to break is a significant advantage over standard VI, which often assumes full factorization. This allows for more flexible and accurate posterior approximations.
- Faster Mixing, Better Accuracy: By breaking correlations, S-SGMCMC significantly speeds up the mixing time of the Markov chains. This often leads to better predictive accuracy and larger effective sample sizes compared to standard SGMCMC, especially in deep learning models.
- Dropout for Scalability: The Sa-SGMCMC variant, inspired by dropout, provides a crucial mechanism for scaling the method to models with a very large number of parameters, where the full S-SGMCMC becomes computationally prohibitive.
- Tunable Correlation: The dropout rate in Sa-SGMCMC acts as a hyperparameter that allows for a smooth interpolation between a fully correlated posterior (like SGMCMC) and a fully factorized one (like mean-field VI).
Key Results
- Improved Accuracy: On CIFAR-10, SVHN, and Fashion MNIST using ResNet-20, the proposed methods achieved comparable or even higher accuracy than standard SGMCMC. For example, Sa-pSGLD achieved 96.3% accuracy on MNIST with 32 groups, outperforming pSGLD's 94.2%.
- Faster Mixing: Experiments showed that S-SGMCMC and Sa-SGMCMC chains mixed significantly faster, as evidenced by lower Integrated Autocorrelation Times (IAC) and higher Effective Sample Sizes (ESS) in Table 2. For instance, Sa-SGHMC$_{0}$ on CIFAR-10 achieved an ESS of 8.24, compared to SGHMC's 6.83.
- Regression Performance: On regression tasks, the methods demonstrated that partitioning parameters could lead to faster mixing and, in some cases, better performance, with fully factorized partitions often yielding the fastest mixing.
Limitations and Future Work
- Computational Cost: While Sa-SGMCMC improves scalability, it still requires more computation per sample than standard SGMCMC. The full S-SGMCMC method can be computationally expensive when the number of parameter groups ($M$) is very large.
- Memory Requirements: Unlike baseline SGMCMC methods that can save samples to disk, the proposed methods require keeping chains of samples on the GPU for efficient computation.
- Theoretical Analysis: The authors suggest future work could focus on more formal theoretical analyses, such as proving convergence guarantees for S-SGMCMC.
- Parameter Grouping: While the paper explores different partitioning schemes, finding the optimal partitioning for a given model and dataset remains an open question.
Summary updated