Reasoning at Constant Memory: How a 4B Chinese Open Model Freezes the KV Cache at 72 MiB
From the publisher’s feed, collected in the ZeroLabs newsroom.
Inside EdgeRock-4B’s “Rock Memory Anchors” — and what they mean for anyone serving long-reasoning modelsEvery engineer who has served a reasoning model knows the moment. The model is good, the answers are right, and then someone sends a 64K-token agent trace and the GPU's memory graph turns into a staircase. Reasoning models think out loud, and every token they think costs KV cache.On October 19, 2026, a team from Rock Matrix (岩芯矩阵, a unit of Chinese listed company 岩山科技), working with researchers at HKUST and CMU, open-sourced a model that takes a different route. EdgeRock-4B keeps its attention KV cache fixed at 72 MiB per sequence, whether the context is 4K tokens or 256K. At 256K that is 99.1% less than the Qwen3.5-4B model it was converted from. The release got wide coverage in Chinese tech media (QbitAI/量子位, Sina Tech, BAAI Hub). At the time of writing, I couldn't find any English-language news coverage, only the model card and the arXiv report.The headline numbers are striking. The design behind them is more interesting, so this post walks through it, then the parts of the trade-off that the headlines leave out.The problem: KV cache is a linear tax on thinkingIn a standard Transformer, each generated token stores a key and a value vector in every attention layer, and later tokens attend to all of them. Memory grows as O(N) in sequence length. According to the EdgeRock model card, Qwen3.5-4B's configuration works out to 1,024 MiB of BF16 attention KV at 32K context and 8,192 MiB at 256K.Figure 1. Configuration-derived BF16 attention KV per sequence. Data: EdgeRock model cardEight gigabytes for one sequence is fine in a demo. It is ruinous in production, where you want hundreds of concurrent sequences on a single card. The usual fixes, such as paged attention, KV quantization, and offloading, make the tax cheaper but don't remove it.The radical fix has always been bounded-state models: RNN-style architectures like RWKV, Mamba, xLSTM, and RecurrentGemma that compress history into a fixed-size state. They solve the memory problem and have historically been poor at reasoning. In EdgeRock's own comparison of 16 bounded-state baselines, the best AIME 2024–2026 average was 18.8% (RWKV-7 G1j, 13.3B). EdgeRock-4B reports 82.9%.So the question is how they closed that gap.The architecture: three kinds of memory, all fixed-sizeEdgeRock is not trained from scratch. It is a conversion of Qwen3.5-4B, which is already a hybrid: 24 Gated DeltaNet (GDN) linear-attention layers plus 8 full-attention layers. EdgeRock keeps the 24 GDN layers and the feed-forward blocks. It replaces each of the 8 full-attention layers with a pair running in parallel: sliding-window attention (SWA) ∥ Rock Memory Anchors (RMA).Figure 4. Layer pattern and memory components. Diagram based on the model card and arXiv:2610.10118.This gives the model three complementary memories:Recurrent state (GDN). Fixed-dimensional matrices that hold a lossy, continuously updated summary of everything seen so far. Good for gist, bad for exact recall.Local attention (SWA). A 1,024-token ring buffer of exact KV. Handles recent token-to-token interactions precisely.Rock Memory Anchors. The new part. A fixed-capacity bank of learned key–value records that stay individually retrievable long after their source tokens have left the window.How Rock Memory Anchors workThe report describes RMA as a write–admit–read pipeline:Write. A learned writer produces a dedicated candidate KV record for each token. The record is not just the token's raw KV. The writer learns what is worth representing.Admit. A learned scorer rates each candidate. Every 256 tokens, each of the 4 KV groups compares the 256 new candidates with its existing bank, keeps the top 1,024 by score, and discards the rest.Read. Queries attend to the committed bank, which is combined with local attention through a query-dependent read and a signed gate. New records become visible from the next block onward.The key property is that kept records are stored separately and never modified. This is what sets RMA apart from a recurrent state, which blends everything into one matrix. An anchor for "variable x was set to 17 at token 3,000" survives intact at token 120,000, so the model can look it up directly instead of reconstructing it from a blurry summary.The ablation shows how much rides on this. On the team's distant-memory evaluation (256 contexts of 16K–130K tokens, 1,024 queries), the final model answers 94.1% of queries correctly. Disable RMA at inference and it drops to 0.4% (4 of 1,024). The recurrent state and window alone barely recover distant facts.The memory budget, line by lineBecause every component has fixed capacity, you can do the memory math on a napkin. The report spells it out: committed anchors take 2 (K and V) × 8 modules × 4 KV groups × 1,024 records × 256 head-dim × 2 bytes = 32 MiB. Pending candidates use the same formula with 256 records, giving 8 MiB. The 1,024-token window adds about 32 MiB. That totals 72 MiB of attention KV.Add the recurrent matrices and bookkeeping and the total persistent history is 97.76 MiB per sequence:Figure 3. Persistent history per sequence in the batch runtime. Data: EdgeRock model cardFor capacity planning, this changes the shape of the problem. You no longer size the cluster for the longest request you might see. Every sequence costs the same ~98 MiB of state on top of weights and workspace.What it buys you: throughputConstant per-sequence memory means far more sequences fit on one GPU, and per-token attention work stops growing with context. The team measured on a single Hopper 80GB GPU with BF16 weights and KV and ordinary autoregressive decoding (no speculative decoding):Figure 2. End-to-end output throughput (prefill included) at each model’s best measured batch size, 32K output tokens. Data: EdgeRock model cardA few numbers worth pulling out, all vendor-reported:32K in / 32K out: 12,124 output tokens/s at batch 512, versus 1,889 for Qwen3.5-4B at its best batch of 64. That is 6.42×. The mean ratio across the four input lengths is 4.94×.Single request, 128K in / 128K out: 233.7 decode tokens/s versus 151.3 (1.54×).Peak memory: a single 128K/128K request peaks at 16.02 GiB of GPU allocation. The batch-512 long-generation sweep peaks at 61.26 GiB.The flat EdgeRock line in Figure 2 is the architecture showing through. Competitors lose throughput as input grows because their KV grows. EdgeRock barely moves.One engineering detail is easy to miss. The team shares storage between the original and packed projection weights, which removes 4.95 GiB of duplicated weights. Per the model card, that saving is what makes batch 512 fit. Model architecture gets the headlines, but this kind of runtime work often decides whether the theoretical gain shows up in practice.What it costs: the honest partConverting full attention into fixed memory is not free, and the model card publishes enough to see where the costs land. Compared with its own Qwen3.5-4B backbone:AIME 2024–26 mean: EdgeRock-4B 82.9, Qwen3.5-4B 86.1GPQA-Diamond: EdgeRock-4B 64.6, Qwen3.5-4B 77.3LiveCodeBench v6: EdgeRock-4B 61.6, Qwen3.5-4B 75.7C-Eval: EdgeRock-4B 74.6, Qwen3.5-4B 84.0HellaSwag: EdgeRock-4B 64.9, Qwen3.5-4B 80.6MMLU-Pro: EdgeRock-4B 79.8, Qwen3.5-4B 77.7HumanEval: EdgeRock-4B 96.7, Qwen3.5-4B 86.0Math reasoning keeps 96.3% of the backbone’s AIME score, and some benchmarks improve. But science QA, competitive coding, and Chinese knowledge benchmarks drop by 9–16 points. On the distant-memory suite, variable binding is the weak spot: only 53.1% of contexts get all four answers right, compared with around 90% for exact retrieval.Ecosystem caveats matter too:The GGUF builds need a custom EdgeRock RMA backend. Stock llama.cpp and Ollama are not supported.MLX packages were functionally checked on Linux CUDA. Apple Metal is untested.Mobile (LiteRT-LM) builds are development previews, and Android validation is still in progress.All benchmarks come from the authors. None have been independently reproduced.Why this matters beyond one 4B modelEdgeRock fits a pattern that showed up in Chinese AI releases within the same week: moving memory out of the ever-growing KV cache. MemTensor’s MemT-1.0 (released October 20) folds conversation history into a fixed-size internal memory state and reports a 66× storage reduction versus full-context KV at 128K. DeepSeek’s newly open-sourced DeepInfer ships “SWA bounded replay” to avoid replaying long prefixes. The approaches differ, but they share one bet: for the next phase of long-horizon agents, the bottleneck is memory, not FLOPs.For practitioners, EdgeRock’s lesson is a design pattern you can reason about. Use a recurrent summary for gist, a short exact window for recency, and a small, learned, selective bank of untouched records for the details that matter. If your workload is high-concurrency long generation, like agent rollouts, RL sampling, or long chain-of-thought math, this trade-off may already pay off. If it depends on dense knowledge recall or competitive coding, benchmark carefully first.Try itpip install -U huggingface_hubhf download rockmatrix-ai/EdgeRock --local-dir EdgeRock --exclude 'evaluation_data/*' 'vision/*'cd EdgeRock && python -m venv .venv && source .venv/bin/activatepip install ./wheels/transformers-5.7.0.dev0-py3-none-any.whl -e .python -I run.py demo --prompt 'Solve 17 × 23, explaining your reasoning.' --max-new-tokens 2048(Commands from the official model card. The optimized Hopper path needs extra dependencies listed in the inference guide.)SourcesEdgeRock model card (benchmarks, memory tables, throughput): https://huggingface.co/rockmatrix-ai/EdgeRockTechnical report, EdgeRock: Strong Reasoning at Constant Memory: https://arxiv.org/abs/2610.10118Chinese coverage: Sina Tech / 创事记 (2026-10-19) https://finance.sina.com.cn/tech/csj/2026-10-19/doc-inivueum6160860.shtml ; BAAI Hub https://hub.baai.ac.cn/view/58862 ; Eastmoney https://wap.eastmoney.com/a/202610193900233129.htmlMemT-1.0: https://arxiv.org/abs/2610.26825DeepInfer: https://github.com/deepseek-ai/DeepInferAll figures were produced by the author from the data in the sources above. All performance numbers are vendor-reported.Reasoning at Constant Memory: How a 4B Chinese Open Model Freezes the KV Cache at 72 MiB was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.