Where Does the Picture Live in a Hybrid Mamba Model?

We opened a hybrid vision-language model to find out where an image lives while the model talks about other things. The answer surprised us: the model's huge recurrent memory only looks like one. It retains almost nothing about the image beyond a few tokens; what looks like memory is the attention cache re-supplying the picture at every step.

Vizuara Research · August 2026 · 14 min read · or watch the 8‑minute film

Show a model a photograph. Let the conversation drift for a paragraph or two. Then ask what was in the picture.

For a transformer this question is easy, because a transformer never lets go of anything: every token it has read, including every patch of the image, sits in its attention cache as a key-value entry that any later step can look at. The picture is not remembered so much as still there.

Hybrid models make a different bargain. Zamba2-VL-7B, the model this article opens up, has 81 decoder layers, and every one of them carries a Mamba2 mixer, a recurrent layer (explained from scratch in the appendix) that compresses whatever it reads into a fixed block of 458,752 numbers. Each new token partially overwrites that block. Only 13 of the 81 layers also carry attention. This design is why such models promise constant-memory inference, and it raises a basic question: while the conversation drifts, where does the picture live?

We spent under $30 of rented GPU time finding out, and this article walks through the answer in the order we found it. First, the model's own weights tell us how fast its recurrent memory must fade. Second, when we actually measure that memory, it holds far more of the picture than the weights allow, which should be impossible. Third, one deletion experiment resolves the contradiction, and settles where the picture really lives.

A picture enters a model with two kinds of memory

One diagram explains everything that follows, so it is worth thirty seconds. As tokens stream in, the attention layers append one key-value entry per token and keep all of them. The recurrent layers hold a state of fixed size: the same 458,752 numbers per layer at every position, rewritten at every token. Watch what happens to the image in each channel.

The two memories, side by side. The attention cache grows and keeps the image's entries; when the question arrives they are still there. The recurrent state stays the same size, and every filler token rewrites part of it, so what the image wrote fades. The question is whether it fades on the schedule the weights dictate.

A linear probe reads what each memory actually holds

This measurement is easy to get wrong, so the design of the experiment matters. Our basic trial has three parts in a row: a COCO photograph, which becomes roughly 400 visual tokens; then a stretch of neutral filler text whose length d we control; then an eight-way question about the picture, such as which object it showed.

Just before the question is processed, we read the recurrent state with a linear probe. A linear probe is the simplest possible reader: a classifier that computes a weighted sum of the numbers in the state and predicts the answer from that sum alone, with no other computation. We train it on some trials and test it on held-out ones. If even this simple reader recovers the answer, the answer is present in the state in an easily readable form. The widget below shows the idea; drag the slider to see what distance does to the reading.

How the probe reads the state. Left: the recurrent state, drawn as a grid of numbers; blue is what the image wrote, gray is what later text wrote over it. The probe multiplies each number by a learned weight and adds the results into a score for each of the eight candidate answers. Drag the slider: as the filler text grows, the image's trace decays, and the probe's scores flatten toward the 12.5% chance rate. The percentages are the real measurements from the 7B model.

Two design choices prevent false positives. The eight candidate answers are fixed within a block of trials and each is correct exactly once, so the chance rate is exactly 12.5% and a probe cannot beat it by learning the dataset's habits. And every experiment carries a control probe placed before the image: if the instrument is clean, that probe must read exactly chance. It does, at every model scale we tested.

How one trial is built. The model reads an image, then d tokens of filler text, then an eight-way question about the image. As a control, we also probe the state at a point before the image was shown. That state contains no information about the image, so if this control probe scored above the 12.5% chance rate, it would mean our setup was leaking answers in some other way. It scores exactly 12.5%, so the setup is clean.

At the moment of writing, the state knows the gist

Start at distance zero, the instant the image has just been read. We ask the state three kinds of question, always with the same method: an eight-way multiple choice with its own candidate list, read by its own linear probe trained exactly as above. Which object is in the picture, with eight object names as candidates. How many of a named object, with eight counts as candidates. And where a named object sits, with eight regions of the frame as candidates.

