Abstract: State-space Models (SSMs) have emerged as efficient sequence models with linear complexity, yet they are not immune to the "curse of memory" that affects recurrent architectures. This work proves that vanilla SSMs, where recurrent weights are learned directly, are fundamentally limited to representing functions with exponentially decaying memory. We propose a framework of stable reparameterizations to overcome this limitation. By analyzing optimization stability through the gradient-over-weight ratio, we derive a theoretically optimal reparameterization scheme. Our "Best" scheme significantly enhances training stability, allowing models to capture long-term dependencies and remain robust even under extreme learning rates.
Introduction
Sequence modeling is defined by a fundamental tug-of-war between computational efficiency and memory capacity. While Transformers are the current gold standard for long-term memory, their quadratic complexity ($O(T^2)$) makes them prohibitively expensive for very long sequences. Recurrent models, including modern State-space Models (SSMs) like S4, Mamba, and RWKV, offer a compelling alternative with linear complexity ($O(T)$). However, these models historically struggle with the "curse of memory"—the tendency for information to be forgotten at an exponential rate.
While empirical successes with models like S4 suggested that SSMs might have solved this issue, the underlying mechanism remained opaque. This paper identifies that the secret to long-term memory in SSMs is not merely their linear dynamics, but rather the specific way their parameters are initialized and transformed through stable reparameterization.
The Curse of Memory in State-Space Models
The authors approach the memory problem through the lens of functional approximation. They provide a mathematical proof—an inverse approximation theorem—showing that "vanilla" SSMs (those where recurrent weights are learned directly) cannot stably approximate any target function that does not decay exponentially.
As shown in the figure above, vanilla SSMs exhibit a sharp increase in perturbation error as the hidden dimension $m$ increases, indicating numerical instability when attempting to capture complex dependencies. In contrast, stable reparameterizations like Softplus and the exponential scheme used in S4 remain robust. This "curse" occurs because, to learn long-term patterns, recurrent weights must move very close to the edge of instability (e.g., eigenvalues $\lambda \approx 0$ in continuous time). Vanilla models become numerically unstable in this regime, whereas stable reparameterizations "stretch" this space, making it navigable for optimizers.
Methods: Stable Reparameterization
To address these instabilities, the authors define a class of stable reparameterization functions ($f$) that map a trainable weight ($w$) to the actual recurrent eigenvalue ($\lambda$). By analyzing the "gradient-over-weight" ratio, they argue that a superior parameterization should have Lipschitz continuous gradients to prevent exploding or vanishing gradients as the model approaches the stability boundary.
By solving a differential equation focused on balancing these gradient scales, they derive a theoretically "Best" reparameterization scheme:
- Continuous-time: $f(w) = -1 / (aw^2 + b)$
- Discrete-time: $f(w) = 1 - 1 / (aw^2 + b)$
Optimal Reparameterization for Stability
This "Best" parameterization acts as a form of pre-conditioning, naturally balancing gradient scales across different memory decay rates. This prevents the model from favoring short-term patterns over long-term ones during training.
As illustrated in the gradient analysis, the "Best" scheme maintains a significantly lower and more consistent gradient-to-weight ratio compared to standard functions like ReLU, Softplus, or Exp. This stability is crucial for scaling models and using higher learning rates without risking divergence.
Key Results and Validation
The authors validated their theory across several benchmarks, including synthetic tasks, language modeling (WikiText-103), and the Long Range Arena (LRA):
- Extreme Learning Rates: The "Best" parameterization proved remarkably robust. On MNIST and CIFAR-10 classification, it remained stable at a learning rate of 5.0, while Exponential and Softplus schemes diverged at values as low as 0.05.
- Competitive Performance: On the LRA benchmark, the "Best" scheme matched or slightly outperformed S4, achieving an average score of 86.48 vs. 86.09.
- Scalability: In tests with a 3-billion parameter language model, the "Best" parameterization was the only one to converge at a high learning rate ($lr=0.01$), highlighting its necessity for large-scale model training.
Conclusion
StableSSM demonstrates that the success of modern SSMs is deeply tied to their parameterization. By lifting the "curse of memory" through theoretically grounded reparameterization, we can build recurrent models that are both efficient and capable of capturing extremely long-range dependencies. While the "Best" scheme is optimal for stability, future work may explore its interaction with input/output projections in multi-layer settings and its application to non-diagonal models like Mamba's selective scan.
Summary updated