← Lab
kvmemory
confirmedPython · CPUInference, serving & evaluationJuly 6, 2026
the question
How does the KV cache grow with context, and when does it overtake the weights?
what came out
28 KB/token for the 1.5B, 12 KB/token for the 0.5B, validated against the actual key-projection tensor, not estimated. A footnote at short context (0.06x weights at 2k) but it scales to model-size memory by long context. All three pre-registered predictions held; the config KV dim matched the tensor exactly.
method & receipts
- Result: confirmed
- Pre-registered: the prediction was written down and committed before the run.
- Reproducible: one script re-runs the whole thing from scratch.
- Adversarial self-review: my own skeptic's pass over each claim, kept in the repo.
- Machine-readable claims: every reported number, in a checkable file.
- Tested: a correctness/benchmark suite ships alongside the code.
→ read the code and re-run it
github.com/v-code01/kvmemory