Why a skip connection cannot lose the gradient
proof▲▲▲For a residual block , derive the Jacobian and then the adjoint recurrence for a stack of such blocks. Show that the product cannot vanish for want of a route, and state precisely what the identity term does and does not guarantee.
Hint
Differentiate the sum term by term. One of the two derivatives does not depend on at all.
Solution
The Jacobian. Differentiating coordinate by coordinate:
which is (I.6.5).
The recurrence. By (I.6.2) the adjoint entering block from block is
Across the stack. Expanding the product over blocks:
Multiplying out gives terms, one for each subset of blocks whose is taken. Exactly one of those terms takes the identity from every block:
The adjoint that left the loss arrives at the first block undiminished, whatever the are and however many there are. In the plain stack of I.6.B04 every term carried a factor below , so the whole product decayed; here one term carries no factor at all.
What this does not promise. Three things.
It is not a guarantee that the gradient is useful. The identity path transmits the adjoint of the loss with respect to the block’s input, not with respect to its parameters — the parameter gradients still flow through , and a block whose is saturated still learns nothing. The signal reaches it; whether it can act on it is separate.
It does not prevent explosion. has eigenvalues , and if has eigenvalues near the product grows like . Residual stacks are normally paired with normalisation for exactly this reason, and the pairing is not decoration.
It says nothing about optimisation beyond the gradient’s magnitude. A route for the adjoint is a necessary condition for training a deep stack, not a sufficient one, and the empirical fact that residual networks train at depths plain stacks cannot is a result rather than a corollary of this algebra.