KV Cache: The Context Length Memory Hog

The Key-Value (KV) cache, essential for LLM self-attention, grows linearly with input sequence length and concurrent requests, becoming a dominant memory consumer. For instance, a single 16K context request can consume over 40GB of memory, severely limiting on-device LLM capabilities for long conversations.

Sources

Open the full topic