KV Cache: Linear VRAM Growth, Quadratic Compute Burden

The KV cache, crucial for LLM efficiency, demands VRAM that scales linearly with sequence length and batch size (e.g., Llama 3 70B needs ~43GB for 128K context for a single user), while the attention mechanism relying on it incurs a quadratic computational cost for full self-attention, creating a dual challenge for GPU resources.

Sources

Open the full topic