Efficiently Modeling Long Sequences with Structured State Spaces
Efficiently Modeling Long Sequences with Structured State Spaces
Problem
Framing
Long-sequence models handled local context well but either scaled poorly past steps or lost accuracy on true long-range tasks. S4 closes this gap by reparameterizing state space models so HiPPO-structured dynamics become numerically stable and near-linear to train. It reaches on Path-X length , where prior models stay at chance.
Currently Used Methods
Foundational
- @hochreiterLSTM1997 — gated recurrent state updates for sequential memory.
- Limitation in context: recurrent training remains weak on extreme-length dependencies.
- @vaswaniAttentionAllNeed2017 — global token-token interaction with strong language modeling accuracy.
- Limitation in context: quadratic context scaling is costly for steps.
- "Linear State Space Layers" — HiPPO-based SSMs for principled long-range memory.
- Limitation in context: kernel computation needs time and large memory.
- "Performer" — kernelized attention for subquadratic long-context transformers.
- Limitation in context: still fails on Path-X and trails badly on LRA.
- "Linear Transformers" — recurrent reformulation of attention for faster long-sequence training.
- Limitation in context: efficiency gains do not recover difficult long-range reasoning.
Proposed Method
Architecture
S4 starts from a continuous-time SSM with learned , discretizes it, then uses either a recurrent update or a convolution kernel for parallel training. The key parameterization writes the HiPPO state matrix as normal plus low-rank, so it can be stably diagonalized in a transformed basis and reduced to Cauchy-kernel evaluation.

Loss / Objective
The paper treats S4 as a drop-in sequence layer; the task loss is the standard supervised or autoregressive objective applied to the S4 backbone.Its core structural constraint is the NPLR parameterization
Sampling Rule / Algorithm
S4 computes the convolution kernel in frequency space, applies a low-rank Woodbury correction, then inverts with FFT.
Training Procedure
- Optimizer: AdamW.
- LR schedule: constant, decay on validation plateau.
- HiPPO parameter LR: capped at .
- Efficient-Transformer benchmark: 4 layers, hidden size , batch size .
- LRA sweeps: depth -, hidden size -.
- Example LRA best settings: ListOps batch , Text batch , epochs -.
- Normalization: BN or LN by task.
- Dropout: to by task.
Evaluation
Datasets
- Long Range Arena: ListOps, Text, Retrieval, Image, Pathfinder, Path-X.
- Speech Commands SC10: raw length- speech.
- Sequential vision: sMNIST, pMNIST, sCIFAR.
- Generative modeling: CIFAR-10 density estimation, WikiText-103.
- Time-series forecasting: ETTh1, ETTh2, ETTm1, Weather, ECL.
Metrics
- Classification: accuracy.
- Language modeling: perplexity, tokens/sec.
- Density estimation: bits per dimension, images/sec.
- Forecasting: MSE, MAE.
- Efficiency: training step time, memory allocation.
Headline results
- LRA average: in the main table; all baselines remain below .
- Path-X: ; prior efficient transformers report .
- SC10 raw speech: ; WaveGAN-D reaches with far more parameters.
- sCIFAR: ; LSSL reaches .
- CIFAR-10 density estimation: bpd with S4-large.
- WikiText-103: test perplexity, K tokens/s; Transformer is and K tokens/s.
Table 4: Long Range Arena comparison
| Model | ListOps | Text | Retrieval | Image | Pathfinder | Path-X | Avg |
|---|---|---|---|---|---|---|---|
| Transformer | 36.37 | 64.27 | 57.46 | 42.44 | 71.40 | 7 | 53.66 |
| Reformer | 37.27 | 56.10 | 53.40 | 38.07 | 68.50 | 7 | 50.56 |
| BigBird | 36.05 | 64.02 | 59.29 | 40.83 | 74.87 | 7 | 54.17 |
| Linear Trans. | 16.13 | 65.90 | 53.09 | 42.34 | 75.30 | 7 | 50.46 |
| Performer | 18.01 | 65.40 | 53.82 | 42.77 | 77.05 | 7 | 51.18 |
| FNet | 35.33 | 65.11 | 59.61 | 38.67 | 77.80 | 7 | 54.42 |
| Nyströmformer | 37.15 | 65.52 | 79.56 | 41.58 | 70.94 | 7 | 57.46 |
| Luna-256 | 37.25 | 64.57 | 79.29 | 47.38 | 77.72 | 7 | 59.37 |
| S4 | 59.60 | 86.82 | 90.90 | 88.65 | 94.20 | 96.35 | 86.09 |
Ablations
- HiPPO initialization vs random: HiPPO dominates validation accuracy despite similar train accuracy.
- Training vs freezing : learning the SSM improves all initializations.
- Random NPLR vs HiPPO NPLR: NPLR alone does not explain S4's gains.
- Small-model sCIFAR: full S4 reaches with K parameters and dropout .
Method Strengths and Weaknesses
Strengths
- Solves Path-X at , the paper's clearest long-range result.
- Reaches near-linear kernel computation through NPLR plus Cauchy reduction.
- Preserves recurrent inference, yielding about faster generation.
- Transfers across speech, language, vision, and forecasting with few architectural changes.
Weaknesses
- Still trails Transformers on WikiText-103: vs perplexity.
- Method depends heavily on HiPPO initialization; random NPLR performs poorly.
- Core algorithm is mathematically intricate compared with standard recurrent baselines.
- Task performance still needs per-dataset hyperparameter tuning and normalization choices.
Suggestions from the authors
- Combine S4 with other sequence models to close the remaining language-modeling gap.
- Extend S4 to settings where other architectures supply stronger domain inductive bias.
- Explore richer continuous-time sequence modeling capabilities beyond current benchmarks.
- Improve theoretical and practical understanding of structured state-space parameterizations.
Links
Prior Papers
- @hochreiterLSTM1997 — canonical recurrent baseline for hidden-state sequence modeling under long dependency stress.
- @vaswaniAttentionAllNeed2017 — dominant long-context baseline family that S4 challenges on efficiency and scaling.
Further Papers
- @guMamba2023 — extends the state-space line by making SSM dynamics input-dependent for stronger discrete-sequence modeling.