The state answers only the first one well. A probe across all 81 layers reads the object's identity at 83.1% against the 12.5% chance rate, and the best single layer, layer 64, reads 92.5% on its own. The probes for count and position, trained the same way on the same trials, barely beat chance.

What the state can answer at the instant of writing. Identity is easy to read. Count and position are barely above chance. The state records a gist, not a photograph.
Identity read from each layer's state alone. The signal strengthens through the depth and peaks at layer 64 with 92.5%. Ticks under the axis mark the 13 layers that also carry attention.

The weights say that gist must fade within a few tokens

Now let text flow past the image. In our trials this is the filler: the d tokens of neutral prose between the image and the question. Every one of those tokens partially overwrites the recurrent state, so the gist must fade. How fast? Here the architecture does something unusual: it tells you in advance. The Mamba2 recurrence updates each head's state as

S ← S · eΔA + write

The multiply is the only operation that ever removes information, and both of its ingredients are inspectable: A is a stored weight, and the gate Δ can be measured on ordinary text. So each of the model's 9,072 state heads has a half-life, ln 2 / (|A|·Δ̄), in tokens, computed from the checkpoint with nothing fitted to any decay curve.

What a 6.6-token half-life means. Whatever a median head writes is halved every 6.6 tokens of subsequent text. By 32 tokens, about a line and a half of prose, 3% of the trace remains.
Half-lives of all 9,072 heads, computed from the weights. The median is 6.6 tokens and 85% of heads fall below 32. The 2.7B and 1.2B siblings have the same shape with medians of 2.9 and 2.6, so a short horizon is a property of the family, not of one checkpoint.

So the weights predict a memory measured in single-digit tokens. And when we probe the state at increasing distance, the reading does sink, at every model scale, in roughly the predicted shape. But look at where the curves settle.

Identity decoded from the recurrent state against distance, at three model scales, 120 trials per point. The readings fall fast, as the weights predict, and then stop well short of chance. Sixty-four tokens after the image, every scale still reads roughly twice the 12.5% chance rate.

Sixty-four tokens is around ten half-lives for a typical head, and ten half-lives leaves a thousandth of the original trace. So at that distance the probe should find essentially nothing. Instead it identifies the object a quarter of the time. Either the arithmetic is wrong, or something is refilling the state.

But the state stays readable long after it should be empty

Here is a test that can tell those two possibilities apart. Every one of the model's 9,072 heads has its own predicted half-life, so we can sort them. We call a head fast if its half-life is short, around two tokens: its state should empty almost immediately. We call a head slow if its half-life is long, around sixteen tokens: it should hold information the longest. Then we probe the fast group and the slow group separately. If the state genuinely retains the image, the fast heads should lose it first, and whatever signal survives at long distance should be carried by the slow heads.

Before running this test, we have to deal with a complication, because it fooled us at first. Recall that a head's half-life depends on two numbers: the decay weight A and the gate Δ. The gate does double duty. It sets how fast the head forgets, and it also sets how strongly the head writes into its state. A head with a large gate therefore forgets faster and writes harder, by about a factor of seven across the model. Why does writing harder matter? Because a head that writes with larger numbers leaves a stronger signal in its state, and a stronger signal is easier for a probe to read, regardless of where the information came from or how old it is. So sorting heads by half-life also, accidentally, sorts them by signal strength. When we first did the naive sort, the fast heads read better than the slow ones, the opposite of the decay prediction. That reversal had nothing to do with memory. It was the write strength.

The fix is to compare only heads that write equally hard. We keep the heads whose gate Δ falls in a narrow middle band, so their write strengths are nearly equal, and within that band we split by the decay weight A alone. This still gives a fast group and a slow group, which we call the fast and slow strata, and their predicted half-lives still differ sevenfold: 2.3 tokens against 16.4. But now the only meaningful difference between the two groups is how fast they forget.

