Fast and Adaptive Visual Memory for Video and World Models
Zhu et al. in Generative models
A video codec that stores where prediction breaks
Fast and Adaptive Visual Memory for Video and World Models
A complete video history has a growing price
At one minute, dense attention in a 33B video model needs 334 GiB of KV cache; the 18× result uses a separate 30-second Wan2.1-T2V-1.3B reference test.
Fixed-size summaries may lose distant detail; retrieval keeps history but exposes only selected frames or tokens to each generation.
The goal: cheap reads, complete access to the past.
CodecMem predicts each window, then stores the miss

It keeps the full sink frame, warps its previous reconstruction to predict each window, then stores tubelets where prediction error remains.
How the codec chooses what to remember
- 1
Predict from reconstruction
Flow warps the previous reconstruction; one first-frame estimate is reused for the four-frame window, assuming constant motion.
- 2
Score multiscale tubelets
Tubelets are spatial crops across a window; 32, 64, 128 and 256-pixel candidates compete by error removed.
- 3
Choose greedily, then stop
Greedily add the candidate that removes most error; stop at the cap or when the PSNR gate clears.
How the generator reads compressed visual history
- 1
Keep the live anchors
The sink frame and latest chunk stay dense; older history becomes codec tokens.
- 2
Encode selected crops
A frozen VAE's latents are cropped and pooled to one size; scale and position mark each token's coverage.
- 3
Attend to old context
Each new chunk reads the sink, old codec tokens and recent chunk; cached keys and values are reused.
Tubelets and scale cues both matter
Codec reconstruction ablation on 64 held-out SpatialVID clips; same Wan2.1-T2V-1.3B SFT setup.
Memory spending tracks how much video changes

Across 100 ten-second egocentric clips, x is mean pixel change and y is token share of dense attention. With no cap, median use climbs as content changes faster.
The benchmark isolates three kinds of visual memory

Retrieval rebuilds a marked 4-second clip from 60 seconds; tracking follows a hidden ball through more cup swaps than training; spatial memory renders a revisited 3D view.
Near-dense quality with fewer inference FLOPs
Table: compressed baselines match task budgets. FLOPs: Wan2.1-T2V-1.3B, 30-s history; counts include prefill, selection and 4 steps.
Robot policies can reuse the whole episode
On closed-loop RoboMME memory tasks, a Cosmos 3 Nano policy with 32 evenly spaced keyframes scores 28.8% average success.
With codec memory, the same policy scores 71.3%, ahead of RTP (48.6%) among WAMs; SimpleMemVLA scores 88.3% on the full public board.
The same memory helps preserve long-video continuity

Three causal Wan2.1-T2V-14B variants differ only in history, on 15-second clips. CodecMem beats the no-codec twin on temporal, visual and subject scores across segments, but trails both on text alignment.
Where this memory can waste or misallocate tokens
No long-term deduplication
Because prediction uses only the previous reconstruction, content that leaves and returns is encoded again.
Task-blind scoring
Greedy pixel-error scoring is task-blind; high-error detail may not matter to a later task.
Why it matters
- CodecMem's 1.5 average task rank leads 12 compressed-memory baselines.
- Use adaptive memory when redundant visual history still matters for future actions or generations.
- How should memory select future task-relevant details, beyond what prediction currently misses?
7 upvotes on Hugging Face 13 slides, 3 min
2 days ago