Variance Reduction in SGD by Distributed Importance Sampling

Guillaume Alain, Alex Lamb, Chinnadhurai Sankar, Aaron C. Courville, Yoshua BengioarXiv 2015

TL;DR

This paper introduces a novel distributed training method for deep learning called Importance Sampling SGD (ISSGD). By having dedicated "workers" identify the most informative training examples and a central "master" updating the model using importance sampling, ISSGD significantly reduces gradient variance and speeds up training compared to standard distributed SGD.

What Problem Does This Paper Address?

Training large deep learning models requires massive computational resources, often necessitating distributed training across multiple machines. While Asynchronous Stochastic Gradient Descent (ASGD) is a common approach, it suffers from high communication bandwidth requirements and theoretical guarantees are often lost due to "stale" gradients. This paper addresses the challenge of efficient and stable distributed training by proposing a method that focuses computational effort on the most informative data points, inspired by how humans learn.

Methods

The core of the proposed method, Importance Sampling SGD (ISSGD), involves a distributed system with a "master" and multiple "workers."

  • Workers: These machines are responsible for searching the training dataset and identifying the most "informative" examples. They achieve this by computing the L2-norm of the gradient for each individual training sample. This norm serves as a measure of how much a particular sample would change the model's parameters.
  • Master: This machine updates the model's parameters. Crucially, it uses importance sampling to select minibatches for training. The probability of selecting a training sample is proportional to the L2-norm of its gradient (computed by the workers). This ensures that samples with larger gradients, which are more informative, are sampled more frequently.
  • Variance Reduction: The theoretical foundation of ISSGD lies in importance sampling, which aims to minimize the variance of the gradient estimate. The paper shows that the optimal sampling proposal is proportional to the L2-norm of the gradient. By using this proposal, ISSGD achieves a lower gradient variance compared to uniform sampling.
  • Distributed Implementation: The system is designed to minimize communication overhead. Instead of sending full gradients, workers only send the computed L2-norms of individual gradients. This significantly reduces bandwidth requirements compared to ASGD. The paper also discusses strategies for handling "stale" probability weights, where workers might not have the absolute latest model parameters when computing gradient norms.

Datasets

The paper uses the Street View House Numbers (SVHN) dataset, specifically the cropped version (SVHN-2), which contains approximately 600,000 32x32 RGB images of house number digits. For evaluation, they used a randomly split 5% validation set and tested on the remaining data. The task was a permutation-invariant version of SVHN, which forces the model to discard spatial structure and is commonly used for studying fully connected neural networks.

Key Insights and Ideas

  • Learning from Informative Examples: The paper draws an analogy to human learning, where focusing on challenging or informative material accelerates understanding. ISSGD applies this principle to deep learning by prioritizing samples that yield larger gradients.
  • L2-Norm as Informative Measure: The L2-norm of the per-example gradient is identified as a key indicator of a sample's informativeness. This provides a concrete, computable metric for guiding the importance sampling process.
  • Reduced Communication Overhead: By only communicating gradient norms instead of full gradients, ISSGD offers a significant advantage in bandwidth-constrained distributed training scenarios.
  • Theoretical Guarantees for Variance Reduction: The paper provides theoretical backing for why importance sampling proportional to the L2-norm of the gradient minimizes variance, even in high dimensions.
  • Robustness to Stale Weights: The experimental setup and discussion acknowledge that in a real distributed system, probability weights might not be perfectly up-to-date. The paper shows that the method remains effective and stable even with some degree of staleness.

Key Results

  • Faster Training: Experiments show that ISSGD consistently minimizes training loss faster than regular SGD, often reaching near-zero loss significantly quicker.
  • Comparable Prediction Error: While ISSGD converges faster, the final test prediction error is comparable to regular SGD, with some setups showing slight advantages for ISSGD.
  • Variance Reduction Demonstrated: Figure 4 visually demonstrates that ISSGD achieves a lower trace of the covariance matrix (Tr(Σ(q))), indicating reduced gradient variance, especially when using a smaller learning rate and smoothing constant.
  • Efficiency Gains: The method is shown to be effective even with a limited number of workers (3 in their experiments), suggesting scalability.

Limitations and Future Work

  • Model Limitations: Proposition 1, which provides a compact formula for per-example gradient norms, currently only applies to fully-connected layers. It does not directly work for convolutional neural networks (CNNs) or recurrent neural networks (RNNs) due to parameter sharing and sparsity.
  • Future Work - CNNs/RNNs: The authors suggest exploring approximate formulas for gradient norms in convolutional layers or ignoring their contributions, though this might reduce the quality of importance sampling.
  • Future Work - ASGD Combination: The paper acknowledges that much successful distributed deep learning uses Asynchronous SGD (ASGD). They propose investigating how ISSGD could be combined with ASGD to potentially achieve synergistic benefits or identify conflicts.
  • Future Work - Adaptive Smoothing: The paper mentions exploring adaptive methods for computing the smoothing constant for probability weights, which was not fully investigated due to hyperparameter complexity.

Summary updated

BibTeX
@misc{alain2015variance,
  author = {Guillaume Alain and Alex Lamb and Chinnadhurai Sankar and Aaron C. Courville and Yoshua Bengio},
  title = {{Variance Reduction in SGD by Distributed Importance Sampling}},
  year = {2015},
  eprint = {1511.06481},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1511.06481},
}
Figure