State Space Model (SSM)
A state space model (SSM) is a mathematical framework for sequence modeling, rooted in classical control theory, that represents a system through a compact hidden state vector that evolves over time according to fixed linear recurrence equations. Unlike the Transformer, which computes pairwise Attention scores across every position in a sequence (O(n²) in time and memory), SSMs process sequences recurrently with O(n) complexity, making them far more efficient on very long inputs. The Mamba architecture is the most prominent recent SSM, using a selective state space mechanism that allows the model to filter which information from the past is relevant—combining the expressive power once thought exclusive to attention with the linear scaling of recurrence.
Think of it like a ship's navigator using dead reckoning: instead of radioing every port simultaneously to triangulate position, the navigator maintains a single running log of speed, heading, and elapsed time, updating it step by step. The log is compact but sufficient to answer "where are we now?" without reviewing the entire voyage history at every moment.
A simplified SSM update reads: h_t = A * h_{t-1} + B * x_t; y_t = C * h_t, where A, B, and C are learned matrices. Mamba makes A and B input-dependent, giving the model dynamic control over what to remember. Hybrid architectures like Jamba interleave SSM and transformer layers to capture both local recurrent efficiency and global attention expressiveness.
SSMs compete directly with the Transformer and Self-Attention paradigm for long-context tasks; they share motivations with Context Window extension research and Mixture of Experts in trying to scale capacity without proportional compute. You will encounter them in papers on genomics, audio, time-series forecasting, and next-generation language models pushing beyond 100 000-token contexts.