Skip to main content
QUICK REVIEW

[Paper Review] A Study of Gradient Variance in Deep Learning

Fartash Faghri, David Duvenaud|arXiv (Cornell University)|Jul 9, 2020
Domain Adaptation and Few-Shot LearningComputer Science42 references13 citations
TL;DR

This paper investigates gradient variance in deep learning, proposing Gradient Clustering (GC) to minimize variance by sampling from weighted clusters in gradient space. It finds that gradient variance increases during training—contrary to assumptions—and introduces normalized gradient variance as a better predictor of convergence speed, with GC significantly reducing variance when duplicates exist in data.

ABSTRACT

The impact of gradient noise on training deep models is widely acknowledged but not well understood. In this context, we study the distribution of gradients during training. We introduce a method, Gradient Clustering, to minimize the variance of average mini-batch gradient with stratified sampling. We prove that the variance of average mini-batch gradient is minimized if the elements are sampled from a weighted clustering in the gradient space. We measure the gradient variance on common deep learning benchmarks and observe that, contrary to common assumptions, gradient variance increases during training, and smaller learning rates coincide with higher variance. In addition, we introduce normalized gradient variance as a statistic that better correlates with the speed of convergence compared to gradient variance.

Motivation & Objective

  • To understand the distribution of gradients during deep learning training, especially its structure and impact on optimization.
  • To investigate how factors like learning rate, batch size, model architecture, and data distribution affect gradient variance.
  • To develop a method that reduces variance in mini-batch gradient estimates by exploiting clustering in gradient space.
  • To evaluate whether gradient variance and its normalized form correlate better with training speed and generalization than standard variance.
  • To explain counterintuitive phenomena such as loss drops after learning rate decay and SVRG failure in deep networks.

Proposed method

  • Proposes Gradient Clustering (GC), a method that clusters gradients in parameter space and samples from weighted clusters to minimize average mini-batch gradient variance.
  • Proves theoretically that variance of the average mini-batch gradient is minimized when samples are drawn from a weighted clustering in gradient space.
  • Introduces normalized gradient variance as a statistic that better correlates with convergence speed than raw gradient variance.
  • Employs stratified sampling based on gradient clustering to improve gradient estimate stability and reduce variance.
  • Applies GC to real benchmarks (MNIST, CIFAR-10, ImageNet) and synthetic random features models to measure variance dynamics.
  • Uses controlled experiments with duplicated data points to test GC’s effectiveness in reducing variance under data redundancy.

Experimental results

Research questions

  • RQ1Does the gradient distribution in deep learning exhibit structural modes, such as clustering?
  • RQ2How does gradient variance evolve during training, and does it depend on learning rate or batch size?
  • RQ3Can exploiting gradient clustering reduce variance in mini-batch gradient estimates more effectively than standard sampling?
  • RQ4Does normalized gradient variance correlate more strongly with convergence speed than standard gradient variance?
  • RQ5Why do loss drops occur immediately after learning rate decay, and how does gradient noise relate to this?

Key findings

  • Gradient variance increases during training, contradicting the common assumption that it decreases over time.
  • Smaller learning rates are associated with higher gradient variance, suggesting a counterintuitive trade-off in optimization stability.
  • Normalized gradient variance correlates more strongly with convergence speed than standard gradient variance, making it a better diagnostic tool.
  • Gradient Clustering (GC) significantly reduces gradient variance when data contains duplicates, especially in overparametrized regimes.
  • GC performs comparably to double-batch SGD (SG-2B) in mild overparametrization but outperforms standard SGD (SG-B) in variance reduction.
  • The failure of SVRG in deep learning is likely due to low intrinsic noise variance in overparametrized regimes, not staleness of control variates.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.