Introduction
Recurrent Neural Networks (RNNs) have achieved remarkable empirical success in sequence modeling. However, the theoretical understanding of why they learn and generalize so effectively has historically lagged behind that of feedforward networks (FFNs). While theorists have made significant strides in understanding FFNs—particularly in the overparameterized regime where networks have vastly more neurons than strictly necessary—RNNs present unique mathematical challenges. They reuse the same weight matrices across time steps, creating complex dependencies, and they rely on a hidden state to act as memory.
This paper bridges that theoretical gap, proving that overparameterized vanilla RNNs trained with Stochastic Gradient Descent (SGD) can efficiently learn complex, general functions of entire sequences. The authors' key breakthrough is proving that an RNN's hidden state retains recoverable information about the entire past input sequence, overcoming previous theoretical limitations.
The Problem: Beyond "Bag-of-Words" Functions
Previous landmark theoretical work demonstrated that RNNs could be trained via SGD, but with a significant caveat: the proofs only applied if the target function was a simple sum of functions applied to individual tokens. Essentially, prior theory proved RNNs could learn only if they ignored their hidden state memory, treating sequences like a "bag of words."
This paper tackles the core theoretical hurdle: proving that RNNs can learn and generalize on general concept classes where the network must actively use its hidden state to remember and process the entire sequence of past tokens.
Methodology: Overparameterization and Invertibility
The authors analyze vanilla RNNs (Elman networks) with ReLU activations in the overparameterized regime (very wide hidden layers). Their theoretical framework relies on three key techniques:
- The "Pseudo-Network" Approximation: Due to high overparameterization, the RNN's behavior during training can be approximated by a first-order Taylor expansion around its initialization. This creates a mathematically tractable, linearized "pseudo-network."
- Invertibility at Initialization: To prove the RNN can learn complex sequence functions, the authors must first demonstrate that a good network configuration exists. They achieve this by showing that, at random initialization, the final hidden state can actually be inverted using a linear transformation to recover the entire input sequence.
- Re-randomization: Because RNNs reuse the same weights at every time step, standard statistical concentration inequalities fail. The authors employ a specialized "re-randomization" technique to decouple these dependencies, allowing them to bound errors across time steps.
Key Insights and Theoretical Results
The study yields several profound insights into RNN mechanics and rigorous guarantees about their performance:
- The Hidden State as a Time Capsule: The most surprising finding is the "invertibility" lemma. If an RNN is sufficiently wide, its hidden state does not merely contain a blurry summary of the past; it holds enough high-dimensional information to linearly reconstruct the exact sequence of input tokens.
- Provable Learning and Generalization: The main theorem guarantees that an overparameterized RNN trained with SGD will achieve a population loss arbitrarily close to the optimal function in the concept class. Furthermore, the required number of neurons, training samples, and SGD iterations all scale polynomially with the target function's complexity, sequence length, and desired error margin.
- Expressivity on Regular Languages: Because the entire sequence can be recovered from the hidden state, the RNN can theoretically express any smooth, continuous function of the entire sequence. As a purely theoretical paper, it does not evaluate on empirical datasets but instead proves this concept class is rich enough to efficiently represent formal regular languages. For example, it can recognize languages like
PARITY(where output depends on the sum of bits modulo 2) and strings with exactly one '1', which inherently require tracking state across time.
Limitations and Future Directions
While representing a significant theoretical leap, the authors are transparent about several limitations in their framework:
- The Overparameterization Gap: The proofs require the number of neurons to be a very large polynomial relative to sequence length and problem complexity. This is qualitatively different from practical settings where RNNs are much smaller.
- Length Generalization: The theoretical setup assumes sequences are of a fixed length during both training and testing. Proving that an RNN trained on short sequences can generalize to longer sequences remains an outstanding challenge.
- Advanced Architectures: The proofs apply strictly to vanilla RNNs. Extending this rigorous theoretical understanding to gated architectures like LSTMs and GRUs is left as an important direction for future work.
Summary updated