A chain of small calculations #

Suppose a network estimates travel time from distance and weather. An early layer combines the inputs into intermediate quantities. A later layer uses those quantities to make the prediction. The training example supplies an observed journey time, and a loss function measures the prediction error. The difficulty is assigning responsibility for that error to a weight several layers away from the output.

A derivative answers a local question. If a single weight changes by a very small amount, how quickly does the loss change? The chain rule combines the derivative at each stage along the path from that weight to the loss. Backpropagation organizes this calculation so that many weights can reuse the same downstream derivatives.

Section sources [1]

Working a derivative by hand #

Take a network with one input x, a hidden value h = wx, and output y = vh. Set x = 3, w = 2 and v = 4. The network predicts 24. If the target is 20 and the loss is half the squared error, the derivative of loss with respect to y is 4. The derivative with respect to v is then 4 × h, or 24. For w, the same error signal travels through two multiplications, giving 4 × v × x = 48.

These numbers describe the slope at the present weights. An optimizer decides how far to step. Updating both weights by their full derivatives would produce a very different network, and the local slope would cease to describe its behavior. Learning-rate choices and repeated evaluation are part of the training procedure.

Section sources [1]

How hidden units acquire useful features #

In their influential 1986 paper, David Rumelhart, Geoffrey Hinton and Ronald Williams showed how training hidden units by propagating errors could produce useful internal representations. A training example specifies what the network should output. The hidden units can learn an intermediate coding that serves many examples without a designer labeling the desired state of every hidden unit. This is part of the historical connection between backpropagation and representation learning.

Section sources [1]

Why depth complicates learning #

A backwards path through many layers involves repeated products. Small derivatives can shrink a signal until an early weight receives a tiny adjustment. Large factors can amplify it. In recurrent networks the same difficulty can span many time steps. Bengio, Simard and Frasconi analyzed why distant dependencies are hard to learn by gradient descent. Glorot and Bengio later examined how initialization and activation functions affect the propagation of signals through deep feedforward networks. A correctly computed derivative can still give an optimizer a difficult problem.

Section sources [2] [3]

Exchanging memory for a second forward pass #

A backward pass needs intermediate values from the forward computation. One choice is to keep them all until their derivatives have been calculated. Checkpointing keeps selected values and recomputes missing ones when needed. Consider a simple chain of 100 equal-cost layers with equally sized intermediate states. Saving the output of every tenth layer allows a training program to reconstruct one short segment at a time. The extra work comes from revisiting those layers. Parameters, gradients and temporary arrays still need storage.

Tianqi Chen and colleagues reported that their method reduced the memory cost of training a 1,000-layer residual network in an ImageNet experiment from 48 GB to 7 GB, with about 30 percent additional running time. The method changes when values are stored and recomputed. The derivative being requested is the same. The measured trade-off consequently depends on the layer structure, the implementation and the hardware.

Section sources [4]

Sources

  1. David Rumelhart, Geoffrey Hinton and Ronald Williams, Learning representations by back-propagating errors (1986) doi.org
  2. Xavier Glorot and Yoshua Bengio, Understanding the difficulty of training deep feedforward neural networks (2010) proceedings.mlr.press
  3. Yoshua Bengio, Patrice Simard and Paolo Frasconi, Learning long-term dependencies with gradient descent is difficult (1994) doi.org
  4. Tianqi Chen and colleagues, Training Deep Nets with Sublinear Memory Cost (2016) arxiv.org