AI inference glossary
Serving

KV cache

Also known as key-value cache, attention cache

In plain English

The KV cache is the model’s working memory for the current conversation. It keeps useful notes and avoids rereading everything for every new token.

Technical definition

The KV cache stores attention key and value states for tokens already processed, allowing each decode step to reuse them.

Engineering details

The cache grows with sequence length, batch size, layer count, and the number and width of stored attention heads. During decode it is repeatedly read from accelerator memory, so both capacity and bandwidth matter.

Why it matters

KV-cache pressure limits concurrency and long-context serving. Cache quantization, paged allocation, latent attention, prefix reuse, and disaggregated transfer systems all target its capacity or movement cost.

How to read it in InferenceX

InferenceX disables prefix caching for fixed-sequence comparisons on random data unless a recipe states otherwise, which keeps unrelated requests from receiving artificial cache hits. AgentX is the deliberate exception: its replayed sessions are built to reuse prefixes, so cache capacity, eviction policy, and offload are part of what the scenario measures.