Paper Breakdowns  /  ResNet
Paper 12~7 min readCVPR 2016
Paper Breakdown

ResNet,
explained.

Everyone believed deeper networks should be smarter networks — until they weren't. Add too many layers and performance got worse, even on the training data, and nobody could say why. This 2015 paper found the culprit and fixed it with a one-line idea so simple it now sits inside nearly every deep model, Transformers included.

Written breakdown
This one is a written deep-dive.
Paper, mechanism, worked math and a runnable version — all below ↓
01

The degradation problem

By 2015, depth was the frontier — more layers, more power. But the authors hit a wall that made no sense: a 56-layer plain network had higher error than a 20-layer one, and not just on test data — on the training data too.

That rules out overfitting, which would show up only at test time. The deeper network literally couldn't fit data the shallower one handled easily. The problem wasn't capacity; it was that very deep plain networks had become too hard to optimize. This was the degradation problem.

02

The insight: a deep net should never be worse than a shallow one

Here's the logic that cracked it. Suppose your best 20-layer network is great. A 56-layer network could match it exactly — just make the 36 extra layers do nothing, passing their input straight through. So more depth should never hurt; worst case, the extra layers learn to be invisible.

The trouble is that a stack of plain layers finds "do nothing" — the identity function — surprisingly hard to learn. So the authors changed the architecture to make doing nothing the easy, default option.

03

The skip connection

Their fix: add a shortcut that carries a block's input directly to its output, and let the layers add to it. Instead of computing a whole new output, the block computes output = input + F(input). The layers only have to learn F — the residual, the change to apply — not the entire mapping.

A residual block
x weight layers
F(x)
+ x + F(x)
↑ the shortcut carries x straight across to the +

Now "do nothing" is trivial: the block just learns F = 0, and the shortcut passes the input through untouched. Extra depth can only help, never actively hurt.

04

Why it fixes training

Skip connections do two quiet, crucial things. They make each block's default behavior "do no harm," so optimization starts from a sane place. And they give gradients a clean highway straight back through the network during training — sidestepping the vanishing-gradient problem where the learning signal fades to nothing before it reaches the early layers of a very deep net.

The reason is one derivative. Backprop scales the gradient by each block's Jacobian; for y = x + F(x) that Jacobian is:

In a plain net the gradient is a bare product of the layer factors — aL — and if each factor is below 1 it decays to nothing across a deep stack. The residual's +1 adds an identity path, so the gradient always contains a term that skips every layer untouched and arrives at full strength:

The gradient can't reach zero when one of its paths is the identity — depth stops being fatal. The runnable version below lets you watch it happen.

Worth knowing

With residual connections, the authors trained a network 152 layers deep — eight times deeper than typical nets of the day — and it kept getting better. The degradation problem simply vanished.

05

The results

ResNet won the ImageNet 2015 classification challenge and swept detection and localization, with a 152-layer network reaching around 3.6% top-5 error — better than human-level on that benchmark, and a huge leap over the previous year's winners.

NetworkDepthTrains well?
Plain net20 layersYes
Plain net56 layersNo — degrades
ResNet152 layersYes — keeps improving
06

Why it still matters

The residual connection escaped computer vision and went everywhere. Look inside a Transformer — the architecture behind every modern LLM — and each block wraps its attention and feed-forward layers in exactly this output = input + sublayer(input) pattern. It's a big reason deep Transformers train stably at all.

ResNet's lesson is one of the most reused in all of deep learning: don't force a block to reinvent its input from scratch — hand it the input for free and let it learn only what to change. A one-line idea that made "deep" learning actually deep.

RUN IT YOURSELF

Watch the gradient vanish — then get saved

The vanishing-gradient problem is exponential decay, and the fix is one identity path. This propagates a gradient back through a deep stack: in a plain net it's a bare product that collapses toward zero as layers pile up; in a residual net the sum-over-paths always includes the all-shortcut path, worth exactly 1, so the signal never dies. Watch a plain 100-layer net's gradient hit 10⁻¹⁶ while the residual floor holds at 1. Change the per-layer factor or the depth.

CPython · WebAssembly
07

Why it still matters

The residual connection — output = F(x) + x — is one of the most quietly universal ideas in deep learning. Before ResNet, stacking more layers made networks worse, not better: gradients vanished on the long trip back, and deep networks couldn't even match shallower ones. The skip connection gave the gradient a clean highway straight through, so a 152-layer network became trainable where a 30-layer one had stalled.

The reframing was the genius part. Instead of asking each block to learn the full transformation it wants, ResNet asks it to learn only the residual — the small change from the input. If the best thing a layer can do is nothing, it just learns to push F(x) toward zero and passes the input through unchanged. "Do no harm" becomes the easy default, so adding depth stops hurting.

That idea did not stay in vision. The Transformer is built on residual connections around every attention and feed-forward block — without them, models with dozens or hundreds of layers would be untrainable. Every large language model you use today relies on the exact mechanism ResNet introduced. It is the structural reason "just add more layers" finally works.

The lasting lesson: when depth stops helping, the problem is often the flow of information and gradients, not capacity. Give signals a shortcut path and make the identity the easy default, and you can train networks far deeper than anyone thought possible. ResNet turned depth from a liability into the field's main lever.

Frequently asked

Quick answers

What is ResNet?

A 2015 architecture that introduced the residual skip connection, letting networks train over 150 layers deep and win ImageNet. Blocks learn a residual added to their input via a shortcut.

What is the degradation problem?

Stacking more layers eventually raised error even on training data — not overfitting, but very deep plain networks becoming too hard to optimize.

What is a skip connection?

A shortcut routing a block's input to its output so it computes input + F(input). The layers learn only F, the change; learning "do nothing" (F=0) becomes trivial.

Why do skip connections help?

They give gradients a clean path back through the network (no vanishing gradient) and make each block's default "do no harm," so depth can only help.

Do Transformers use them?

Yes — every Transformer block wraps its sub-layers in residual connections, the exact idea ResNet introduced, which is part of why deep Transformers train stably.

Finished this one? 0 / 111 Paper Breakdowns done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns