# state-spaces/s4

Structured state space sequence models

Repository: https://github.com/state-spaces/s4
Canonical: https://ross.abutalabs.com/products/s4
Language: Jupyter Notebook
License: Apache-2.0
License Family: permissive
Topics: state-space-models, sequence-models, pytorch
Last push: 2024-07-17T17:04:39+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 1764, "days_push": 777, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2919, forks 369 (observed 2026-08-28T04:07:30.148476+00:00)

## What it is
Official implementations of Structured State Space (S4) sequence models and related variants like S4D, HiPPO, and SaShiMi, built in PyTorch. It provides self-contained model layers, custom CUDA/KeOps kernels, and experiment reproduction code for research on long-sequence modeling.

## Use cases
- train state space models on long sequences
- reproduce S4 paper experiments
- use S4 layer in my own pytorch model
- model long-range dependencies in audio or text
- compare transformers with state space sequence models
- generate audio waveforms with SaShiMi

## When to choose
- you need efficient modeling of very long sequences (thousands to millions of tokens)
- you want the official, research-faithful S4/S4D implementations
- you're doing research on sequence models beyond transformers

## When to avoid
- you need a production-ready pip-installable library (packaging is still on the roadmap)
- you want a plug-and-play high-level API rather than research code
- you're unwilling to compile custom CUDA kernels or set up PyKeOps for best performance

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning, nlp, audio-processing
- domain: deep-learning, machine-learning
- platform: python, windows
- tags: state-space-models, sequence-modeling, pytorch, s4, research-code, hippo, time-series, natural-language-processing, audio, gpu, linux, macos

## Member repositories
- state-spaces/s4 (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:30.148476+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:34:00.791619+00:00, confidence not recorded.
  - readme: https://github.com/state-spaces/s4 (fetched 2026-08-28T04:07:30.148476+00:00, sha 55c169c4cbd9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
