After a forward pass produces a prediction and a loss, backpropagation applies the chain rule of calculus backwards through the layers to obtain the gradient of the loss with respect to every weight. An optimizer such as gradient descent or Adam then nudges each weight in the direction that lowers the loss.

The method was popularized for multi-layer networks in a 1986 Nature paper by Rumelhart, Hinton and Williams and remains how virtually all neural networks are trained.