Residual Connection

A shortcut skipping a layer, carrying the original value through

Key points
  • A residual connection is a shortcut that skips a layer and carries the original value straight up, untouched.
  • The layer doesn't build a new result from scratch. It only figures out how much to add to the original, and the two get combined further up.
  • Before this shortcut existed, stacking layers deeper actually made results worse, which was a strange and stubborn problem.
  • Because the learning signal rides this same shortcut on the way back, networks hundreds of layers deep can now train.
  • Today's image models and language models alike carry this shortcut in every single block, without exception.
Contents

1The analogy

Imagine carrying a package up the stairs of an apartment building. Each floor has a workbench, and whoever's stationed there opens the box and makes a small adjustment. That's fine for a few floors. But once there are dozens of floors, by the time the box reaches the top, nobody can tell what was originally inside it. And if some floor in the middle makes a mistake, everything done below it turns out to have been wasted effort too.

So a shortcut got built next to every workbench. The original box travels up the shortcut untouched. Instead of rebuilding the box, each workbench only figures out what to add to it. Upstairs, whoever's waiting just takes the box that arrived by the shortcut and places the addition on top. And if a floor can't find anything useful to add, it can simply pass the box along with nothing added at all.

2In detail

A layer only has to learn the difference

An ordinary layer takes what it receives and turns the whole thing into a new value. Attach a shortcut to that layer and its job changes. What the layer produces is no longer a finished result — it's the difference between the original value and the target. That's where the name residual comes from: what's left over.

Only having to produce a difference makes the layer's job much easier. If the current value is already good enough, the layer can output something close to zero and add almost nothing. That matters more than it sounds like it should. Without a shortcut, even doing nothing is something a layer has to learn to imitate precisely by tuning its own knobs just right.

It also becomes possible to stack a hundred layers and let only thirty of them actually do meaningful work. The rest simply pass along what they received.

Adding requires matching sizes

For the value that arrives by the shortcut and the value the layer produces to be combined, the two have to be the same shape. Bundles of numbers with different lengths can't be added together. That's why the stretch of network wrapped by a shortcut is usually designed so the size coming in matches the size going out.

Where the size does need to change, a very light transformation gets slipped into the shortcut path itself to match it up. In image models, the spot where the picture shrinks and the number of channels grows is one such place. Even so, the rule is to keep that transformation as minimal as possible — a shortcut that gets complicated stops being a shortcut.

Without a shortcut, deeper meant worse

It seems natural to assume that stacking layers deeper would boost capacity and therefore performance. In practice the opposite happened. Push the layer count from twenty to fifty and results got worse, and not just on new data — even on data the model had already trained on.

This wasn't the same as memorizing too hard. A deep model should have been able to match a shallower model's performance at minimum just by copying its answers, but it couldn't even manage that. The problem wasn't a lack of capacity — training itself simply wasn't working. Once shortcuts arrived, that wall came down, and models with well over a hundred layers began performing better in practice.

The learning signal rides the shortcut back down too

Learning works by measuring how far off the top-level answer was and sending that signal back down toward the earlier layers. Each time this signal crosses a layer, it gets caught up in that layer's own computation and shrinks or grows a little. Across dozens of layers, by the time it reaches the earliest ones, the signal has nearly vanished.

With a shortcut in place, the returning signal rides that same path down. Since there's a route that bypasses the layer computation entirely, the signal arrives at the early layers close to its original strength. That's the reason the earliest layers of a deep model can finally learn properly.

Built into nearly everything today

Shortcuts first succeeded in a big way inside image recognition models, but by now they're a default part of almost every architecture. Open up a single block inside a language model and you'll find two shortcuts: one right after the attention step, and another right after the layer that follows it.

So instead of getting completely overwritten as it passes through the layers, the value keeps one thick, unbroken stem running straight from bottom to top. Each layer just adds its own small contribution to that stem. Layer normalization tends to show up as a constant companion for exactly this reason — if every layer only ever adds, the values would otherwise keep growing larger and larger.

3More precisely

A residual connection adds the input of a block of layers back onto that block's output before passing the sum along. The block ends up learning the difference between the target and the input, and the gradient flowing back gains a path that bypasses the layers entirely. That path is what cuts vanishing gradients down so sharply.

The analogy breaks down in a few places. The stairwell shortcut is a route for moving cargo, but a residual connection isn't a route for moving anything — it's a computation that adds two values together. The shortcut itself has no learnable knobs at all, so it costs almost nothing to include. And the box and its addition aren't set side by side; the numbers at each position are added directly into one another.

Shortcuts aren't a cure-all either. Because values keep accumulating through nothing but addition, later layers tend to hold larger and larger values, which is why normalization has to travel alongside them, and where exactly the addition happens can make training smoother or shakier.

There's also a design choice hiding underneath the shortcut: whether normalization sits inside the branch that gets added, or outside it on the shared stem both branches rejoin. That placement decision, more than almost anything else in the block, tends to determine whether a very deep stack trains smoothly or fights back the whole way.

4Try it yourself

5Common misconceptions

  • It's easy to think a shortcut skips a layer to save computation, but actually the layer still runs its full computation — the shortcut just adds the original value on top of the result.

  • It's easy to think stacking layers deeper is always better, but actually without something like a shortcut, going deeper makes training harder, not easier.

  • It's easy to think residual connections are only used in image models, but actually today's language models carry two of them in every single block.

7One-line summary

In shortA residual connection is a shortcut that carries the original value past a layer untouched, so the layer only has to learn the difference to add, and even very deep models can train.

Spotted an error or have a better analogy? Suggest an edit · Last updated2026-09-02