Abstract
Variational Inference (VI) is traditionally performed in parameter space, but recent work suggests that performing VI directly in function space may be more effective for non-identifiable models like Bayesian Neural Networks (BNNs). This paper investigates the mathematical validity of function-space VI, demonstrating that the standard Kullback-Leibler (KL) divergence objective is often ill-defined (infinite) when comparing parametric models to Gaussian process priors. We introduce a Bayesian Linear Regression (BLR) benchmark to rigorously evaluate approximation quality and find that current practical workarounds, while avoiding infinite objectives, often lead to overfitting.
1. Introduction
In Bayesian deep learning, the primary goal is often the predictive distribution rather than the specific parameter values. Traditional VI approximates the posterior of model weights, but the non-identifiability of neural networks—where many weight configurations yield the same function—complicates this process. Function-space VI (fVI) aims to bypass the weights and optimize the distribution of functions directly. However, the theoretical soundness of using KL divergence in infinite-dimensional function spaces remains a critical concern.
2. The "Infinite KL" Problem
Using measure theory, we demonstrate that the KL divergence between a parametric model (e.g., a BNN) and a non-degenerate Gaussian Process (GP) prior is typically infinite. This occurs because the two distributions are mutually singular; the BNN can only represent a subset of the functions supported by the GP. Even comparing two BNNs of different widths can result in an infinite KL divergence, highlighting a fundamental issue with the standard fVI objective.
3. Benchmarking Functional Inference
To evaluate fVI methods beyond predictive metrics, we propose a Bayesian Linear Regression (BLR) benchmark. Since BLR has an analytical closed-form posterior, it allows for the direct measurement of inference quality—how well the approximate posterior matches the true posterior. This separates the quality of the inference algorithm from the inherent limitations of the model architecture.
4. Experimental Evaluation
We evaluated several approximation schemes: FIXEDA (fixed set of points), RANDA (randomly sampled points), and SSGE (Spectral Stein Gradient Estimator).
As shown in Figure 1, methods like FIXEDA and SSGE can significantly deviate from the exact posterior. RANDA, which samples a different set of points at each iteration to estimate the KL, provides the closest approximation to the true posterior among the tested methods. However, all approximate methods exhibit some degree of overfitting to the points used for KL estimation, behaving wildly in regions where points are not sampled.
5. Conclusion
Our findings suggest that while function-space VI is intuitively appealing, it faces significant mathematical hurdles. The "infinite KL" problem necessitates workarounds that can lead to quantifiable overfitting. Future research should focus on developing well-defined objectives for function-space inference and improving implicit inference techniques to bridge the gap between approximate and exact posteriors.
Summary updated