Skip to content

What is Backpropagation?

Backpropagation is an algorithm for training neural networks by calculating how much each weight contributed to the prediction error and adjusting those weights accordingly. It uses the chain rule to efficiently compute gradients of the loss function.

The process starts with a forward pass where input data flows through the network to produce a prediction. The difference between this prediction and the true label is measured by a loss function.

Next, the error is propagated backward through the layers. Using the chain rule from calculus, the algorithm computes the gradient of the loss with respect to each weight, showing how changing that weight would affect the overall error.

These gradients are then used by an optimizer like gradient descent to update the weights, reducing the error on future predictions. This cycle repeats over many training examples.

Example

Imagine training a simple network to classify images as cats or dogs. After guessing 'dog' for a cat photo, backpropagation calculates how much each connection weight influenced that wrong answer and slightly reduces those weights so the network is less likely to repeat the mistake.

Why it matters

Backpropagation is the core mechanism that makes training deep neural networks practical and scalable, powering nearly all modern advances in computer vision, language models, and other AI applications.

Frequently asked questions

No. Backpropagation computes the gradients while gradient descent uses those gradients to update the weights.