R3 · STATE SPACE MODELS · MAMBAEXPLORINGMar–Oct 2026

Mamba and state space models vs transformers: where they help

THE QUESTION

When does a state space model's fixed-size memory beat a transformer's growing one: for an always-on agent, a fast live stream, or short texts on a phone?

Prabhakar Chandra
Founder, Bodham Labs
Updated

The idea in one picture

How a transformer and a state space model remember

Step 4 of 4: HybridOur hybrid design: the state space model runs the always-on loop, hard facts go to external memory, and a transformer is called only for hard decisions.

A state space model trades perfect recall for constant memory. That pays off on long streams, not on short texts — which is why our voice-memo app dropped it.

What did we build?

  • A GPU Mamba (S6) context model, running in a container on 11 Mar 2026.
  • Before that, a component we called an "SSM" that was in fact a GRU PPO actor-critic exported to OpenVINO. We ran a 3-config tournament: 2×256, 1×512 and 3×128.
  • A data integrity audit of the model's inputs.
  • A documented next design, "Mamba-4": a Micro-Jamba hybrid with 24–36M parameters planned. It is not built. Its status reads "PRE-DEVELOPMENT (Phase 0)".
  • The test bed was live market data streams, in paper mode only, with no real money.

What does the evidence show?

Values exactly as recorded. The source column says where each one was recorded.
WHATVALUESOURCE
Hidden state after 1,024 stepsabout ±10¹⁵data integrity audit, Mar 2026
GPU memory of the running S6 model396 MiBcontainer log, 11 Mar 2026
Raw EMA input values (not normalised)around 69,000data integrity audit, Mar 2026
One "z-score" input86.74data integrity audit, Mar 2026
How far it drowned out 14 other featuresabout 10¹³data integrity audit, Mar 2026
Features that were always zero3data integrity audit, Mar 2026
Earlier GRU hidden-state norm, n = 100 to 96,900constant at 1.3850model run log

How did the work unfold?

  1. Early 2026

    A recurrent model we called an SSM

    An early component labelled "SSM" was really a GRU actor-critic. Its hidden-state norm stayed at 1.3850 from step 100 to 96,900: the state was stuck, and the log showed it.

  2. 10 Mar 2026

    A hybrid design for an always-on agent

    A written trade-off for our RAMU agent: a state space model (Mamba or RWKV) runs the always-on loop, a transformer is called only for hard decisions, and hard facts go to external memory because an SSM's details fade.

  3. 10 Mar 2026

    A Mamba encoder with an actor-critic head

    A small PyTorch model: one Mamba block (d_model 128, d_state 64) feeding an actor-critic head. Code only; it was never trained, and we report no results from it.

  4. 11 Mar 2026

    The first GPU run, and why it diverged

    A Mamba (S6) model ran on live data streams in paper mode. Inputs were not normalised, and the hidden state reached about ±10¹⁵ within 1,024 steps.

  5. Late Mar 2026

    "Mamba-4": a staged design

    Nine design phases for a 24–36M-parameter hybrid: a Micro-Jamba core, Hopfield-style recall, sleep-time consolidation, BitNet compression, an MoE overlay and safety gates. Status: pre-development.

  6. 12 Oct 2026

    A shipped app says no

    Our voice-memo app, Mementos (codename), considered SSMs to save memory and dropped them: a model's memory is mostly its size, and an SSM only saves memory on very long texts. Memos are short.

Where has it led us?

  1. The model ran, but the inputs were not normalised. EMA values were around 69,000. The hidden state grew to about ±10¹⁵ over 1,024 steps and drowned out 14 other features. Three features were always zero.

  2. Our earlier "SSM" was not an SSM at all. It was a GRU. Its hidden-state norm stayed at exactly 1.3850 from step 100 to step 96,900, which means the state was stuck. Reading the norm in the log is what showed us.

  3. Neither failure tells us yet whether the model idea works. Both were found in the data and the logs. The lesson: check input ranges and the hidden-state norm before judging the model.

  4. The next design adds shadow-mode gates. If the model underperforms in shadow mode for two weeks, we revisit the architecture and do not go live. It is a staged evaluation, not a result.

  5. On a phone the question changed. A model's memory is mostly its weights, and an SSM's flat state saves memory only on very long texts. Voice memos are short, so our app dropped SSMs. The rule we keep: SSMs for long streams, not for short texts.

What is still open?

  • With normalised inputs, does a small Mamba model beat a simple baseline on the same stream?
  • Is a hybrid (some attention layers, some SSM layers, like Jamba) worth the extra complexity at 24–36M parameters?
  • How long a context does a fast stream actually need?

NEXT STEP · NOT DONE YET

What would we do next?

Normalise every input, log the hidden-state norm from the first step, and re-run the S6 model against a simple baseline before building Mamba-4.

Have a problem that needs this kind of research?

Tell us about it