Optimization / Training
verifiedBackpropagation
To improve, a model needs to know how much each of its millions of parameters contributed to being wrong. Backpropagation computes that by running the chain rule backwards through the network, reusing each layer's result for the layer before it. Without the reuse the calculation would be hopeless; with it, one backward pass costs about what the forward pass did.
Reverse-mode automatic differentiation over the computation graph. The forward pass stores activations because the backward pass needs them, which is why memory scales with depth and why checkpointing trades recomputation for it. The cost is roughly two forward passes, independent of parameter count.
For y = f sub L (…f sub 1 (x)), ∂L/∂θ sub i = (∂L/∂y)·Π sub j>i (∂f sub j /∂f sub j−1 )·(∂f sub i /∂θ sub i ). Reverse mode evaluates the product right to left so each factor is applied to a vector rather than a matrix, giving cost proportional to outputs rather than to parameters.
8 values. The left group decays steeply; the right group is 70% of the way to flat, and reads flatter than the left.
Gradient magnitude arriving at each layer, at the output and back at the input. Drag the depth to watch the signal attenuate as it travels.
Reviewed by opendroid · 2026-08-04
- arXiv:1502.05767 — Automatic differentiation in machine learning: a survey