Why the naive split lies, and how the matched split fixes it. Each dot is a head. Its position shows how fast it forgets; its size shows how hard it writes. In the naive split (step 1), the fast group is also the group of big writers, and big writers give the probe a stronger signal whatever they contain, so the readout comes out reversed. In the matched split (step 2), we keep only heads of similar dot size and split them by the decay weight alone; the reversal disappears and the ordering follows decay. The percentages are the real readings at 64 tokens.
How to read this chart. The two solid lines are measurements: what the probe decodes from the slow heads (blue) and from the fast heads (pink) at each distance. The dashed line is not a measurement. It is a calculation: where the fast heads' reading would fall if it came only from what they genuinely retain, given their 2.3-token half-life. That calculated line hits the 12.5% chance floor within ten tokens. Now compare the two pink lines. The measured one stays far above the calculated one all the way out, ending at 26.6% at 64 tokens, twice chance. The solid lines being ordered blue-above-pink is what decay predicts; the size of the gap between the pink lines is what decay cannot explain.
At 64 tokens the fast heads still read 26.6%, twice chance. Their own decay leaves 4 parts in a billion of what the image wrote. A two-token head cannot be holding something written sixty-four tokens ago. Something else must be supplying it, live.

This is the central finding of the work. The ordering of the strata follows the weights, so the decay calculation is measuring something real. The amount that survives is off by nine orders of magnitude, so what the probe reads at distance cannot be retention. Something else must be writing the image into the state, over and over, long after the image has passed.

Delete attention's copy, and the impossible memory vanishes

Only one component of this model still holds the image at distance: the attention cache. So we ran the deletion that separates storing from relaying. Each trial runs twice, identically. In one run, at the exact instant the image ends and before a single filler token is processed, we delete the image's key-value entries from all 13 attention layers. The recurrent state is never touched, and at the moment of the cut it is identical in both runs. If the state stores the picture, the readout downstream should not care.

The eviction, and what it does to the fastest third of heads at 32 tokens. Delete attention's copy of the image and the probe's reading on the recurrent state collapses from 51.6% to 7.8%, below the 12.5% chance rate, even though the recurrent state itself was never modified.

Falling below chance tells us something specific. The heads were not merely degraded by the deletion; they are now reading out whatever the filler text wrote instead of the image. So whatever identity signal a probe finds in those heads at distance was arriving from the attention channel, freshly, at every step.

Could the deletion just be breaking the model?

There is a fair objection to the deletion experiment. Deleting entries does not only remove the image: it also makes every attention cache shorter, and it changes how attention distributes its focus over the entries that remain. Maybe the probe's reading collapsed because we damaged the machinery, not because we removed a memory.

Here is the experiment that settles it. Run the deletion twice, on the same trials. In one version, delete the image's entries, exactly as before. In the other version, delete the same number of entries from the same caches, but delete text entries instead of image entries. Both versions do identical mechanical damage: same number of entries gone, same shorter caches, same disturbance to attention. So if damage were the explanation, both versions should push the reading down.

That is not what happens. The two deletions move the reading in opposite directions. Deleting the image's entries pushes it down, below chance. Deleting text entries pushes it up, above the no-deletion baseline, most likely because the text was competing with the image for the model's limited bandwidth, and removing it leaves the image easier to relay. Damage cannot push a reading up. The animation below shows the two versions with the real numbers.

Same amount of deletion, opposite results. Both runs delete the same number of entries from the same caches. Deleting the image's entries drops the fast stratum's reading from 52.6% to 30.2%. Deleting an equal number of text entries raises it to 66.2%. If the deletions were merely damaging the model, both bars would fall. (Numbers: gain-matched fast stratum, distance zero, 192 trials per condition.)
The same result across all heads, grouped by half-life (32 tokens after the image). Read this chart vertically: at every x position, compare each line with the gray no-deletion line. The blue line sits above gray everywhere (the blue band): deleting text raises the reading. The pink line sits below gray (the pink band): deleting the image lowers it. All three lines also slope downward to the right; that is just because slower heads read less at this distance in every condition, and it is not the comparison that matters here.
The weights predict which heads depend on the relay. At matched write strength, evicting the image costs the fast stratum 22.4 points and the slow stratum 9.4, a 2.4× ratio in the direction the decay calculation predicts: the faster a head forgets, the more it depends on the relay.

