02

Local slopes, global consequences

At each operation, multiply the sensitivity arriving from the loss by a derivative of that operation.

What a derivative says

A derivative is a local sensitivity. Writing ∂L/∂w=−1.5\partial L/\partial w=-1.5 means that a tiny increase in ww, with other parameters fixed, changes loss at about −1.5 times that increase. It is neither a weight value nor a command to add −1.5.

ΔL≈∂L∂w Δw\Delta L\approx \frac{\partial L}{\partial w}\,\Delta w

For Δw=0.001\Delta w=0.001, the first-order estimate is ΔL≈−0.0015\Delta L\approx-0.0015. This approximation concerns sufficiently small changes in a differentiable region; it is not an exact finite-step promise. BP-C15

We use compact notation: qˉ=∂L/∂q\bar q=\partial L/\partial q. Read “q-bar” as the sensitivity of the loss to q. It is an intermediate derivative, often called an adjoint; it is not the forward value qq.

Multiply along a route

Suppose r=f(q)r=f(q), and the loss depends on rr. The chain rule connects the small operation’s derivative to the loss:

qˉ=rˉ ∂r∂q\bar q=\bar r\,\frac{\partial r}{\partial q}

Seed the calculation with Lˉ=1\bar L=1: the sensitivity of LL to itself is one. For L=e2/2L=e^2/2, the local derivative is ee. Thus eˉ=1(−0.5)=−0.5\bar e=1(-0.5)=-0.5. Since e=y^−ye=\hat y-y, its derivative with respect to y^\hat y is one, so y^ˉ=−0.5\bar{\hat y}=-0.5.

BP-F02 · Follow the scalar loss backward
OperationLocal slopeLoss sensitivity
L=e2/2L=e^2/2∂L/∂e=e\partial L/\partial e=eeˉ=−0.5\bar e=-0.5
e=y^−ye=\hat y-y∂e/∂y^=1\partial e/\partial\hat y=1y^ˉ=−0.5\bar{\hat y}=-0.5
y^=a+d+c\hat y=a+d+c1 for each inputaˉ=dˉ=cˉ=−0.5\bar a=\bar d=\bar c=-0.5

At the addition y^=a+d+c\hat y=a+d+c, each local derivative is one. Each branch receives the same incoming sensitivity, −0.5. The forward sum does not divide it between its inputs. At multiplication a=vha=vh, the local derivative with respect to vv is hh; with respect to hh it is vv.

vˉ=aˉ h=−0.5(1)=−0.5\bar v=\bar a\,h=-0.5(1)=-0.5
hˉvia a=aˉ v=−0.5(1)=−0.5\bar h_{\text{via }a}=\bar a\,v=-0.5(1)=-0.5

The official autograd explanation describes reverse-mode differentiation as applying the chain rule over recorded operations. BP-C01–02

Keep the two derivatives separate

The local derivative ∂a/∂h=v=1\partial a/\partial h=v=1 says how aa changes with hh. The loss sensitivity contributed through that branch is aˉ v=−0.5\bar a\,v=-0.5. Forgetting the incoming factor confuses an operation’s behavior with its effect on the objective.

There is another issue: hh also changes the second branch. We have found one contribution, so we are not ready to propagate backward through ReLU yet.