atlas

Research map / Architectures and efficiency / Quantization

KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache

ICML 2024 · Architectures and efficiency › Quantization · approach: KV cache quantization

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes KIVI, a tuning-free asymmetric 2-bit KV cache quantization method (per-channel keys, per-token values, with a full-precision residual window) that cuts peak memory 2.6x and raises throughput 2.35-3.47x.

Problem

KV cache memory and loading costs become the bottleneck for batched LLM inference with long contexts, and prior KV quantization work rarely studied the element distribution needed to push below 4 bits.

Approach

Analysis shows key cache has fixed outlier channels (quantize per-channel) while value cache is best quantized per-token because attention sparsity confines error to important tokens; a grouped-plus-full-precision-residual split makes per-channel key quantization compatible with streaming decoding.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use 2bit KIVI instead of 16bit cacheLlama-2-7B · CoQAexact match accuracy: 63.88 -> 63.05No clear effect
Use 2bit KIVI instead of 16bit cacheLlama-2-7B · TruthfulQABLEU score: 30.76 -> 33.95Helped
Use 2bit KIVI instead of 16bit cacheLlama-2-7B · GSM8Kexact match accuracy: 13.50 -> 12.74No clear effect
Use 2bit KIVI instead of 16bit cacheFalcon-7B · GSM8Kexact match accuracy: 4.55 -> 3.41Hurt
Quantize keys per-channel and values per-token rather than both per-token (ablation)2bit fake KV cache quantization · CoQAscore: 52.93 -> 63.53Helped
Quantize values per-token rather than per-channel (ablation)2bit fake KV cache quantization · CoQAscore: 2.88 -> 63.53Helped
Increase group size from 32 to 64 (ablation)KIVI on Llama2-13B · GSM8Kaccuracy: 20.77 -> 21.00No clear effect
Increase group size from 32 to 128 (ablation)KIVI on Llama2-13B · GSM8Kaccuracy: 20.77 -> 17.29Hurt
Reduce residual length from 128 to 32 (ablation)KIVI on Llama2-13B · GSM8Kaccuracy: 20.77 -> 20.62No clear effect
Use a full-precision sliding window for recent key and value cache2bit KIVI · GSM8KaccuracyHelped

Surprising findings

Limitations

Experimental setup

Datasets: CoQA TruthfulQA GSM8K LongBench ShareGPT

Benchmarks: CoQA TruthfulQA GSM8K LongBench Needle-in-a-Haystack

Metrics: exact match accuracy BLEU F1 ROUGE classification score similarity score peak memory throughput

Baselines: FP16 baseline per-token 4bit KV quantization SmoothQuant FlexGen H2O StreamingLLM

Builds on: round-to-nearest quantization Hugging Face Transformers vLLM

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy