A residual block outputs F(x) + x: the layers learn the residual change, and the input is added back through a skip connection.
Gradients flow directly through the identity path, which eases vanishing gradients and lets networks reach hundreds of layers.
Very deep plain networks actually trained worse than shallower ones (the degradation problem); residual learning fixed that, since the block can easily learn an identity mapping.
The same idea appears in every transformer block.
Loading…