지난 10 년의 가장 중요한 architecture trick
Residual connection 은 y = x + f(x): block 의 output 이 input 더하기 block transformation. 'Skip' 이 gradient 를 block 의 local Jacobian 곱 없이 depth 통해 흐르게 해. 100-layer network (ResNet) 와 175-billion-parameter transformer (GPT-3 이상) 가 실제 trainable 한 이유.
Residual 전에는 layer 20-30 넘게 추가하면 training 이 나빠졌어. Residual 후에는 depth 가 끝까지 보답. Regularization trick 아니라 — depth-enabler 야.
x + sublayer(x) 보이면 residual connection. Shape 가 일치하는지 spot-check (skip + transform 이 같은 shape 여야). 안 맞으면 skip 에 projection (nn.Linear 또는 stride 있는 nn.Conv2d) 필요.Residual 이 어디 나타나는가
Modern 한 곳 어디나. ResNet (CNN), Transformer (모든 block 에 residual 두 개 — attention 과 FFN), DenseNet (add 대신 concat), U-Net (encoder-to-decoder skip), Mamba/SSM block. Pattern 이 architecture family 초월.
간단한 math
y = x + f(x) 면, dy/dx = 1 + f'(x). f'(x) 가 작아도 (vanishing gradient), +1 이 gradient 살아있게 유지. Chain rule 의 곱이 sum-of-product 가 돼서 numerically 훨씬 forgiving.