Frontier Foundry

State Space Models

The Workshop · Model Architectures

Recurrent-style architectures (Mamba, RWKV) with constant memory per token.

Also called: state space model, SSM, Mamba, RWKV, hybrid architecture, recurrent architecture. In the glossary.

How it works, as a machineThe Counting House with One Ledger Page · streams

Follow one stream from a ten-thousand-token page to an answer read from one state, in a night counting house with one ledger page and a tape feeder.

  1. Wind the tape in
  2. Choose what to write
  3. Fold the writes
  4. Overwrite the ledger
  5. Read the answer back
Play State Space Models

State Space Models in plain words

A state space model reads text one token at a time and keeps a fixed-size running summary instead of looking back at everything. Memory use stays constant however long the input grows. That makes very long sequences cheap, at the risk of forgetting details the summary did not keep.

An analogy

A ship's navigator keeping a position by dead reckoning. Each hour one line in the log is updated from speed and heading, and nobody rereads the whole voyage. The log stays one line long across an ocean, and whatever was not folded into that line is gone.

How State Space Models connects

4 typed relations in the knowledge graph

Builds on

  • Efficient Attention: The attention layer cache is the hybrid fix: a few full-attention layers among efficient ones.
  • Long Context: The ledger is the other answer to a long window: one fixed state in place of a cache that grows with the page.

Built on by

  • Efficient Attention: The fixed-size state tank is the same idea as a recurrent state: constant memory, finite recall.

An alternative to

  • Transformers & Attention: Both turn a sequence into its next step: one carries a running state, the other looks back at everything.

See State Space Models in the knowledge graph

What the sources say

2 parts · 13 sources · updated 2026-11-27

A state space model reads a long input once, token by token, and keeps one fixed-size state instead of a growing cache: compute grows linearly and memory stays constant. The price is a lossy memory, so early details can be overwritten; the sources show hybrids that keep a few full-attention layers to carry long-range retrieval, and that serving the state is its own hazard.

The tape and the write gate: how a long input is read once

A transformer lets every token look at every other, so cost grows with the square of the length. A state space model reads the tape once and, at each token, decides what to write into a small memory. Because the update is linear, the writes can be folded together in parallel.

  1. The token tape feeder winds a long input in one token at a time, with no look back at the page.
  2. The write gate board picks what each token writes into memory and how hard it overwrites.
  3. The parallel scan rig folds the writes together in parallel, because the update is linear.
5,000 to 10,000 visual tokens
Tokens on one long document page in a document-reading system whose speaker explains why a state-space backbone fits long pages; reported by the speaker Krishna Prasad Srinivasan
up to 7x
How much costlier later tokens can be to generate than earlier ones on frontier open-weight models with a growing context; reported by the paper authors Hugging Face
  • In a transformer every token looks at every other token, so compute grows with the square of the sequence length and memory grows with it. Krishna Prasad Srinivasan
  • A state space model keeps a single state and updates it token by token, so compute grows only linearly and memory stays constant. Krishna Prasad Srinivasan
  • Recurrence brings the cost of reading more data down to sub-quadratic or near-linear, but only in theory until it can be run in parallel on GPUs. Ramin Hasani

The ledger and the recall desk: what one fixed state can and cannot hold

The state is the whole memory: one slab per stream, whatever the length. Reading back from it is lossy, so a detail from early in the tape can be gone. The sources fix this by keeping a few full-attention layers (a hybrid), and warn that serving the state has its own silent failures.

  1. The state ledger keeps one fixed-size state, rewritten token by token, so memory stays constant.
  2. The recall desk reads the answer back from the state alone, so an early detail can be gone.
  3. The attention layer bay keeps full attention in a few layers, which carry long-range retrieval.
up to ~6x
Inference throughput of a large hybrid Mamba-attention model against publicly available models of similar accuracy; reported by the model authors Hugging Face
1M tokens
Context length of a 550-billion-parameter hybrid after pretraining on 20 trillion tokens; reported by the model authors Hugging Face
80% convolution, 20% attention
Layer mix of a small hybrid model made for CPUs: mostly gated convolutions plus some attention; reported by the lab's founder Ramin Hasani
up to 1.43x
Gain in standard decode for large hybrid models when the state is rebuilt from recent inputs instead of written back every step; claimed by the authors, reported by a newsletter AINews
1 in 1,000 requests
How often a silent gibberish failure in a hybrid model's serving engine showed up; reported by the engineers who found it Yuval Belfer
  • A document model chose a state-space backbone for long pages and accepted somewhat lossy recall to avoid the compute cost a transformer would impose. Krishna Prasad Srinivasan
  • In hybrids, long-range retrieval is mainly carried by the full-attention layers; the efficient layers shape how training proceeds. Hugging Face
  • Larger sliding windows in the efficient layers can delay the formation of retrieval heads in the full-attention layers, an effect the authors call Large-Window Laziness. Hugging Face

When it breaksThe linear memory that forgot the far end. A lab built on continuous-time recurrent nets linearized them so they could scale and run in parallel. Applied to language, the state-space versions had trouble learning dependencies at long context: they computed efficiently, but their expressive power fell short of transformers. Latent Space

Open questionDoes a model need a very long context, or is a short one with frequent compaction enough?

  • A very long context is worth building: a hybrid with a one-million-token context suits long-running autonomous agent tasks. Hugging Face
  • Frequent compaction keeps task accuracy with short contexts, so long-context models may be unnecessary and a memory of compacted state could do instead. Hugging Face

Sources

13 in all

More in Model Architectures

The Workshop: the whole area
  • Transformers & AttentionThe attention-based architecture behind nearly all modern LLMs.
  • Mixture of ExpertsModels where a router sends each token to a few specialist sub-networks.
  • Efficient AttentionAttention variants that scale better with length (sparse, linear, latent).
  • Diffusion Language ModelsText models that refine a whole draft in parallel steps instead of writing left to right.
  • Small Language ModelsCompact models that are cheap to run and good enough for many tasks.
  • Looped TransformersTransformers that run a block of weight-shared layers several times per token, adding depth (more reasoning per token) without adding parameters; shipped in Inkling 2 Mini and GLM-5.4 in Nov 2026.
  • Decision Models (System One)Small 'System One' models that only decide, classify, route or score with typed outputs instead of writing text; cheap, fast building blocks inside agent systems (Jev, OpenAI Decisions API).