Skip to content

Backpropagation

Also called: backprop, backward propagation of errors

Published:

How does backpropagation work?

The name is short for "backward propagation of error" [1]. There are two passes. In the forward pass, data moves through the network layer by layer to produce a prediction; since the weights start out random, early predictions are usually poor, and a loss function measures the gap to the true value [1]. The backward pass starts at the output layer and works back, layer by layer, to the input, finding how much each parameter contributed to the error [1]. Because a neural network is a chain of nested functions, this relies on the chain rule from calculus. The result is a vector of partial derivatives: the gradient of the loss [1].

How does it relate to gradient descent?

Backpropagation computes the gradient; gradient descent uses it to nudge each weight in the direction that lowers the loss [1]. Google calls backpropagation the most common training algorithm for neural networks, the thing that makes gradient descent workable for multi-layer networks, and notes that libraries such as Keras handle it for you [2].

Why is it so efficient?

IBM's example: for a model with a million weights, testing each weight's effect by brute force would take around 1,000,001 forward passes. Backpropagation gets the same information from one forward and one backward pass [1]. The formal algorithm was published in 1986 by David Rumelhart, Geoffrey Hinton and Ronald Williams in "Learning representations by back-propagating errors" [1]. In deep networks, gradients for the layers near the input can shrink towards zero; ReLU activations can help with this vanishing gradient problem [2].

Frequently asked questions

Is backpropagation an optimisation algorithm?

Not on its own. Backpropagation computes the gradient; an optimiser such as gradient descent uses that gradient to update the weights.

Sources

  1. What is Backpropagation? — IBM
  2. Neural Networks: Training using backpropagation (Machine Learning Crash Course) — Google for Developers