State-Space Models

State-space models are sequence architectures that model long-range dependencies through recurrent state updates or structured sequence transformations.

A simple continuous state-space form is:

Sequence models use discretized or structured versions of this update to mix information over long contexts.

A discrete-time form is:

The matrices may be constrained or parameterized so the sequence can be scanned efficiently.

Key Ideas

  • A state summarizes past sequence information and is updated as new inputs arrive.
  • Structured parameterization can make long sequence mixing efficient compared with full attention.
  • Some implementations behave like recurrent scans; others use parallel sequence transforms during training.
  • State size, discretization, gating, and input-dependent parameters define what information can be retained.
  • SSMs are often compared with RNNs and Transformers because all three solve sequence mixing differently.
  • Mamba is best treated as a selective SSM rather than a separate top-level architecture family.

Discretization Contract

A continuous system:

must be converted into a sequence update. A common form is:

where is a step size or learned timescale. Papers should state how discretization, stability, and parameterization are handled.

Convolution View

For linear time-invariant SSMs, the output can be written as a sequence convolution:

with kernel terms derived from powers of . This is why some SSMs can train with parallel convolution-like computation while still offering recurrent scanning for inference.

Matrix Mixer View

Modern SSM papers often reason about the whole sequence transformation as a structured matrix:

For a recurrent SSM:

Mamba-2 is the canonical paper note for structured state space duality: it relates SSMs and attention-like mixers through structured semiseparable matrices and uses that view to design a faster Mamba-style layer.

Comparison Contract

FamilySequence MixingStrengthRisk
RNN/GRU/LSTMrecurrent hidden updatestreaming and compact statehidden bottleneck, sequential training
Transformerpairwise attentiondirect token-token interaction attention cost
Long convolutionimplicit or explicit convolution kernellong context without pairwise attention matrixfilter/gating design and kernel implementation matter
Moving average attentionEMA local memory plus gated attentionlocal inductive bias while preserving content mixingEMA horizon and chunk boundaries matter
Retentiondecayed key-value state with parallel and recurrent formslow-cost decoding without a growing KV cacheretention horizon and normalization details matter
SSMstructured state or convolution kernellong sequence efficiencyparameterization and stability details matter
Selective SSMinput-dependent state updatecontent-aware recurrenceharder to compare with fixed linear SSMs
SSD / Mamba-2structured matrix mixer with recurrent and block algorithmsbridges SSM and attention viewsassumptions on matrix structure must be explicit

Protein and Long Sequence Use

SSMs are attractive for long biological sequences:

but a sequence model alone does not prove structure or function. For protein claims, check transfer tasks, family split, sequence identity, and whether structural context is included.

Paper Evidence Boundary

ClaimRequired Evidence
longer contextevaluation at long , not only theoretical scaling
faster than attentionwall-clock, memory, hardware, batch, and kernel details
better protein modeldownstream task, split, and baseline protocol
stable traininginitialization, discretization, normalization, sequence length
streaming inferencerecurrent state cache and reset/chunk policy

Practical Checks

  • Check whether the model is causal, bidirectional, or wrapped with extra context mixing.
  • Track the effective context length claimed by the implementation, not just the theoretical state.
  • Inspect how masks, padding, and variable-length sequences are handled.
  • For protein tasks, verify whether residue order alone is modeled or whether structure, contacts, or family splits are also used.
  • Are speed and memory claims measured on the same sequence length, hardware, and batch size?
  • Is Mamba or another selective variant separated from linear SSM assumptions?

Canonical Papers

PaperWhy It Matters
S4structured state-space kernel for practical long-range sequence modeling
Megamoving-average local sequence memory inside gated attention
Hyenagated implicit long convolution as a dense-attention-free sequence mixer
RetNetretention mechanism with parallel, recurrent, and chunkwise recurrent forms
Mambaselective state-space scan with input-dependent parameters
Mamba-2structured state space duality and a faster SSD/Mamba-style core layer