Swap the two memories, and the answers follow attention

One experiment remains, the most direct one. Run the model on two different images, pause both runs at the same point, and physically exchange one memory channel between them. Then let the first run answer its question and see whose picture it describes.

Swap the entire recurrent memory, all 81 layers, all 37 million numbers of it, and nothing happens: the model answers from its own image in 100 trials out of 100, as if the transplant had never occurred. Swap attention caches instead and there is a cliff: at seven of the thirteen layers, the model switches to describing the other run's image in 94 trials of 100.

The splice. Exchanging every recurrent state changes nothing; the host keeps answering from its own image. Exchanging seven attention caches flips the answer to the donor's image.
Whose image does the host describe after the swap? Verified swaps, 100 pairs per condition. Swapping the recurrent states has no effect on any answer; swapping the attention caches flips the answer almost completely once seven layers are exchanged.

Why does swapping 37 million numbers change nothing? The relay result already answers this. A transplanted state decays away within a handful of tokens, and is then rewritten from the attention channel, which the swap never touched. The two experiments agree on one mechanism.

The recurrent state is a relay, not an archive

It is not a memory of the image. It is a working summary of the image's gist, held for a few tokens at a time and continuously refreshed from the attention channel, which is the only place the picture durably lives. The state looks like a memory to a probe only because the relay keeps restocking it. Delete attention's copy, and the appearance of memory disappears with it.

6.6
tokens of median half-life, straight from the weights
26.6%
what fast heads still read at 64 tokens, against the 4/109 their decay permits
7.8%
the same heads once attention's copy is deleted: below chance
100/100
answers unmoved by replacing all 81 recurrent states

This finding matters for a common optimization. An image adds hundreds of key-value entries to the attention cache, which makes vision-language models expensive to serve. A large body of work therefore speeds them up by deleting most of those entries, a technique called pruning. The justification is that the entries appear redundant: on standard benchmarks, you can delete many of them and accuracy barely moves.

Our results explain why pruning looks safe, and when it stops being safe. On this model, keeping a quarter of the visual entries costs almost nothing, at every distance we tested. Prune harder than that, though, and the model has to fall back on its recurrent state to fill the gap. Near the image this works, because the state is still holding the picture's gist. But the state forgets within a few tokens, so the further the question sits from the image, the less there is to fall back on. This is why the cost of heavy pruning is not one number: it roughly triples between a question asked immediately after the image and one asked 512 tokens later.

What pruning is, and what it costs. Pruning deletes some of the image's key-value entries from the attention cache, immediately after the image is read. The strips at the top show the four conditions we tested, from keeping every entry to deleting them all. The chart then shows the model's own answering accuracy (no probe involved) for each condition, against how far the question sits from the image. Keeping everything, or even just one entry in four, is flat: distance costs nothing. Keep less than that and the penalty grows with distance: at 5% kept, it roughly triples between an immediate question and one asked 512 tokens later.

The film

The whole argument in eight and a half minutes, narrated over animations.

Where this sits in prior work

The premise that a fixed-size state must eventually lose information is not ours. Jelassi et al. prove transformers can copy exponentially longer strings than state-space models; related lines show state tracking and in-context retrieval are the specific gaps, and that most of the quality gap between efficient architectures and attention is recall. What those results compare is architectures from the outside. What was missing is what happens inside one deployed hybrid: when it forgets, what it keeps while forgetting, and which component actually fails.

Established before this work

  • A fixed-size state must lose information from context; capacity proofs and behavioural gaps.
  • Recurrent models underperform at copying and retrieval as a class.
  • Visual tokens and key-value entries carry prunable redundancy.

New here

  • When: a retention horizon in tokens, computed from the weights with nothing fitted, at three scales.
  • What survives: the loss is content-selective; identity outlives count and position.
  • The mechanism: the recurrent channel relays rather than stores, shown causally inside one model.
  • The consequence: pruning's safety margin shrinks with distance, and the weights say for whom.

