toolcall() ← all concepts

// concept · workflows

Only 16 of 64 layers keep a cache

Our KV cache video showed that every token of context costs memory. In some newer open models, most layers don't pay that bill. So the model you pick sets how fast long-context memory grows, before you touch a single setting.

// the layout

Qwen3.8-27B's model card:

Number of Layers: 64
Hidden Layout: 16 × (3 × (Gated DeltaNet → FFN) → 1 × (Gated Attention → FFN))

Its config lists 16 full_attention layers and 48 linear_attention layers. The 48 keep a fixed-size state that doesn't grow with the conversation. Only the 16 keep a per-token cache.

What it measured in Ollama's engine

Setup: Ollama v0.40.13's bundled engine, qwen3.8:27b (Q4_K_M, digest e118e4d12a70), CPU, default f16 cache, one sequence. Stock ollama run ran out of RAM on our 15 GB test box during the weight repack, so we ran the same engine with repack off, which doesn't change the cache.

Against an all-attention model

The same lab's older dense Qwen3-32B caches on all 64 layers (8 KV heads × 128 dims each). By its config that is 256 KiB per token, about 8 GiB at 32K. That figure is derived, not measured.

Why not make every layer fixed?

Because a fixed memory is bad at exact lookups. From the Kimi Linear paper, a second lab with the same 3:1 bet: linear attention models "struggle to precisely retrieve the entire history from a compressed, fixed-size memory state", and hybrids that keep "a few global-attention layers alongside predominantly faster linear layers" are "a practical compromise between quality and efficiency".

Sources: Qwen3.8-27B model card and config.json, Qwen3-32B config.json (Hugging Face); ollama.com/library/qwen3.8; Kimi Linear tech report (arXiv 2510.26692); our load test. Verified 2026-11-02.

One concept a week. Free.

The deeper, copy-paste version of each ToolCall short — in your inbox.

// total: 0.00 · spam: void · unsubscribe: one click