What is an AI state space model?
A state space model is a sequence model that processes a sequence through a hidden state summarising the past, updating it each step linearly from the previous state and new input and producing output from it; rooted in control theory, it was adapted in deep learning for long sequences.
Unlike a recurrent neural network, which updates its state nonlinearly and has to train step by step, its linear update can be computed in parallel. A selective state space model makes this update input-dependent.
- Topic
- Machine learning, models and training
- Also known as
- SSM, structured state space model
How an AI state space model works
- The model is defined as a continuous-time linear system, then discretised for step-by-step processing.
- At each step the hidden state is updated by linear transformations of the previous state and that step's input; output is computed from the state.
- For time-invariant models training can run in parallel like a long convolution, selective ones using a parallel scan; at inference it runs as a step-by-step recurrence.
- A specially structured state matrix lets the model recall the distant past.
In more detail
Continuous and discrete equations and HiPPO initialisation
In a linear state space model the hidden state evolves in continuous time by a linear differential equation of itself and the input, with output read linearly from the state. For digital sequences this is discretised with a step size, often by zero-order hold, into a recurrence where each new state is a weighted sum of the previous state and the input. Initialising the state matrix with HiPPO theory keeps a polynomial projection of the input history instead of letting it decay exponentially.
Commonly confused terms
| Term | How it differs |
|---|---|
| Transformer | A Transformer compares every token directly with all prior tokens via self-attention (quadratic training cost and growing KV cache), whereas an SSM compresses the entire past into a fixed-size state vector (linear compute and constant memory, at the cost of lower exact-recall fidelity). |
Why an AI state space model matters for on-premises AI
With compute linear in sequence length and constant generation memory, state space models are an efficient in-house option for long time series, sensor streams and documents. They are established for time series. Used alone for language modelling they can trail attention-based models at recalling specific details, so they are tested on the organisation's own tasks before choosing.
To catch pre-failure patterns in high-frequency sensor streams from wind turbines, an energy company trains a state space model on in-house servers; it processes very long measurement sequences with constant memory.
Common questions
How does a state space model differ from a recurrent neural network?
Both keep a hidden state. A recurrent network updates it with a nonlinear function; a state space model's linear update can be computed in parallel during training.
Are state space models used in language models?
Yes, especially their input-dependent selective forms. They are efficient on long sequences; some models combine them with attention layers.
Related terms
- Selective state space model
- Recurrent neural network (RNN)
- AI Transformer
- Linear attention
- AI time series forecasting
- Long-context model
Sources
- Efficiently Modeling Long Sequences with Structured State Spaces, 2021
- HiPPO: Recurrent Memory with Optimal Polynomial Projections, 2020
In the glossary: Glossary, R to Z