SSM (State Space Model) models sequences with a linear recurrence:
ht=Aht−1+Bxt,
yt=Cht, with fixed state size independent of sequence length; Mamba adds input-dependent selective scanning (using
Δt to gate what enters and leaves the state), reaching
O(n); linear attention (RWKV) replaces
QKT with a kernelized form, equivalently collapsing into constant-size state recurrence; hybrid architectures (e.g. Jamba) stack full attention layers and SSM layers alternately.