Switch language한국어
Back to the list

KV Caching in LLMs

TL;DR AI

Key summary

2 min read
  1. KV caching speeds up LLM decoding by reusing past key and value tensors instead of recomputing them at every step.

  2. The first token is still slower because the prompt must go through a prefill phase before its states can be cached.

  3. This improves response latency, but the tradeoff is significantly higher GPU memory use per request.

  4. That memory cost affects scalability and serving economics for models like ChatGPT, Claude, and Qwen 2.5 72B.

  5. Related optimizations such as grouped-query attention, multi-query attention, and paged attention help manage these costs.

Read the original