Answers · The mathematics underneath
Why do derivatives multiply along a chain but add when the path splits?
In shortAlong a chain each step scales the effect that arrived, so the scalings multiply; at a split each use contributes its own effect to the same change, so the contributions add.
Derivatives multiply along a chain because each operation scales the same small disturbance in turn, and successive scalings compose by multiplication. They add across a split because a small change at the shared value reaches the end by several separate routes, and the total effect is the sum of those routes' effects.
Along a chain
Let feed , let feed , and let feed the loss . A small change first changes by . The second operation sees that change in and scales it again, producing . The final operation scales once more, so . Divide by and the three local factors multiply. Each factor is local: it knows only its own operation, not the rest of the graph.
Take local factors at , at , and at . Start at the loss with derivative . The third operation leaves ; the second leaves ; the first leaves . The same product is . A factor below one shrinks the signal, a factor above one magnifies it, and both happen in the same chain. The product can become very small or very large simply because many factors are multiplied; that is arithmetic, not a separate failure mode.
Where the path splits
Let be used by two operations, one producing and one producing , and let both and affect . A small changes by and by . The effect on through is ; the effect through is . Because these are two first-order changes to the same , their sum is the first-order change in . Divide by and the two terms add.
With and , the first route contributes . With and , the second route contributes . The total is . If the second term is omitted, the derivative is , too small by .
The add rule is also why sharing a parameter does not make its derivative smaller. If the same weight is used in several places, each use contributes a term; the gradient is the total of those terms. It is the forward value that was shared, not the derivative. The derivative is accumulated, not divided.
The natural guess is that a split should force a choice: take the largest path, average the paths, or follow one route. That fails because the derivative is a linear approximation. For the same infinitesimal , both uses change, and neither is selected. The two effects are separate first-order terms, so they add. Multiplication along a chain is not a different rule; it is the same linear approximation applied twice, where the output of one scaling becomes the input of the next. A common hand-written error is to miss a branch term. No error is raised; the gradient is simply too small in that direction.
Where it stops
This is first-order calculus. If the functions are not differentiable, or a branch is a hard switch that does not respond locally, its term is zero rather than a small contribution; for a maximum, the inactive side contributes nothing locally. For a finite change rather than an infinitesimal one, cross terms and curvature appear and the simple sum of first derivatives is no longer exact. It is exact in the limit of small changes, which is the sense in which a derivative is a coefficient.
Worth keeping
- Along a chain, the derivative is a product because each operation scales the change that arrives before passing it on.
- At a branch, the derivative is a sum because the same change travels through each use separately and all those effects count.
- Missing one branch term does not raise an error; it silently makes the gradient too small in that direction.
Where this goes next
This question is one step of Backpropagation in Full, a course that works through its subject from the beginning. The page that teaches this part of it is Composing Derivatives, and it reads the whole way through whether or not you have an account.
What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.
Read that pageThe whole courseOther questions people ask about this
- Why does backpropagation never build the full Jacobian?Backpropagation only needs a vector multiplied by each layer's derivative matrix, so it computes that product directly and never builds the matrix.
- Why does softmax followed by cross entropy have gradient p minus y?Because the derivative of the loss through softmax simplifies to the predicted probability minus the target, one number per class, with the exponentials and fractions cancelling out.
- What does a computation graph actually let you differentiate?It lets you differentiate a final number with respect to any earlier value in the graph by multiplying local derivatives along each route and adding across routes.
- Why does adding a shortcut connection stop gradients from vanishing?A shortcut gives the gradient a route whose factor is one plus the layer's own factor, so many layers in series no longer multiply the signal down to nothing.
- What is the difference between variance and standard deviation?They measure the same spread: variance is the average squared distance from the mean, standard deviation is its square root, so you report the standard deviation and calculate with the variance.
- How do you make a vague claim precise enough to tell whether it's true?Fix what is being talked about, what is asserted, which cases are covered and the cut-off, then name an observation that would prove it false.