Abstract
A central goal of sequence modeling is designing a single principled model that can address sequence data across a range of modalities and tasks, particularly on long-range dependencies. Although conventional models including RNNs, CNNs, and Transformers have specialized variants for capturing long dependencies, they still struggle to scale to very long sequences of 10,000 or more steps. A promising recent approach proposed modeling sequences by simulating the fundamental state space model (SSM) $x'(t) = Ax(t) + Bu(t), y(t) = Cx(t) + Du(t)$, and showed that for appropriate choices of the state matrix $A$, this system could handle long-range dependencies mathematically and empirically. However, this method has prohibitive computation and memory requirements, rendering it infeasible as a general sequence modeling solution. We propose the Structured State Space sequence model (S4) based on a new parameterization for the SSM, and show that it can be computed much more efficiently than prior approaches while preserving their theoretical strengths. Our technique involves conditioning $A$ with a low-rank correction, allowing it to be diagonalized stably and reducing the SSM to the well-studied computation of a Cauchy kernel. S4 achieves strong empirical results across a diverse range of established benchmarks, including (i) 91% accuracy on sequential CIFAR-10, (ii) substantially closing the gap to Transformers on image and language modeling tasks while performing generation 60x faster, and (iii) SoTA on every task from the Long Range Arena benchmark, including solving the challenging Path-X task of length 16k.
Introduction: The Challenge of Long-Range Dependencies
Modern deep learning is built on sequence models, yet the three dominant paradigms—Transformers, Recurrent Neural Networks (RNNs), and Convolutional Neural Networks (CNNs)—each face fundamental scaling limitations. Transformers suffer from $O(L^2)$ quadratic complexity, making them unusable for sequences exceeding a few thousand steps. RNNs, while efficient in memory, are slow to train due to their sequential nature and often struggle with vanishing gradients. CNNs are fast to train but typically have limited receptive fields, failing to capture dependencies that span tens of thousands of steps.
The Structured State Space (S4) model addresses these issues by revisiting State Space Models (SSMs), a classical framework from control theory. SSMs offer a continuous-time representation that can theoretically capture infinite context, but they have historically been too computationally expensive and numerically unstable for large-scale deep learning.
The Structured State Space Model (S4)
The S4 model maps a 1D input signal $u(t)$ to an output $y(t)$ through an $N$-dimensional latent state $x(t)$. This is governed by the linear differential equation: $$\dot{x}(t) = Ax(t) + Bu(t)$$ $$y(t) = Cx(t) + Du(t)$$
HiPPO Initialization and NPLR Parameterization
To effectively "remember" the past, S4 utilizes HiPPO (Hidden Learned Polynomial Projections) to initialize the state matrix $A$. HiPPO provides a mathematical foundation for compressing the entire history of a signal into a fixed-size state.
The primary technical innovation of S4 is the Normal Plus Low-Rank (NPLR) parameterization. Previous attempts to use SSMs were slow because the matrix $A$ was often "non-normal," making diagonalization numerically unstable. S4 decomposes $A$ into a normal matrix and a low-rank correction. By applying the Woodbury Identity, the authors transform the SSM computation into a Cauchy kernel evaluation. This reduces the complexity from $O(N^2L)$ to $\tilde{O}(N+L)$, allowing S4 to match the efficiency of optimized CNNs and Transformers.
A "Best of All Worlds" Architecture
S4 is uniquely versatile:
- Recurrent View: For inference, it can be discretized into a linear recurrence, enabling fast, constant-time generation per step.
- Convolutional View: For training, the linear system can be computed as a global convolution, allowing for massive parallelism.
- Continuous View: Because it is defined in continuous time, the model is resolution-invariant and can handle irregularly sampled data or different frequencies without retraining.
Empirical Evaluation and Results
S4 was tested against the Long Range Arena (LRA), a benchmark specifically designed to stress-test models on long-range dependencies.
Solving Path-X
The most striking result is on the Path-X task. In this challenge, 128x128 images are flattened into a 1D sequence of 16,384 pixels. The model must determine if two points in the image are connected by a path. Prior to S4, every model—including specialized "Long" Transformers—failed this task, performing no better than random chance (50%). S4 achieved an unprecedented 96.35% accuracy.
Efficiency and Speed
Beyond accuracy, S4 demonstrates significant computational advantages:
- Generation Speed: On autoregressive tasks like WikiText-103, S4 generates text 60x faster than Transformers because it maintains a compact state rather than needing to re-attend to a growing KV-cache.
- Memory Footprint: S4 uses roughly 400x less memory than the previous LSSL model, making it practical for standard GPU hardware.
- Modality Agnostic: S4 achieved 91% on sequential CIFAR-10 (flattened pixels) without any 2D inductive bias, nearly matching the performance of a 2D ResNet.
Conclusion
The Structured State Space model represents a significant step toward a unified sequence modeling architecture. By bridging the gap between continuous-time control theory and discrete-time deep learning, S4 provides a scalable, efficient, and mathematically grounded solution for long-range dependencies. While a small performance gap remains in traditional language modeling compared to the most heavily tuned Transformers, S4's ability to handle sequences of length 16k and beyond opens new frontiers in audio, video, and high-resolution image processing.
Summary updated