TL;DR
Standard function-space variational inference (VI) for Bayesian neural networks (BNNs) is theoretically broken because the Kullback-Leibler (KL) divergence between a BNN’s function distribution and a Gaussian process (GP) prior is negative infinite. This paper introduces Generalized Function-Space VI (GFSVI), which replaces the standard KL divergence with a mathematically well-defined regularized KL divergence on Hilbert spaces. By combining this divergence with a linearized BNN, GFSVI provides the first stable, well-defined variational objective that allows BNNs to incorporate genuine, structured GP priors.
What Problem Does This Paper Address?
In Bayesian deep learning, specifying meaningful priors over millions of uninterpretable network weights is notoriously difficult; default isotropic Gaussian priors often lead to strange, pathological behaviors. A natural solution is to place priors directly in function space using Gaussian Processes (GPs), which allow practitioners to encode intuitive properties like smoothness, length-scales, or periodicity.
However, Burt et al. (2020) demonstrated a fatal flaw in this formulation: the functional evidence lower bound (ELBO) evaluates to negative infinity ($-\infty$) for almost all GP priors of interest. Because a neural network has a finite number of parameters, its induced distribution over functions lives on a finite-dimensional submanifold of an infinite-dimensional function space. In contrast, a non-degenerate GP prior has support over the entire infinite-dimensional space. By the Feldman-Hájek theorem, these two measures are mutually singular, rendering their functional KL divergence infinite and causing severe numerical instability during optimization.
Methods
To resolve the singularity issue, the authors turn to Generalized Variational Inference (GVI) and introduce GFSVI:
- Regularized KL Divergence ($D_{KL}^\gamma$): Instead of standard KL, the authors adopt Quang’s (2019, 2022) regularized KL divergence between Gaussian measures over a Hilbert space $L^2(\mathcal{X}, \rho)$. By adding an operator regularization parameter $\gamma > 0$, $D_{KL}^\gamma$ is guaranteed to remain finite even when the measures have mismatched support, while converging back to the standard KL divergence as $\gamma \to 0$ when well-defined.
- Linearized BNN: To obtain an explicit Gaussian measure for the BNN, the network weights are linearized around their variational mean $w = m$. This turns the pushforward variational distribution into a degenerate GP with mean $f(x; m)$ and covariance $J(x; m) S J(x; m)^\top$.
- Consistent Finite-Sample Estimator: The regularized KL divergence between the linearized BNN and the GP prior can be estimated consistently from $M$ measurement points $x \sim \rho(x)$ with a known $\mathcal{O}(1/M)$ error bound.
- Optimization: Variational parameters (mean $m$ and covariance $S$) are trained via stochastic gradient descent on the objective: $$\hat{\mathcal{L}}(\phi) = \text{Expected Log-Likelihood} - \hat{D}_{KL}^\gamma(Q_\phi^F \,\|\, P^F)$$
Datasets
The authors evaluated GFSVI across several domains without introducing new benchmarks:
- Synthetic: 1D regression ($y = \sin(2\pi x) + \epsilon$) and 2D Two Moons classification.
- Physics/Fluid Dynamics: The GulfDrifters dataset (tracking ocean currents in the Gulf of Mexico via buoy velocities), combined with a Helmholtz-decomposed GP prior.
- Tabular Regression: 10 benchmark datasets from the UCI repository (Boston, Concrete, Energy, Kin8nm, Naval, Power, Protein, Wine, Yacht, Wave, and Denmark).
- Image Data & OOD: MNIST and FashionMNIST, utilizing Kuzushiji-MNIST (KMNIST) and random noise distributions as measurement points $\rho(x)$, and the Million Song Dataset for tabular OOD.
Key Insights and Ideas
- Theory Explains Practice: The infinite KL divergence is not just an esoteric measure-theoretic technicality; it directly explains the optimization instabilities, support mismatches, and gradient issues plaguing prior function-space VI methods (like FVI).
- $\gamma$ as Principled Jitter: The regularization parameter $\gamma$ acts mathematically as a principled form of jitter. It bridges the dimensional gap between the finite-rank BNN covariance and full-rank GP kernels while controlling the regularization strength.
- Inductive Bias Alignment Matters: A BNN cannot adopt any functional prior unconditionally. The authors find that piece-wise linear activations (ReLU) struggle with smooth RBF priors (causing underfitting) or rough priors (collapsing uncertainty). Smooth activations (Tanh) align far better with standard GP covariance functions.
- Measurement Distribution is Critical in High Dimensions: For image tasks, where measurement points $\rho(x)$ are sampled dictates where function-space regularization occurs, which strongly impacts out-of-distribution (OOD) detection performance.
Key Results
- Fidelity to GP Posteriors: On synthetic data, GFSVI closely reproduces the exact GP posterior under varying kernels (RBF, Matérn-1/2, Periodic) and requires far fewer measurement points ($M=10$) than FVI ($M=100$) to yield smooth approximations. GFSVI also achieved lower point-wise Wasserstein-2 distance to the true GP posterior than FVI across all tested UCI datasets.
- Physical Modeling: In Gulf of Mexico ocean current modeling, GFSVI improved expected log-likelihood from $-22.651$ (weight-space prior via TFSVI) to $-6.627$, cutting MSE from $0.034$ to $0.021$.
- UCI Benchmarks: GFSVI attained the best mean rank across 10 regression datasets in both test log-likelihood (rank 1.545) and MSE (rank 1.364), outperforming BNN baselines (FVI, TFSVI, MFVI, VIP, Laplace).
- Calibration and OOD: On image classification, GFSVI achieved competitive accuracy ($99.2\%$ on MNIST) with exceptionally low Expected Calibration Error ($0.002$). In tabular OOD detection, GFSVI ranked first among all BNN methods (mean rank 1.455).
Limitations and Future Work
- Linearization Dependence: The method relies on local linearization of the BNN around the weight mean, which discards higher-order network non-linearities.
- Measurement Distribution in High Dimensions: Choosing an informative distribution $\rho(x)$ for high-dimensional image data remains non-trivial and heavily influences OOD robustness.
- Posterior Expressiveness: The current formulation was evaluated primarily using mean-field (fully-factorized) Gaussian posteriors in weight space; extending this to low-rank plus diagonal covariance structures is left for future work.
- BNN Inductive Bias Overhead: On small physical datasets where exact GP inference is tractable, exact GPs still outperformed GFSVI, indicating that neural network inductive biases can sometimes hinder purely physical priors.
Summary updated