A step-by-step hand derivation shows how residual connections power deep nets

ProfTomYeh · x · 2026-07-28

A hand-calculated walkthrough of ResNet and transformer residuals

This post walks through the logic of residual connections by hand, using small matrices and step-by-step examples.

It starts with the classic ResNet idea from Deep Residual Learning for Image Recognition: the identity shortcut lets a block compute F(x) + x, which helps avoid vanishing and exploding gradients and made very deep networks practical.

The walkthrough then applies the same idea inside a transformer:

The post’s takeaway is simple: a small “add” operation is what made much deeper architectures work in practice.

Original post →

More from Research

Research channel →