What this does not show

Appendix: how the architecture actually works

This article leans on one piece of machinery, the Mamba2 recurrence inside a hybrid decoder stack, so here it is from the beginning. You do not need this section to follow the argument above, but it explains where the half-life formula comes from, and where the two memories physically live.

The stack: 81 layers, two kinds of machinery

Zamba2-VL-7B is a tower of 81 decoder layers, and a token passes through them in order, bottom to top. Every one of the 81 layers carries a Mamba2 mixer with its own recurrent state. At 13 fixed depths (layers 6, 11, 17, 23, 29, 35, 41, 47, 53, 59, 65, 71 and 77) the layer additionally runs ordinary attention. This is the whole hybrid design: recurrence everywhere, attention at a thin sprinkling of depths. The two memories the article keeps comparing are exactly these two pieces of hardware. Watch what one token does to each of them.

One token crossing the stack. The pulse visits all 81 layers in order. Every layer rewrites its fixed-size recurrent state in place: the state row lights up but never grows. Each of the 13 attention layers appends one key-value entry for the token: those columns grow with every token read and are never rewritten. Everything in the article follows from this asymmetry.

Inside one layer: a state and four quantities

Between tokens, a Mamba2 layer carries a single block of numbers called the state, written S. The state is the layer's only memory: whatever the layer wants to remember about everything it has read so far must be stored in those numbers. In Zamba2-VL-7B each layer's state is split into 112 independent heads, and each head keeps its own 64×64 matrix; that is 112 × 64 × 64 = 458,752 numbers per layer, and 9,072 heads across the 81 layers.

When the next token x arrives, the layer computes three of its four working quantities from the token itself, and reads the fourth out of the checkpoint:

The dataflow of one layer, one token. The token fans out into the gate Δ, the write content B and the readout C; the decay weight A never changes, which is why the forgetting schedule can be computed from the checkpoint alone. The state first shrinks by eΔA, then receives the write Δ·x·B, and the output is read through C without changing anything.

The update, token by token

Step one is forgetting: the whole state is multiplied by eΔA, a number between zero and one, which shrinks everything the head currently holds. Step two is writing: the new content Δ·x·B is added on top. Then the output is read with C, which changes nothing. The animation below shows one head doing this, token after token.

One head, step by step. Each incoming token first shrinks everything in the state (the multiply), then adds its own contribution (the write). Older content never gets removed in one go; it just keeps shrinking until it is negligible. This is why a Mamba2 head cannot hold anything forever: the multiply happens on every single token, no exceptions.

The half-life: forgetting speed, read off the weights

Now the key point for this article. Because the shrink factor eΔA is applied once per token, surviving k tokens means being multiplied by it k times. The fraction of a memory that remains decays exponentially, and it falls to one half after exactly ln 2 / (|A|·Δ̄) tokens. That is the half-life used throughout this article. Both numbers in the formula are knowable in advance: A is stored in the checkpoint, and the average gate Δ̄ can be measured on ordinary text. Try the sliders below to see how the two numbers set the forgetting speed.

The half-life explorer. Drag the sliders to set a head's decay weight |A| and average gate Δ̄, or load one of Zamba2's real head profiles with the buttons. The curve shows how much of a memory survives after each token; the marker shows the half-life. Every head in the model has its own pair of these numbers, which is how the whole forgetting schedule of Section 2 was computed from the checkpoint alone.

Reproduce it

All of the code is public: github.com/VizuaraAI/visual-memory contains every instrument, experiment, figure, and paper source, plus this website. Every number comes from a scripted experiment on public checkpoints and public data, and the instruments read each checkpoint's geometry from its own configuration, which is what let the same code run at three scales.

lab/          instruments: telemetry, dynamics, probes, splice
analysis/     decoding and statistics
figures/      every figure, each function returning what it drew
results/      raw JSON and feature archives
paper/        the paper sources

Model: Zamba2-VL-7B (Apache-2.0) with its 2.7B and 1.2B siblings. Trials from COCO val2017. Total compute under $30 of rented H100 time. Extended paper · conference version.