Abstract
Classical parameter-space Bayesian inference for Bayesian neural networks (BNNs) suffers from several unresolved prior issues, such as knowledge encoding intractability and pathological behaviours in deep networks, which can lead to improper posterior inference. To address these issues, functional Bayesian inference has recently been proposed leveraging functional priors, such as the emerging functional variational inference. In addition to variational methods, stochastic gradient Markov Chain Monte Carlo (MCMC) is another scalable and effective inference method for BNNs to asymptotically generate samples from the true posterior by simulating continuous dynamics. However, existing MCMC methods perform solely in parameter space and inherit the unresolved prior issues, while extending these dynamics to function space is a non-trivial undertaking. In this paper, we introduce novel functional MCMC schemes, including stochastic gradient versions, based on newly designed diffusion dynamics that can incorporate more informative functional priors. Moreover, we prove that the stationary measure of these functional dynamics is the target posterior over functions. Our functional MCMC schemes demonstrate improved performance in both predictive accuracy and uncertainty quantification on several tasks compared to naive parameter-space MCMC and functional variational inference.
Introduction
Bayesian Neural Networks (BNNs) are powerful because they provide predictive uncertainty alongside their outputs. However, standard BNNs face a significant "prior problem." They typically place a simple Gaussian prior distribution over the network's parameters (weights and biases). This approach lacks interpretability—it is nearly impossible to predict how a specific weight distribution translates to functional behavior—and can lead to "pathological" functions in deep networks, such as flat horizontal lines or extreme heavy-tailed behavior.
While Functional Variational Inference (FVI) attempts to solve this by operating in the function space, it often relies on restrictive distributional assumptions. Conversely, Markov Chain Monte Carlo (MCMC) is considered the "gold standard" for exact inference but has historically been restricted to parameter space. This paper introduces Functional Stochastic Gradient MCMC (fSGMCMC), bridging this gap by performing inference directly in function space.
Methodology
The authors derive fSGMCMC by "lifting" diffusion dynamics from parameter space to the infinite-dimensional function space.
The Functional Lift
Using the Itô lemma from stochastic calculus, the framework describes how changes in neural network parameters propagate to changes in the function itself. This allows for the design of new diffusion dynamics (Langevin and Hamiltonian) directly in function space. The authors introduce two main schemes:
- fSGLD (Functional Stochastic Gradient Langevin Dynamics): A functional adaptation of the popular SGLD algorithm.
- fSGHMC (Functional Stochastic Gradient Hamiltonian Monte Carlo): A momentum-based approach for more efficient function space exploration.
Tractability via Measurement Points
To handle the infinite dimensionality of function space, the authors use a finite set of measurement points (a combination of training data and "inducing points") to estimate the gradient of the functional prior. These functional updates are transformed back into parameter-space update rules, making the algorithms computationally feasible for modern architectures like ResNet-18.
Experimental Results
The authors evaluated fSGMCMC across diverse tasks, including synthetic 1-D extrapolation, UCI regression benchmarks, image classification (MNIST, CIFAR-10), and contextual bandits.
Key Findings
- Predictive Accuracy: fSGHMC outperformed all baselines, including standard SGLD/SGHMC and functional variational methods, in Root Mean Square Error (RMSE) across all seven UCI regression datasets.
- Reliable Uncertainty: In image classification, fSGMCMC methods achieved significantly higher AUC scores for Out-of-Distribution (OOD) detection. For CIFAR-10/SVHN, fSGHMC reached an AUC of 0.717, compared to 0.669 for standard SGLD.
- Efficient Exploration: By focusing on function space, the MCMC sampler avoids the symmetries of parameter space (where many weight configurations represent the same function), finding more continuous exploration paths.
Conclusion
Functional SGMCMC addresses the long-standing prior issues in BNNs by enabling inference in function space. By incorporating informative priors like Gaussian Processes, the method achieves superior accuracy and uncertainty quantification. While the choice of measurement points requires some tuning, the framework demonstrates significant potential for robust Bayesian deep learning. Future work will explore more complex, non-Gaussian functional priors and further optimization for massive-scale models.
Summary updated