Context ladder
holds upWhat does each context rung actually cost in resident memory, and where is the safe ceiling?
KV cache scales with layers x kv-heads x ctx, NOT with active parameters. Decode speed is identical at every rung, context costs memory, never throughput. UPDATED 23 Aug: gemma4-31b being worst-in-fleet (+9.6GB to 128k) is about ITS 16 KV heads across 10 full-attention layers, not the Gemma 4 family. gemma4-12b holds 262144, twice the context, in 12.07GB, and at 131072 costs 10.07GB against qwen3-8b's 22.7GB. A 12B dense at less than half the price of an 8B dense at the same window. Note the caveat: per-token predictions from config arithmetic missed in BOTH directions across this family (E2B on target, E4B 2.3x over, 12B 0.5x under), so the ladder is the fact and the arithmetic is not.
Since then. The memory ladder stands. 'Decode speed is identical at every rung' does not: it was measured with the window allocated but empty. With real context in it, decode falls 2.7x by ~15k tokens (11 Sep).
- Qualified by
- Benchmark tok/s figures are empty-context artefacts; real decode falls 2.7x with context
- Method
- Context-window ladder, find the safe ceiling by measuring, not by arithmetic.
- Source
- ctx_ladder.py Context-window ladder, find the safe ceiling by measuring, not by arithmetic.