Variational Bayesian dropout: pitfalls and fixes

Jiri Hron, Alexander G. de G. Matthews, Zoubin Ghahramani

Dropout is a wildly successful regularization technique used to prevent neural networks from overfitting. In recent years, researchers reinterpreted dropout as a form of approximate Bayesian inference—specifically, Variational Inference (VI) in Bayesian Neural Networks. This reinterpretation was exciting because it provided a principled way to extract uncertainty estimates from standard neural networks.

However, this paper exposes critical theoretical flaws in this popular interpretation. Specifically, it highlights the use of improper priors and singular approximating distributions that make standard optimization objectives mathematically undefined. To resolve these issues, the authors introduce Quasi-KL (QKL) divergence, a rigorous mathematical framework that validates existing algorithmic workarounds and surprisingly connects dropout-based approximations to Principal Component Analysis (PCA).

The Flaws in the Foundation

The paper argues that the mathematical foundation of the variational dropout reinterpretation is flawed in two major ways:

1. Pathological Priors Variational Gaussian dropout relies on a "log-uniform" prior to achieve its results. The authors mathematically prove that combining a log-uniform prior with standard neural network likelihoods results in an improper posterior with infinite probability mass, meaning standard Bayesian arguments don't actually apply. They also analyze truncated versions of this prior, proving they are dangerously sensitive to the arbitrary bounds chosen by the user.

Truncated log-uniform prior distribution

2. Singular Distributions Standard dropout methods use approximate posteriors that only exist on specific lower-dimensional subspaces or discrete points (they are "singular"). Because they don't perfectly overlap with the continuous prior, the Kullback-Leibler (KL) divergence—the core metric Variational Inference tries to optimize—is strictly undefined (infinite).

Theoretical Fixes and the Quasi-KL Divergence

To address these foundational issues, the authors take a highly theoretical approach, focusing on mathematical proofs and derivations rather than empirical engineering.

First, they derive a new, exact mathematical expression for the KL divergence used in Variational Gaussian Dropout. This closed-form derivation (using Kummer's and Dawson functions) provides exact gradients for optimization, replacing the approximations used in prior literature. Crucially, it shows that the algorithm actually acts as a penalized maximum likelihood estimator rather than performing true Bayesian inference.

To fix the undefined KL divergence caused by singular distributions, the authors formalize a limit-based approach. By adding Gaussian noise (convolution) or discretizing the space, and then taking the limit as the noise or grid-size shrinks to zero, they derive a well-defined, novel objective called Quasi-KL (QKL) divergence.

Previous researchers had noticed the undefined KL divergence issue and proposed workarounds, like adding continuous noise or discretizing the prior. This paper rigorously proves (via Theorems 4 and 5) that both of these seemingly different "hacks" converge to the exact same mathematical limit: the QKL objective.

Why It Works and the PCA Connection

If the underlying Bayesian math was broken, why did Variational Gaussian Dropout work so well in practice? The authors show that the specific variational formulation accidentally cancels out the pathologies of the true posterior. It works because it is a well-tuned penalized maximum likelihood method, not because of Bayesian Minimum Description Length (MDL) arguments.

Furthermore, the QKL divergence reveals a surprising connection to Principal Component Analysis (PCA). When the authors applied their newly defined QKL divergence to a simple test case—approximating a full-rank Gaussian distribution with a degenerate, lower-dimensional one—the optimal solution naturally recovered the exact algorithm for PCA.

QKL approximation aligning with the principal component of a Gaussian

Proposition 6 mathematically proves that minimizing QKL between a target Gaussian and a degenerate Gaussian perfectly aligns the approximation with the top-$K$ eigenvectors of the target's covariance matrix.

Limitations and Future Work

The authors acknowledge that QKL is not a proper statistical divergence because it is lower-bounded by a constant rather than zero. Furthermore, optimizing QKL with respect to hyperparameters might yield biased estimates. This explains why practitioners often still have to rely on grid search and validation error to tune dropout rates, rather than optimizing the bounds directly.

Looking forward, the authors suggest that QKL is a highly promising framework for designing computationally cheap, optimization-based approximate inference algorithms. Future research will need to explore exactly when QKL is a viable, lightweight alternative to proper but computationally expensive metrics (like Wasserstein distances) that are traditionally used to handle singular distributions.

Summary updated

BibTeX
@inproceedings{hron2018variational,
  author = {Jiri Hron and Alexander G. de G. Matthews and Zoubin Ghahramani},
  title = {{Variational Bayesian dropout: pitfalls and fixes}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
  url = {https://openreview.net/forum?id=HJ-uQsWubB},
}
Figure