Skip to main content
QUICK REVIEW

[Paper Review] Not All Samples Are Created Equal: Deep Learning with Importance Sampling

Angelos Katharopoulos, François Fleuret|arXiv (Cornell University)|Mar 2, 2018
Machine Learning and Data ClassificationComputer Science107 citations
TL;DR

This paper introduces a principled importance sampling scheme for SGD in deep learning that uses an efficiently computable upper bound to per-sample gradient norms to focus computation on informative examples, yielding variance reduction and wall-clock speedups across CNN, RNN, and fine-tuning tasks."

ABSTRACT

Deep neural network training spends most of the computation on examples that are properly handled, and could be ignored. We propose to mitigate this phenomenon with a principled importance sampling scheme that focuses computation on "informative" examples, and reduces the variance of the stochastic gradients during training. Our contribution is twofold: first, we derive a tractable upper bound to the per-sample gradient norm, and second we derive an estimator of the variance reduction achieved with importance sampling, which enables us to switch it on when it will result in an actual speedup. The resulting scheme can be used by changing a few lines of code in a standard SGD procedure, and we demonstrate experimentally, on image classification, CNN fine-tuning, and RNN training, that for a fixed wall-clock time budget, it provides a reduction of the train losses of up to an order of magnitude and a relative improvement of test errors between 5% and 17%.

Motivation & Objective

  • Motivate the inefficiency of uniform sampling in SGD for deep networks and aim to accelerate training by focusing on informative samples.
  • Derive a tractable upper bound to the per-sample gradient norm that can be computed in a single forward pass.
  • Quantify the variance reduction from importance sampling and establish criteria to switch IS on only when beneficial.
  • Provide a simple, generic algorithm that can be plugged into standard SGD training to realize speedups.
  • Validate the approach empirically on image classification, fine-tuning, and sequence classification tasks.

Proposed method

  • Derive an upper bound hat{G}_{i} for the per-sample gradient norm that is computable in a forward pass (equations 13–20).
  • Propose a two-stage sampling scheme: pre-sample a large batch B, compute a distribution proportional to hat{G}_{i}, then sample a smaller batch b from that distribution.
  • Formalize a profitability test to decide when variance reduction justifies IS, using an equivalent batch-size increase tau derived from equation 27.
  • Present Algorithm 1 that switches between uniform sampling and importance sampling based on a threshold tau_th and an exponential moving average for tau.
  • Show that optimal sampling for variance reduction is proportional to the per-sample gradient norm, but use a tractable bound to enable practical implementation.

Experimental results

Research questions

  • RQ1Can a tractable upper bound to per-sample gradient norms be computed efficiently to guide importance sampling in deep networks?
  • RQ2Does importance sampling based on this bound reduce gradient variance and accelerate training under a fixed wall-clock budget across CNNs, RNNs, and fine-tuning scenarios?
  • RQ3When is it beneficial to switch on importance sampling during training, and how can this be reliably detected?
  • RQ4How does the proposed IS scheme compare to loss-based sampling and uniform sampling in terms of training loss and test error under equal time budgets?
  • RQ5What practical guidelines (e.g., pre-sample size B, small batch b, threshold tau_th) yield robust speedups across architectures?

Key findings

  • The upper bound-based IS yields variance reduction closely matching gradient-norm-based sampling, with high correlation to true per-sample gradient norms.
  • On CIFAR10/CIFAR100, the method achieves wall-clock speedups and, in some cases, lower training loss and improved test error compared to uniform or loss-based sampling (e.g., CIFAR100 shows faster convergence and 5%–? improvement in test error).
  • In fine-tuning, the method accelerates convergence and reduces test error relative to uniform sampling within half an hour (e.g., MIT67 dataset results).
  • For pixel-by-pixel MNIST with an LSTM, the method attains lower training loss and better test error within a fixed time budget, whereas loss-based sampling can hurt performance.
  • The algorithm is designed to require only a single line of code replacement to enable importance sampling in standard SGD workflows, and it adapts to changing model parameters during training.
  • The variance reduction can be interpreted as effectively increasing the batch size, with a computable criterion (tau) to ensure speedup.

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.