Architecture / Blocks
verifiedResidual Connection
Instead of asking a layer to produce its output from scratch, a residual connection asks it only for the change, and adds that to what came in. A layer with nothing useful to contribute can output approximately zero and do no harm, which is what makes stacking a hundred of them survivable.
Output x + F(x) rather than F(x). The addition gives the gradient an unobstructed path to every earlier layer — it flows through the identity term whatever F does — which is what removes the degradation that made very deep plain networks train worse than shallow ones. In a transformer, every attention and feed-forward sub-layer sits inside one.
y = x + F(x), so ∂y/∂x = I + ∂F/∂x. The identity term keeps the Jacobian away from zero regardless of F's own gradient, so the product across L layers does not decay geometrically. This is the mechanism behind trainability at depth, not merely an optimisation trick.
8 values. The left group decays steeply; the right group is 70% of the way to flat, and reads flatter than the left.
Gradient magnitude reaching each layer, without the residual path and with it. Drag the depth to watch the unaided signal decay while the residual one holds.
Reviewed by opendroid · 2026-08-04
- arXiv:1512.03385 — Deep Residual Learning for Image Recognition
- arXiv:2002.04745 — On Layer Normalization in the Transformer Architecture