Quantized Variational Inference

Amir DibNeurIPS 2020

TL;DR

This paper introduces Quantized Variational Inference (QVI), a method that replaces noisy Monte Carlo sampling with deterministic "Optimal Quantization" to optimize the Evidence Lower Bound (ELBO). By using Voronoi tessellations to represent probability distributions, QVI produces variance-free gradients, leading to significantly faster convergence at the cost of a small, controllable bias.

What Problem Does This Paper Address?

In Bayesian machine learning, we often need to approximate a "posterior distribution"—the updated belief about latent variables $z$ after seeing data $y$. Variational Inference (VI) turns this into an optimization problem: find a simple distribution $q$ that is as close as possible to the true posterior by maximizing the Evidence Lower Bound (ELBO).

The standard way to solve this is using Stochastic Gradient Descent (SGD) with the "reparameterization trick." This relies on Monte Carlo (MC) sampling, which is unbiased but suffers from high variance. High variance means the optimizer "jitters" around, requiring smaller step sizes and more iterations to converge. While techniques like Quasi-Monte Carlo or control variates help, they don't eliminate the fundamental noise of sampling.

Methods

The author proposes a shift from stochastic sampling to deterministic approximation using Optimal Quantization (OQ).

Comparison of sampling methods: Monte Carlo, Randomized Quasi Monte Carlo, and Optimal Quantization.
  1. Optimal Voronoi Tessellation: Instead of drawing random samples, OQ finds a finite set of $N$ points (a "grid") that best represents a continuous distribution. This grid divides the space into Voronoi cells. Each point in the grid is assigned a weight based on the probability mass of its cell.
  2. Quantized Variational Inference (QVI): The paper replaces the MC expectation in the ELBO with a weighted sum over these optimal points. Because the points and weights are deterministic, the resulting gradient is variance-free.
  3. Efficiency via Invariance: Calculating optimal grids is expensive. However, for common distributions like the Gaussian, an optimal grid for a "standard" version ($\mathcal{N}(0, I)$) can be simply shifted and scaled. This allows the algorithm to use pre-computed grids, making it computationally competitive with standard VI.
  4. Richardson Extrapolation (RQVI): Quantization introduces a systematic bias (the grid is never a perfect representation of the continuous space). To fix this, the author applies Richardson extrapolation—a numerical technique that combines results from two different grid sizes ($N$ and $M$) to cancel out the leading error terms, effectively sharpening the approximation.

Key Insights and Ideas

  • Embracing Bias for Speed: The core philosophy is that in many practical scenarios—like quick model selection—a slightly biased but extremely fast estimate is more valuable than a slow, noisy, unbiased one.
  • The "Variance-Free" Advantage: By eliminating gradient variance, the optimizer can take much more stable paths toward the optimum. The expected gradient norm for QVI drops smoothly and rapidly compared to the "cloud" of noise seen in Monte Carlo methods.
  • Pessimistic Bounds: Under certain conditions (convexity), the quantized ELBO is guaranteed to be lower than the true ELBO. This makes it a "safe" estimate for model evaluation, as it won't over-promise on model performance.

Key Results

The method was evaluated on several real-world regression and classification tasks, including Bayesian Linear Regression (Boston Housing, Forest Fires, Life Expectancy), a Poisson Generalized Linear Model (NYC "Frisk" dataset), and a Bayesian Neural Network (Metro dataset).

Convergence plots showing ELBO and gradient norm over time for various datasets. QVI and RQVI demonstrate faster, lower-variance convergence.
  • Faster Convergence: Across all datasets, QVI converged significantly faster than vanilla Monte Carlo VI (MCVI). In the Bayesian Neural Network experiment (Metro dataset), QVI reached a stable solution in roughly 100 seconds, whereas MCVI took nearly 500 seconds.
  • Superior to Baselines: QVI consistently outperformed Randomized Quasi-Monte Carlo (RQMC), which is currently considered a strong baseline for reducing VI variance.
  • Bias Reduction: While QVI showed relative biases (e.g., 13% on the Boston dataset), the RQVI (Richardson version) successfully reduced that bias (down to 7% for Boston) while maintaining a speed advantage over sampling.

Limitations and Future Work

  • The Curse of Dimensionality: Optimal quantization is theoretically most effective in lower dimensions (typically $d < 10$). While the author demonstrated success on a 60-parameter BNN, the efficiency of quantization generally degrades as the number of dimensions increases.
  • Numerical Instability: The paper notes that Richardson extrapolation can become computationally unstable in very high dimensions, and there is no "one-size-fits-all" method for choosing the optimal scaling factor $\gamma$.
  • Future Directions: The author suggests applying this framework to more complex models like Variational Autoencoders (VAEs) or Normalizing Flows, where sampling is currently the primary bottleneck.

Summary updated

BibTeX
@inproceedings{dib2020quantized,
  author = {Amir Dib},
  title = {{Quantized Variational Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure