When KV Cache Outweighs Model Weights in Memory

For long-context LLM inference, the KV cache can become the dominant memory consumer, surpassing the model's static weights. For example, a Llama 70B model with a 1M token context can require approximately 135 GB for its FP16 KV cache, easily exceeding the model's own parameter memory. At 128K context with 8 concurrent users, the KV cache can be 2.4x the model size.

Sources

Open the full topic