AI Grimoire

Inference / kv-cache

KV cache

Autoregressive decoding is not compute-bound; it is bound by moving cached keys and values. Shrinking that cache, sharing it across heads, paging it, or reusing it across requests are all the same optimisation approached from different sides.

3 entries, 1 of them a stub.

Entries

04.01.1
Multi-Query Attentionstale
Single shared K/V head across query heads to shrink the decode cache.
O(n·d)
04.01.2
Paged KV Cachestubstandard
Virtual-memory paging applied to the attention cache.
O(1)
04.01.3
Prefix Cachingstandard
Reuse KV blocks across requests that share a prompt prefix.
O(1)