Introduction
Recurrent Neural Networks (RNNs) are fundamental to natural language processing, yet our theoretical understanding of their relative expressive powers has often been imprecise. While classical results suggest that simple RNNs are Turing-complete with infinite precision, this does not reflect their practical behavior with finite precision and specific gating mechanisms. This paper addresses this gap by introducing a formal hierarchy to categorize RNN architectures based on their memory capacity (space complexity) and the mathematical nature of their updates (rational recurrence).
Theoretical Framework: Space and Rationality
The authors analyze RNNs through two primary lenses to bridge the gap between abstract automata theory and practical deep learning:
- Saturated RNNs: By analyzing "saturated" versions of RNNs—where activation functions like sigmoid or tanh are replaced by step functions—the models can be treated as discrete state machines, making formal proofs tractable.
- Automata Mapping: RNN behaviors are mapped to formal models such as Weighted Finite Automata (WFAs) and Counter Machines (CMs).
Two key properties define the hierarchy:
- Space Complexity: This measures how many distinct configurations an RNN can reach as the input length $n$ increases. Common bounds include constant $\Theta(1)$, logarithmic $\Theta(\log n)$, and linear $\Theta(n)$.
- Rational Recurrence (RR): A model is considered "rationally recurrent" if its update can be described by a WFA. Rational models like the QRNN are faster because their updates are simpler and independent of the current state (counter-blind).
The RNN Hierarchy
The central contribution of the paper is a 2D classification of popular architectures. As shown in Figure 1, models are categorized by their space complexity and whether they exhibit rational recurrence.
A critical finding is the "Counter-Awareness" Gap. The authors prove that LSTMs are not rational. Unlike "counter-blind" rational models (e.g., QRNN), an LSTM can "look" at its internal cell state to decide how to update it, making it "counter-aware." This allows the LSTM to achieve $\Theta(\log n)$ space while remaining non-rational. In contrast, GRUs and simple RNNs are rational and limited to $\Theta(1)$ space. Interestingly, the hierarchy also reveals that unrestricted WFAs (RR-complete) can possess greater state capacity ($\Theta(n)$) than saturated LSTMs, suggesting potential for even more powerful rational designs.
Empirical Validation
To test these theoretical predictions, the authors used synthetic formal language datasets designed to probe specific computational limits:
- Counting ($L_5$): Recognizing languages where the difference between counts of specific tokens is bounded.
- State Freezing ($a^n b^n \Sigma^*$): Requiring a model to recognize a pattern and maintain that information despite distracting suffix tokens.
The experiments confirmed the theory: LSTMs learned these languages perfectly, while 1-layer QRNNs failed on the suffix-augmented tasks. Although stacking layers (e.g., a 2-layer QRNN) can sometimes compensate for a rational encoder's weaknesses, these models struggled to generalize to longer sequences compared to the LSTM's "native" counting ability.
Conclusion
This work provides a rigorous framework for comparing RNN architectures, proving that LSTMs are fundamentally more expressive than rational models like QRNNs. While the proofs rely on the "saturated" assumption, empirical results suggest these findings hold for standard networks. Future work includes extending this hierarchy to Transformers and developing more expressive rational architectures that retain the efficiency of simpler models.
Summary updated