Training Recurrent Neural Networks (RNNs) is notoriously memory-intensive. To perform backpropagation, standard training procedures must store every hidden state across all timesteps. This paper introduces Reversible RNNs, a novel architecture that drastically reduces memory costs by 10–15x. By recomputing hidden states on the fly during the backward pass and using a clever "fractional forgetting" scheme, these models maintain high performance without hitting the memory wall.
The Memory Wall in RNN Training
The standard method for training RNNs is Truncated Backpropagation Through Time (TBPTT). To calculate gradients, the system must store the hidden state $H$ for every single timestep $T$ in a sequence, leading to a memory cost of $O(TH)$.
As researchers build larger models or process longer sequences, they quickly exhaust the memory limits of modern GPUs. While "reversible" architectures exist for image-processing networks (like RevNet), applying them to RNNs presents a fundamental paradox: a perfectly reversible system cannot lose information, yet the most successful RNNs (like LSTMs and GRUs) rely heavily on "forgetting" irrelevant information to function properly. The authors tackle this head-on: how do you build a network that can forget information while still being reversible enough to reconstruct its previous states?
Reversible Architecture and Fractional Forgetting
The authors propose reversible versions of the two most popular RNN architectures: RevGRU and RevLSTM.
To achieve reversibility, they adapt the "coupling trick" used in RevNets, splitting the hidden state into two halves where one half updates the other in a mathematically invertible way.
However, the "forgetting" mechanism poses a challenge. In standard finite-precision computing, multiplying a value by a forget gate (a number between 0 and 1) discards bits of information. You cannot simply "un-multiply" to get the exact original value back because those bits are permanently lost.
To solve this, the authors introduce Fractional Forgetting via an "information buffer." Instead of letting those bits vanish, the network stores a very small number of bits (the "lost" information) in a buffer. You don't need to store the whole 32-bit hidden state to be reversible; storing just 2–5 bits of "forgotten" info per unit allows for perfect reconstruction.
Additionally, for sequence-to-sequence tasks, standard attention mechanisms require keeping all encoder hidden states in memory. The authors propose Sliced Attention, which performs attention over only a small "slice" of the hidden state combined with the word embedding, allowing the rest of the state to remain reversible and unstored.
Key Insights and Performance Trade-offs
The researchers evaluated their models on standard benchmarks, including Language Modeling (Penn TreeBank, WikiText-2) and Neural Machine Translation (Multi30K, IWSLT 2016).
- The "No-Forgetting" Trap: The authors mathematically prove that if an RNN is perfectly reversible (storing zero extra bits), it must effectively memorize the entire input sequence within its hidden state. This overwhelms the model's capacity, causing it to fail at even simple sequence-repeating tasks.
- Massive Memory Savings: By storing just a few bits, the models achieved a 10–15x reduction in activation memory cost for standard RNNs, and a 7–14x savings in encoder/decoder translation tasks.
- Competitive Accuracy: On the Penn TreeBank dataset, RevGRU and RevLSTM matched the performance of traditional models. In translation tasks, the reversible models actually outperformed baseline GRUs and LSTMs on the Multi30K dataset.
The authors found that restricting the model to forget only 2 or 3 bits per unit was the "sweet spot" for balancing memory savings and predictive accuracy.
Limitations and Future Directions
While the memory savings are substantial, Reversible RNNs come with a compute-memory trade-off. Because the forward pass work is essentially done twice (once forward, once reconstructed backward), training time per iteration is roughly 2–3x slower.
Furthermore, implementing these custom reversible kernels for GPUs is more complex than using standard deep learning libraries, and RevLSTMs can become numerically unstable if the "forgetting" isn't tuned correctly. However, with better engineering and specialized CUDA kernels to reduce computational overhead, Reversible RNNs offer a highly promising path forward for training massive sequence models on a strict memory budget.
Summary updated