Home Tools Glossary Prompt Caching
Technique

Prompt Caching

LLM Prompt Caching

/prompt kash-ing/

An optimization technique that stores and reuses attention key-value states for recurring prompt prefixes to accelerate inference.

In plain English
Prompt caching is like keeping a textbook bookmarked on your desk. When users send the same system instructions or massive reference documents repeatedly, the AI skips re-reading them and starts generating answers instantly.
Real-world example
Caching a 50-page corporate legal policy prompt in API server memory across thousands of employee chat requests.
Technical definition
Prompt caching optimizes LLM serving latency and cost by persisting attention KV cache states for frequently accessed prompt prefixes (such as system instructions, codebases, or long document corpora) in GPU memory. Subsequent requests matching the cached prefix bypass redundant prefill computation phases, drastically cutting time-to-first-token (TTFT) and API costs.