State-space models with layer-wise nonlinearity are universal approximators with exponential decaying memory

Shida Wang, Beichen Xue

TL;DR

State-space models (SSMs) are highly efficient for sequence modeling, but their reliance on linear temporal layers raises questions about their expressive power. This paper proves that multi-layer SSMs with layer-wise nonlinearity are universal approximators, meaning they can learn any continuous sequence-to-sequence mapping. However, the authors also mathematically prove that despite their success on long-sequence tasks, SSMs still fundamentally suffer from exponentially decaying memory, much like classical RNNs.

The Architecture: Speed vs. Capacity

State-space models (like S4 and its variants) have emerged as powerful alternatives to Transformers for long-sequence modeling. By relying on linear recurrent layers, SSMs can process sequences with an asymptotic computational complexity of $O(T \log T)$ using fast Fourier transforms, bypassing the $O(T^2)$ bottleneck of full attention.

State-Space Model Architecture

However, this speedup comes from removing the nonlinear activation functions inside the recurrent temporal step, instead applying them only between layers (as shown in the figure above). This raises a critical theoretical question: Does this linear-in-time architecture sacrifice model capacity? Can it still approximate any complex, real-world sequence relationship? Furthermore, while SSMs are empirically great at long-range tasks, it is unclear if they actually solve the notorious "curse of memory" (vanishing gradients and forgetting) that plagues traditional RNNs, or if they merely delay it.

Proving Universal Approximation

This is a theoretical paper that uses constructive mathematical proofs to analyze the capacity and memory properties of SSMs. To prove Universal Approximation, the authors use two distinct approaches:

  1. Kolmogorov-Arnold Representation Theorem: They demonstrate that a 5-layer SSM can approximate any continuous sequence-to-sequence functional. However, this construction requires the number of hidden neurons to scale linearly with the sequence length, which is highly inefficient for long sequences.
  2. Volterra Series Expansion: To fix the sequence-length dependency, they provide a second proof based on Volterra series (essentially a Taylor expansion for sequence variables).
Volterra Series Construction

This second approach proves universality without requiring the network width to scale with sequence length, suggesting that scaling depth is a more efficient way to build SSMs.

The "Curse of Memory" Remains

To analyze memory decay, the authors define a "memory function" based on the derivative of the model's output with respect to a past input. They mathematically evaluate this function as time approaches infinity for stable SSMs with Lipschitz-continuous layer-wise activations.

While the paper does not train models on standard benchmark datasets, the authors use synthetic data to numerically verify their memory decay theorems. They track the memory functions of randomly initialized RNNs, GRUs, LSTMs, naive SSMs, and S4 models over time to empirically demonstrate the exponential decay bounds.

Key Insights and Results

  • Temporal nonlinearity isn't strictly necessary: You don't need nonlinearities inside the recurrent step (like the sigmoid/tanh gates in LSTMs) to achieve universal approximation. Stacking linear temporal convolutions (SSMs) with standard feedforward nonlinearities in between is mathematically sufficient to learn any continuous sequence mapping.
  • SSMs are just as expressive as classical RNNs: The theoretical guarantee means that replacing an RNN or a Transformer with an SSM does not fundamentally limit the hypothesis space of the model.
  • Exponential Memory Decay: SSMs do not magically solve the vanishing memory problem. The authors prove that for a stable SSM, there exists a positive constant $c_0$ such that the memory function $\hat{\rho}(t)$ decays exponentially: $\lim_{t \to \infty} e^{c_0 t} \hat{\rho}(t) \to 0$.
  • Initialization is a band-aid, not a cure: While techniques like the HiPPO initialization (used in S4) drastically slow down the forgetting process—allowing the model to perform incredibly well on long-range benchmarks—the fundamental mathematical limit of exponential decay is still present. Numerical simulations confirmed that S4's memory retention is visibly "capped" by a straight line on a logarithmic scale, confirming asymptotic exponential decay.

Limitations and Future Work

The primary limitation of this work is that the proofs guarantee existence (that an approximation is possible) but do not provide quantitative approximation rates. In other words, the theory doesn't tell us exactly how wide or deep the SSM needs to be to achieve a specific error bound on a specific task.

Future work should focus on establishing these approximation rates. Understanding exactly how the error scales with hidden dimensions and network depth will help engineers mathematically optimize SSM architectures for real-world applications, rather than relying purely on empirical trial and error.

Summary updated

BibTeX
@inproceedings{wang2023state,
  author = {Shida Wang and Beichen Xue},
  title = {{State-space models with layer-wise nonlinearity are universal approximators with exponential decaying memory}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=i0OmcF14Kf},
}
Figure