Simplified Reversible Residual Networks
Erland Brandser Olsson ⋅ Zhirong Yang
Abstract
The de facto standard way of training neural networks requires storing activations at each layer in memory, in order to compute gradients in backpropagation. As progress has increasingly relied on stacking more and larger layers, memory consumption has now become a major bottleneck for making frontier models available to everyone. In this work, we take advantage of the Residual Network (ResNet) layer formulation that is now used in many state-of-the-art neural network architectures to recompute the activations at each layer on-the-fly during backpropagation instead of storing them in memory. We propose a modification to the Reversible Residual Network (RevNet) that removes the requirement to replace the ResNet layer network function with two new network functions by setting one of them to the identity function. This simple modification offers a significant advantage: it eliminates the need to change the original ResNet architecture. Our method can work as a drop-in replacement for layers with residual connections such as in ordinary ResNets or Transformers with negligible performance loss while offering significant reductions in memory consumption. With this simple modification, we are able to maintain the same computational cost and ease of use as activation checkpointing, which requires no architectural changes, while leveraging a reversible procedure such that we only need to store the activations from the last layer. We call this method Simplified RevNet and, compared with previous reversible architectures, propose a simpler and more streamlined approach that comes in two variants based on which of $F$ or $G$ in RevNet becomes an identity function. Empirically, we demonstrate performance at practically the same level as the non-reversible counterparts on ImageNet image classification with ResNets and on OpenWebText language modeling with Transformers.
Successful Page Load