Artificial intelligence · University
Backpropagation and the chain rule
A computational graph records how intermediate values compose. Forward evaluation computes values; reverse differentiation accumulates gradients.
Prerequisites
Derivatives and computational graphs.
Study notes
Graph
A computational graph records how intermediate values compose. Forward evaluation computes values; reverse differentiation accumulates gradients.
Chain rule
For L depending on y and y on x, dL/dx=(dL/dy)(dy/dx). Branching paths contribute additively.
Backpropagation
Reverse-mode differentiation efficiently computes a scalar loss gradient with respect to many parameters. It is differentiation, not the optimizer update itself.
Diagnostics
Check shapes, signs and numerical derivatives on small examples. Saturation, poor scaling and depth can affect gradient propagation.
Worked examples
If y=3x and L=y², find dL/dx at x=2.
y=6, dL/dy=12 and dy/dx=3, so the product is 36.
36
For L=(wx−y)², x=2,y=1,w=1, find dL/dw.
2(wx−y)x=2(2−1)2=4.
4
Check your understanding
What does backpropagation primarily compute?
- Only a random architecture
- Gradients through a computational graph
- New labels from nothing
- A guarantee of a global minimum
At a branching node, contributions from multiple downstream paths are combined how?
- They are added
- They are always multiplied together
- They are discarded
- Only the first is kept always
Two independent path contributions to a parameter gradient are 3 and −1. Find total gradient.
Why should an implementation keep differentiation separate from parameter updates?
Answers and marking guidance
Answers and marking notes
- Gradients through a computational graph
An optimizer subsequently uses gradients to update parameters.
- They are added
The total derivative sums path contributions.
- 2
3+(−1)=2.
- The gradient specifies local sensitivity; the update rule controls how it is used. Separation improves correctness, testing and optimizer flexibility.
Credit distinct responsibilities.
Further reading and review references
These are reference links, not copied exercises, institutional endorsement or proof of independent review.
AI-assisted preview; independent educational review required. Level labels describe prerequisites, not accreditation or official curriculum alignment.