Efficiently Modeling Long Sequences with Structured State Spaces

Albert Gu, Karan Goel, Christopher Ré

2021 · arXiv

Efficiently Modeling Long Sequences with Structured State Spaces

Problem

Framing

Long-sequence models handled local context well but either scaled poorly past 10410^4 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 96.35%96.35\% on Path-X length 1638416384, where prior models stay at chance.

Currently Used Methods

Foundational

Proposed Method

Architecture

S4 starts from a continuous-time SSM with learned (A,B,C)(A,B,C), 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.

Three-panel overview: continuous SSM dynamics, special long-range state matrices, and the recurrent/convolutional discrete views used by S4.

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

A=VΛVPQ=V(Λ(VP)(VQ))VA = V \Lambda V^* - P Q^* = V\left(\Lambda - (V^*P)(V^*Q)^*\right)V^*

Sampling Rule / Algorithm

S4 computes the convolution kernel in frequency space, applies a low-rank Woodbury correction, then inverts with FFT.

K^(ω)=21+ω[k00(ω)k01(ω)(1+k11(ω))1k10(ω)]\hat{K}(\omega) = \frac{2}{1+\omega}\left[k_{00}(\omega) - k_{01}(\omega)\left(1 + k_{11}(\omega)\right)^{-1}k_{10}(\omega)\right] K=iFFT({K^(ω):ω=exp(2πik/L)})K = \mathrm{iFFT}\left(\{\hat{K}(\omega) : \omega = \exp(2\pi i k/L)\}\right)

Training Procedure

Evaluation

Datasets

Metrics

Headline results

Table 4: Long Range Arena comparison

ModelListOpsTextRetrievalImagePathfinderPath-XAvg
Transformer36.3764.2757.4642.4471.40753.66
Reformer37.2756.1053.4038.0768.50750.56
BigBird36.0564.0259.2940.8374.87754.17
Linear Trans.16.1365.9053.0942.3475.30750.46
Performer18.0165.4053.8242.7777.05751.18
FNet35.3365.1159.6138.6777.80754.42
Nyströmformer37.1565.5279.5641.5870.94757.46
Luna-25637.2564.5779.2947.3877.72759.37
S459.6086.8290.9088.6594.2096.3586.09

Ablations

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers