Learning identity vs. learning zero: what a shortcut changes about the target

One block, two wirings, the same random weights. The plain block H(x) must be taught to copy its input; the residual block x + F(x) copies it as soon as F is zero. Press Train, then switch to weight decay only. Drag view step to replay a run. Equivalent init starts the two blocks as the same function (the residual block gets four extra relu units wired to −x, since x = relu(x) − relu(−x)): then, without decay, they learn the identity about equally fast, and only decay tells them apart.

A plain block and a residual block, each drawn as a warp of the plane, learning the identity Left, the plain block H(x) = B relu(A x) drawn as the image of a square grid and of 49 colored points; middle, the residual block x + B relu(A x) with the same A and B. A faint square grid shows the target, the identity. Right, each block's distance from the identity plotted against training steps on a log scale.
init scale
view step 0

The tug of war. Each step is the sum of two pulls: the objective’s, toward the identity, and weight decay’s, toward zero weights. Below, at every point, is what one step of each would do to the block’s output: green for the objective, red for decay (shown whether or not decay is switched on). Each color is scaled on its own, since one pull can be far weaker than the other; look at the directions.

The objective's pull and weight decay's pull on each block's outputs Left and middle: the outputs of the plain and residual blocks at the viewed step, each with a green arrow for how one step of the objective would move it and a red arrow for how one step of weight decay would move it. In the plain block the red arrows point toward the origin, against the green ones; in the residual block they point the same way. Right: the agreement between the two pulls over training for each block, from plus one, pulling together, to minus one, a tug of war.

Thirty blocks deep: a flow, or a scramble

Two spirals pushed through thirty random blocks, with and without shortcuts Left, two interleaved spirals after a chosen number of random plain blocks; middle, the same points after the same number of residual blocks built from the same random weights, each adding a small fraction of its output to its input. Right, the share of each point's five nearest neighbours that are still its neighbours, plotted against depth for both.
after block residual branch scale α