KV Cache Quantization
What is KV Cache Quantization?
In one sentence: KV cache quantization stores the KV cache in fewer bits to save memory.
Instead of keeping keys and values in 16-bit, they are compressed to 8 or 4 bits. This lets you fit longer contexts or more users in the same memory, usually with a small quality cost.
What does KV Cache Quantization look like?
Switching the KV cache to 8-bit can roughly double the context you can fit.
Why does KV Cache Quantization matter?
It is an easy way to run longer contexts on limited hardware.
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/kv-cache-quantization/">KV Cache Quantization, explained simply</a> (The AI Math Dictionary)