Abstract
Modern stochastic optimization methods often rely on uniform sampling, which is agnostic to the underlying characteristics of the data. This can degrade convergence by yielding estimates that suffer from high variance. A possible remedy is to employ non-uniform importance sampling techniques that take the structure of the dataset into account. In this work, we investigate a recently proposed setting which poses variance reduction as an online optimization problem with bandit feedback. We devise a novel and efficient algorithm, Variance Reducer Bandit (VRB), that finds a sequence of importance sampling distributions competitive with the best fixed distribution in hindsight. This represents the first theoretical regret guarantee of its kind for this setting. While we present our method for sampling data points, it naturally extends to selecting coordinates or blocks thereof. Empirical validations underline the benefits of our method in several settings, demonstrating up to a 10x speedup in training time.
Introduction
Stochastic Gradient Descent (SGD) is the foundational algorithm for modern machine learning. However, its standard implementation typically treats every data point as equally important through uniform sampling. This "blind spot" can be inefficient; some data points produce significantly larger gradients than others, and sampling these high-impact points more frequently can drastically reduce the variance of the gradient estimate, leading to faster convergence.
While importance sampling techniques exist to address this, they often require prior knowledge of the data or expensive pre-computations. Adaptive sampling—where the distribution changes as the model trains—is a promising alternative, but it has historically struggled with theoretical guarantees. Specifically, previous methods could not prove they were competitive with the "best fixed distribution in hindsight" when receiving only partial (bandit) feedback about the data points that were not sampled.
The Variance Reducer Bandit (VRB) Algorithm
We frame variance reduction as an online optimization problem. In each round, a "player" (the sampler) chooses a probability distribution over the dataset. A sample is drawn, and the "adversary" (the model) updates its weights. Crucially, the player only observes the loss or gradient of the point actually sampled, constituting a bandit feedback loop.
To solve this, we introduce the Variance Reducer Bandit (VRB) algorithm, which utilizes a Follow-the-Regularized-Leader (FTRL) approach with several key innovations:
- Novel Regularizer: We employ a specific regularizer, $\sum 1/p(i)$, which directly matches the mathematical structure of the variance we aim to minimize. Unlike previous methods that used linear approximations (like the EXP3 algorithm), VRB directly optimizes the convex, non-linear variance objective.
- Exploration vs. Exploitation: To handle the bandit setting and prevent costs from exploding, the algorithm mixes the FTRL-suggested distribution with a uniform distribution, controlled by a parameter $\theta$.
- Unbiased Estimation: We construct an unbiased estimate of the squared losses for all points based solely on the feedback from the sampled point, allowing the sampler to learn the importance of unsampled data over time.
Theoretical Contributions
A major contribution of this work is the theoretical justification for using regret as a proxy for optimization. We prove that minimizing "regret" in the sampling space translates directly to better convergence in the original optimization problem. We establish an expected regret bound of $\tilde{O}(n^{1/3}T^{2/3})$, where $n$ is the number of samples and $T$ is the number of rounds. This is the first result of its kind for this specific bandit formulation in stochastic optimization.
Empirical Results
We evaluated VRB across several challenging tasks to test its robustness and efficiency:
- Image Classification: On the Pascal VOC 2007 dataset (using VGG16 features), VRB reached specific precision milestones 10 times faster than standard uniform sampling. This task is particularly suited for adaptive sampling due to significant class imbalance.
- Mini-batch k-Means Clustering: We tested the algorithm on three datasets: CSN (cellphone accelerometer data), KDD Cup 2004 (protein homology), and MNIST.
Our experiments revealed that the benefits of adaptive sampling are highly dependent on the data's structure. On MNIST, where the optimal distribution is nearly uniform, VRB showed no significant advantage. However, on unbalanced or highly structured datasets like CSN and Pascal VOC, the gains were substantial. Furthermore, VRB demonstrated robustness to misspecified hyperparameters, performing well even without perfect tuning of the regularizer.
Discussion and Future Work
While VRB provides a significant step forward, several avenues for future research remain. The $T^{2/3}$ regret bound may not be tight, and future work could investigate if a $T^{1/2}$ bound is achievable. Additionally, while we focused on basic SGD and k-Means, integrating VRB with more complex variance-reduction solvers like SVRG or SAGA could yield further improvements. Finally, there is a practical trade-off to consider: while VRB produces "smarter" steps, the $O(\log n)$ update overhead per step must be balanced against the speedup in convergence to ensure overall wall-clock time reduction.
Summary updated