A Dual Control Variate for accelerated black-box variational inference

Xi Wang, Tomas Geffner, Justin DomkeAABI 2023 · OpenReview

TL;DR

This paper introduces "Dual Control Variate," a novel technique to significantly reduce the variance of gradient estimators in complex optimization problems common in machine learning, particularly black-box variational inference. By jointly addressing two sources of randomness (data subsampling and Monte Carlo estimation), it achieves faster convergence and more stable training compared to existing methods.

What Problem Does This Paper Address?

Many machine learning models, especially in areas like Bayesian inference and generative models, involve optimizing objectives that are inherently noisy. This noise comes from two main sources: subsampling data (using only a portion of the dataset at each step) and Monte Carlo estimation (approximating expectations with random samples). This "doubly stochastic" nature leads to high variance in gradient estimates, which in turn forces the use of very small learning rates, slowing down the training process considerably. Existing methods for reducing this variance typically address only one of these noise sources, leaving a gap for problems with both.

Methods

The core contribution is the Dual Control Variate (DCV). It builds upon two existing ideas:

  • Approximation-based Control Variates: These methods use a simplified version of the objective function whose gradient expectation can be computed analytically. The difference between the true gradient and this analytical expectation is used to reduce variance.
  • Incremental Gradient Methods: These techniques "recycle" past gradient computations to reduce variance arising from data subsampling.

DCV ingeniously combines these by:

  1. Using an approximation of the objective function (similar to approximation-based methods) to handle the Monte Carlo sampling noise.
  2. Recycling past gradient computations at different data points (similar to incremental gradient methods) to handle the subsampling noise.

This dual approach allows DCV to tackle both sources of randomness simultaneously, leading to a gradient estimator with potentially much lower variance. The paper also provides an algorithm (Algorithm 1) detailing how to implement this dual control variate.

Datasets

The paper evaluates its method on the following datasets:

  • Australian dataset
  • Sonar dataset
  • MNIST
  • Fashion-MNIST (FMNIST)

These are standard datasets used for evaluating machine learning algorithms, particularly in the context of variational inference. No new benchmarks were introduced.

Key Insights and Ideas

  • The Synergy of Dual Variance Reduction: The most significant insight is that addressing both subsampling and Monte Carlo noise jointly is crucial for doubly stochastic problems. Methods that only tackle one source leave substantial variance on the table.
  • DCV's Practicality: Unlike some previous attempts to combine these ideas, the proposed DCV is computationally practical. It avoids the need for a full pass over the dataset for each gradient estimate, which was a limitation of prior incremental gradient methods when applied to doubly stochastic settings.
  • Variance Reduction Translates to Speed: The paper strongly suggests that the substantial reduction in gradient variance directly translates to the ability to use much larger learning rates, leading to a significant speedup in optimization.

Key Results

  • Order of Magnitude Variance Reduction: The dual control variate yields a gradient estimator with variance that is an order of magnitude smaller than naive estimators or approximation-based control variates on black-box variational inference tasks.
  • Faster Convergence: This variance reduction enables significantly faster convergence, as demonstrated by the experimental results. For example, figures show that with higher learning rates, the dual control variate achieves better ELBO values much more quickly.
  • Superiority over Single-Source Methods: DCV consistently outperforms methods that only address Monte Carlo noise (cv estimator) or subsampling noise (inc estimator, where computable).

Limitations and Future Work

  • Approximation Quality: The effectiveness of DCV relies on the quality of the approximation used for the objective function. The paper uses a second-order Taylor expansion, but the performance might depend on how well this approximation captures the true function.
  • Computational Cost of Approximation: While DCV is practical, computing the approximation itself might still incur some overhead, especially if the approximation is complex.
  • Future Work: The paper implicitly suggests that exploring different types of approximations for the objective function could further enhance the performance of DCV. Additionally, applying this technique to a wider range of doubly stochastic optimization problems beyond variational inference could be a fruitful direction.

Summary updated

Abstract

In this paper, we aim at reducing the variance of doubly stochastic optimization, a type of stochastic optimization algorithm that contains two independent sources of randomness: The subsampling of training data and the Monte Carlo estimation of expectations. Such an optimization regime often has the issue of large gradient variance which would lead to a slow rate of convergence. Therefore we propose Dual Control Variate, a new type of control variate capable of reducing gradient variance from both sources jointly. The dual control variate is built upon approximation-based control variates and incremental gradient methods. We show that on black-box variational inference, which can be formulated as a doubly stochastic optimization problem, compared with past variance reduction approaches that take only one source of randomness into account, dual control variate leads to a gradient estimator of significantly smaller variance and demonstrates significantly faster convergence.
BibTeX
@inproceedings{wang2023dual,
  author = {Xi Wang and Tomas Geffner and Justin Domke},
  title = {{A Dual Control Variate for accelerated black-box variational inference}},
  booktitle = {AABI},
  year = {2023},
  url = {https://openreview.net/forum?id=3c5YBeZ06X},
}
Figure