Learning to Explore for Stochastic Gradient MCMC

SeungHyun Kim, Seohyeon Jung, SeongHyeon Kim, Juho Lee

Introduction

Bayesian Neural Networks (BNNs) are essential for safety-critical applications like autonomous driving and medical diagnosis because they provide a distribution of possible models rather than a single point estimate. This allows for robust uncertainty quantification. However, the posterior landscape of a deep BNN is notoriously difficult to navigate—it is high-dimensional and multi-modal, containing many isolated peaks of high probability.

Standard Stochastic Gradient MCMC (SGMCMC) methods often struggle in these environments, frequently getting trapped in a single mode or requiring an impractical number of steps to explore the distribution effectively. While meta-learning has been proposed to improve samplers, previous methods have often been too computationally expensive to scale or failed to generalize beyond their training data.

The L2E Framework

Learning to Explore (L2E) is a novel meta-learning framework designed to overcome these limitations by training a neural network to learn an optimal "kinetic energy" for sampling.

Learning Kinetic Energy

In physics-inspired sampling, "kinetic energy" determines the momentum of the sampler. L2E replaces the standard Gaussian kinetic energy with a custom function. Specifically, it uses neural networks ($\alpha_\phi$ and $\beta_\phi$) to parameterize the gradients of this kinetic energy, allowing the sampler to adapt its speed and direction based on the local geometry of the loss surface.

Diversity through BMA Meta-Loss

A key innovation in L2E is the use of a Bayesian Model Averaging (BMA) meta-loss. Unlike typical meta-learners that optimize for the performance of a single model, L2E optimizes for the performance of the ensemble of samples. This objective naturally incentivizes the sampler to explore diverse regions of the posterior; if the sampler only finds one mode, the BMA loss remains high.

Scalable Optimization via Evolution Strategies

To train the meta-sampler without the memory overhead of backpropagating through thousands of sampling steps, the authors employ Evolution Strategies (ES). This approach avoids "unrolling" the sampler and provides more stable gradients for the meta-parameters $\phi$.

Experimental Results

The authors evaluated L2E's generalization capabilities by training it on simple tasks (like MNIST and fashion-MNIST) and testing it on entirely new, larger models and datasets, including CIFAR-10, CIFAR-100, and Tiny-ImageNet.

Predictive performance (ACC and NLL) of L2E compared to baselines across four datasets. L2E consistently achieves higher accuracy and lower NLL as the number of samples increases.

Key Findings

  • Superior Exploration: L2E consistently outperformed vanilla SGMCMC and Deep Ensembles (DE) in both predictive accuracy and Negative Log-Likelihood (NLL).
  • Fidelity to HMC: L2E's predictive distribution closely matches that of Hamiltonian Monte Carlo (HMC)—the gold standard for sampling—while remaining computationally efficient.
  • Zero-Shot Transfer: A sampler trained on simple digit recognition (MNIST) effectively navigated the complex landscape of a ResNet-50 on Tiny-ImageNet, demonstrating remarkable robustness.
  • Out-of-Distribution (OOD) Detection: L2E showed significantly better performance in OOD tasks, correctly identifying unfamiliar data more reliably than competing methods.

Conclusion and Future Work

L2E represents a significant step forward in making Bayesian inference practical for deep learning. By meta-learning the exploration strategy, it removes the need for manual hyperparameter tuning and provides superior uncertainty quantification. Future research may explore the direction of the learned updates to further understand how L2E navigates high-dimensional posterior "valleys" and investigate ways to reduce the initial meta-training cost.

Summary updated

BibTeX
@inproceedings{kim2024learning,
  author = {SeungHyun Kim and Seohyeon Jung and SeongHyeon Kim and Juho Lee},
  title = {{Learning to Explore for Stochastic Gradient MCMC}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=aECamk9izk},
}
Figure