Jargonautica
Making Models Smaller, Faster and Cheaper

Caching

Also called: Prompt Caching, KV Cache

Storing intermediate results so they do not have to be recalculated. If you send the same long set of instructions with every request, the system can remember the work it already did on that portion and skip straight to the new part. This cuts both cost and waiting time, often substantially.

Technical view

Key-value caching stores the attention keys and values for tokens already processed so that generating each new token does not require recomputing attention over the entire sequence. Prompt caching extends this across separate requests that share a common prefix, which is why placing static content such as system instructions and reference documents at the start of a prompt, with variable content at the end, materially reduces cost.


Part of AI Terminology Index, section: Making Models Smaller, Faster and Cheaper.

How it connects

Caching links to 21 other terms, and the 12 closest are drawn here. The faint lines are links between those terms. See it in the full graph.

InferenceInferenceContext WindowContext WindowLatency, Throughput and Time to First TokenLatency, Throughput…AttentionAttentionContinuous BatchingContinuous BatchingAutoregressive GenerationAutoregressive Gene…Speculative DecodingSpeculative DecodingGrouped Query AttentionGrouped Query Atten…Context EngineeringContext EngineeringPromptPromptMulti-head AttentionMulti-head AttentionPrefill and DecodePrefill and DecodeCaching