Abstract
Deep neural networks based on linear RNNs interleaved with position-wise MLPs are gaining traction as competitive approaches for sequence modeling. Examples of such architectures include state-space models (SSMs) like S4, LRU, and Mamba: recently proposed models that achieve promising performance on text, genetics, and other data that require long-range reasoning. Despite experimental evidence highlighting these architectures' effectiveness and computational efficiency, their expressive power remains relatively unexplored, especially in connection to specific choices crucial in practice - e.g., carefully designed initialization distribution and potential use of complex numbers. In this paper, we show that combining MLPs with both real or complex linear diagonal recurrences leads to arbitrarily precise approximation of regular causal sequence-to-sequence maps. At the heart of our proof, we rely on a separation of concerns: the linear RNN provides a lossless encoding of the input sequence, and the MLP performs non-linear processing on this encoding. While we show that real diagonal linear recurrences are enough to achieve universality in this architecture, we prove that employing complex eigenvalues near unit disk - i.e., empirically the most successful strategy in S4 - greatly helps the RNN in storing information. We connect this finding with the vanishing gradient issue and provide experiments supporting our claims.
Introduction
For years, the deep learning community believed that recurrent neural networks (RNNs) required non-linearities within their hidden state updates (e.g., LSTMs or GRUs) to model complex sequences. However, a new wave of State-Space Models (SSMs) has challenged this by using purely linear recurrences interleaved with position-wise MLPs. These models are significantly faster for long sequences because their complexity scales linearly ($O(L)$) rather than quadratically ($O(L^2)$).
This paper provides a theoretical foundation for this growing family of models. We prove that a simple architecture—a linear recurrent layer followed by a standard MLP—is a universal approximator for sequence-to-sequence mappings. The core mechanism is a "separation of concerns": the linear RNN acts as a lossless memory bank, while the MLP handles all complex, non-linear processing.
Architecture and Theoretical Framework
The analyzed architecture consists of a linear diagonal RNN followed by a position-wise Multi-Layer Perceptron (MLP). The proof of universality relies on two primary steps:
- Lossless Encoding (The RNN's Job): Using the properties of Vandermonde matrices, we show that a linear RNN can "compress" an entire input sequence into its hidden state without losing information. The hidden state at time $k$ contains a linear projection of all tokens seen so far.
- Non-linear Decoding (The MLP's Job): Since the hidden state contains all necessary information, a sufficiently wide MLP can be trained to "decode" this state into any desired output. We utilize Barron’s Theory to provide finite-width guarantees for the MLP.
The Power of Complex Numbers
While real-valued recurrences are theoretically sufficient, they often become numerically unstable (ill-conditioned) in practice. We provide a rigorous mathematical justification for using complex numbers in SSMs. Complex eigenvalues near the unit circle allow the model to distribute information across the unit disk, preventing the "vanishing gradient" or "numerical garbling" that plagues real-valued linear recurrences. This ensures the "memory" remains clear and reconstructible.
Empirical Validation
We validated our theory using several benchmarks, including Sequential MNIST, PathFinder (from the Long Range Arena), and non-linear ODE systems like the chaotic Lorentz system.
Key Results
- Universality Proof: We prove that for any "regular" causal sequence map, there exists a finite-width linear RNN + MLP that can approximate it to arbitrary precision.
- Reconstruction Capability: We demonstrate that a clear image of an MNIST digit can be reconstructed from just the final hidden state of a trained linear RNN. As the hidden dimension $N$ increases, the reconstruction error drops significantly, becoming negligible once $N$ exceeds the sequence length $L$.
- Modeling Chaotic Systems: The architecture successfully learned to mimic the chaotic Lorentz system, handling high-dimensional, non-linear interactions previously thought to require non-linear recurrences.
Limitations and Future Work
This work focuses on continuous-valued inputs. While the core proofs assume a continuous vector space, extending these findings to discrete tokens (as in Large Language Models) is a vital next step. Additionally, while we analyze "vanilla" linear SSMs, further research is needed to cover the "selective" or gated mechanisms used in models like Mamba. Finally, although these models can represent complex maps, training them remains sensitive to initialization, particularly for chaotic systems.
Summary updated