Residual Networks Behave Like Ensembles of Relatively Shallow Networks

Andreas Veit, Michael J. Wilber, Serge J. Belongie

TL;DR: Residual Networks (ResNets) aren't actually the ultra-deep sequential pipelines we thought they were. Instead, they behave like an ensemble of many relatively shallow networks, where short paths carry the bulk of the gradient during training and provide surprising resilience to layer removal.

The Mystery of ResNet Performance

Before ResNets, "going deeper" was the holy grail of computer vision, but it hit a hard wall: the vanishing gradient problem. In traditional sequential architectures like VGG, gradients dissipate as they pass back through many layers, making it nearly impossible to train networks with more than a few dozen layers.

While ResNets successfully scaled to over 1,000 layers, the community didn't fully understand why they worked so much better than their predecessors. Was it because they finally solved the vanishing gradient problem across the entire depth, or was something else happening under the hood? This paper investigates the structural nature of ResNets to explain their performance and their strange resilience to having layers deleted at test time.

The "Unraveled" View of ResNets

To understand ResNets, the authors introduce the "unraveled view". By mathematically expanding the recursive definition of a residual block, they show that a ResNet with $n$ blocks can be viewed as a collection of $2^n$ unique paths from input to output. Each path is a different combination of "entering" a residual module or "skipping" it via the identity connection.

Conventional vs. Unraveled View

To test this "collection of paths" hypothesis, the authors performed several lesion studies on standard datasets like CIFAR-10 and ImageNet:

  1. Layer Deletion: Removing a single residual module at test time.
  2. Multiple Deletions: Removing increasing numbers of modules to see if performance degrades gracefully (like an ensemble) or catastrophically (like a sequential chain).
  3. Reordering: Shuffling the order of modules at test time.
  4. Gradient Analysis: Measuring the gradient magnitude for paths of specific lengths to identify which paths actually contribute to learning.
Deleting a layer in an unraveled ResNet vs. a standard network

Key Insights: Ensembles in Disguise

The results of these experiments reveal a paradigm shift in how we understand deep residual networks:

  • Resilience and Smooth Degradation: Unlike VGG, where removing one layer breaks the only path and drops accuracy to chance, ResNets are incredibly robust. Deleting a layer in a ResNet only "kills" half of the $2^n$ paths, leaving the other half intact. As more layers are deleted, the error increases smoothly. Even after deleting 10 out of 54 modules, the network still performs reasonably well—a behavior characteristic of ensembles.
  • The "Effective Depth" is Shallow: While a ResNet might have 110 layers, the paths that actually contribute gradient during training are much shorter—typically only 10 to 34 layers deep. In a 54-module ResNet, paths of length 5–17 modules accounted for nearly all the gradient updates. Paths longer than 20 modules contributed virtually nothing.
  • Vanishing Gradients Still Exist: ResNets don't actually preserve gradients through 100+ layers. Instead, the skip connections provide "highways" that allow gradients to bypass most layers. The "deep" paths in a ResNet contribute almost zero gradient during training.
  • Independence of Paths: The paths in a ResNet don't seem to strongly depend on one another. They behave like an ensemble of models that were trained jointly but can function somewhat independently.

To validate these findings, the authors trained a network by sampling only "effective" (short) paths during training. This model achieved a 5.96% error rate, which was statistically indistinguishable from (and slightly better than) the full ResNet's 6.10%.

Limitations and Future Work

The paper primarily focuses on identity skip connections. While the framework generalizes to projection shortcuts (used for downsampling), those specific layers are much more critical; removing a downsampling layer causes a significant performance drop because it disrupts the spatial dimensionality of the data.

Future work suggested by these findings includes exploring whether we can design architectures that explicitly leverage this ensemble behavior to be more efficient, or if we can find ways to actually make the "deep" paths in a ResNet contribute to the final result, potentially unlocking even higher performance.

Summary updated

BibTeX
@inproceedings{veit2016residual,
  author = {Andreas Veit and Michael J. Wilber and Serge J. Belongie},
  title = {{Residual Networks Behave Like Ensembles of Relatively Shallow Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2016},
}
Figure