The back-propagation algorithm is the method neural networks use to learn: it passes the prediction error backward through the layers to work out how much each weight contributed, so the weights can be adjusted to reduce the error. It is the standard way to compute the gradients that training needs.
This page is for technical and business leaders who want a plain explanation. It covers the steps, how back-propagation differs from gradient descent, common problems and how it relates to AI agents.
What is the back-propagation algorithm?
The IBM overview of neural networks says back-propagation is the method a network uses to minimise loss: the error is propagated backward through the network, and weights and biases are then updated with an optimisation method such as gradient descent. IBM calls the pairing the engine that makes neural networks work.
The idea is simple. A network starts with random weights, so its first predictions are usually far from the right answer. Back-propagation works out how much each weight contributed to that error, so every weight can be nudged in the direction that reduces it.
How does back-propagation work step by step?
- Initialise the weights with small random values.
- Run a forward pass: the input moves through the layers to produce a prediction.
- Compute the loss, which measures the gap between the prediction and the known answer.
- Run the backward pass: compute the gradient of the loss with respect to each weight, layer by layer, from the output back to the input.
- Update each weight a small step against its gradient. The size of the step is the learning rate.
- Repeat over many examples until the validation error stops improving.
The Deep Learning book chapter on feedforward networks explains that back-propagation applies the chain rule of calculus in a specific order of operations that is highly efficient, because it avoids recomputing shared subexpressions. Our entry on deep neural networks shows where this step sits in the wider training loop.
Is back-propagation the same as gradient descent?
No, and the two are often confused. The same book states that back-propagation refers only to the method for computing the gradient. A separate optimiser, such as stochastic gradient descent, uses those gradients to learn.
| Term | What it does | Question it answers |
|---|
| Forward pass | Produces a prediction from the inputs | What does the model predict? |
| Loss function | Measures the error | How wrong is the prediction? |
| Back-propagation | Computes the gradient for every weight | Which weights caused the error, and by how much? |
| Gradient descent | Updates the weights using the gradients | How should each weight change? |
What can go wrong with back-propagation?
Gradient-based training is sensitive to its settings. A learning rate that is too large can overshoot the best weights, while one that is too small makes training slow. In very deep networks gradients can shrink or grow as they pass back through many layers, which makes early layers hard to train. Training for too long can also overfit the training data. Practical safeguards include a held-out validation set, early stopping and careful weight initialisation.
How does back-propagation relate to AI agents?
Back-propagation happens at training time, before an agent runs. The models that many AI agents rely on, including large language models, are trained this way. Once deployed, the agent does not learn from each action unless the model is retrained, so the model version, its training data and the decisions it influenced should be recorded. ElixirClaw is XenonStack's AI agents computing platform for building and running agents that use trained models.
What should you do first?
- Confirm whether you need to train a model or can use a pre-trained one.
- Split your data into training, validation and test sets before any training.
- Monitor training and validation loss together.
- Tune the learning rate first, as it has the largest effect on training.
- Record the data, settings and version of every model you release.
To map one decision your agents make using a trained model, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions
What is back-propagation in simple terms?
It is the way a neural network works out how much each weight contributed to an error, by passing the error backward from the output to the input, so that the weights can be corrected.
Why is it called back-propagation?
Because the error signal travels backward through the network, from the output layer towards the input layer, after a forward pass has made a prediction.
What is the difference between back-propagation and gradient descent?
Back-propagation computes the gradients. Gradient descent, or another optimiser, uses those gradients to update the weights.
What is the vanishing gradient problem?
In very deep networks the gradients can become very small as they pass back through many layers, so the early layers learn slowly or not at all.
Do AI agents use back-propagation while they run?
Usually not. Back-propagation is part of training the underlying model. A deployed agent calls the trained model and does not update its weights unless the model is retrained.