TL;DR
Large Reasoning Models think out loud using tens of thousands of tokens, causing their working memory (the KV cache) to balloon. Compressing this memory to extreme low-bit precision usually induces mathematical "amnesia," causing models to lose track of past steps, hallucinate calculations, and ramble endlessly trying to self-correct. AdaKVQ solves this by dynamically adjusting memory precision layer-by-layer based on how far back in the text each layer actually looks—preserving near-full-precision reasoning accuracy at an ultra-lean ~2.7 bits.
What Problem Does This Paper Address?
Modern reasoning models—like OpenAI-o1 and DeepSeek-R1—solve tough problems by generating massive Chain-of-Thought sequences. As a sequence grows, the model stores previous Key and Value (KV) states in a KV cache so it doesn't have to recompute them at every step. However, this cache grows linearly: a 32B model processing 33k tokens across a batch of 32 needs roughly 130 GB just for the cache, throttling memory capacity and bandwidth.
A standard fix is quantization: shrinking 16-bit floating-point numbers down to compact 4-bit or 2-bit integers. Existing static quantization methods (like KIVI or KVQuant) keep a tiny sliding window of recent tokens at full precision and aggressively compress everything older. While fine for casual chat, this breaks complex reasoning. If a model slightly misremembers a number calculated 500 steps ago due to 2-bit rounding errors, the entire proof collapses. Worse, the model often senses the contradiction and triggers self-correction loops, generating more tokens and ironically defeating the efficiency gains of compression.
Methods
Instead of treating every layer identically, the authors measure how far back each layer reaches using Average Attention Distance (AAD)—the attention-weighted average distance between the current query token and the historical keys it attends to.
Guided by AAD, they propose AdaKVQ, a tuning-free, three-tier hierarchical memory system for each layer:
- Full-Precision Cache (FP16/BF16): A small fixed buffer (e.g., the most recent 128 tokens) capturing immediate local context without error.
- Adaptive High-Precision Cache (8-bit Keys / 4-bit Values): A dynamically sized middle tier that expands or shrinks on the fly to protect critical medium-to-long-range history.
- Compact Low-Precision Cache (2-bit Keys and Values): Aggressive compression for everything else that falls outside the active retrieval span.
Because attention distances fluctuate wildly from token to token, shrinking the middle tier too hastily could permanently corrupt states needed two steps later. AdaKVQ smooths AAD over time using an Exponential Moving Average (EMA), scales it with an inflation factor to cover maximum reach, and clamps it between safe minimum and maximum bounds. Under the hood, custom Triton kernels fuse dequantization directly with PagedAttention.
Datasets
AdaKVQ requires no training and is evaluated across:
- Complex Reasoning & Coding: AIME 2024–2025 (competition math), MATH 500, GPQA-Diamond (graduate-level science proofs), and LiveCodeBench (unseen competition coding problems from early 2025).
- Retrieval & Throughput: Needle-in-a-Haystack (NIAH) at 32K context length, and synthesized ShareGPT workloads for throughput benchmarking. No new benchmarks are introduced.
Key Insights and Ideas
- Layer-wise retrieval is starkly non-uniform: Shallow layers act like local grammar checkers, attending almost exclusively to adjacent tokens. Deeper layers act as global aggregators, reaching thousands of tokens back—and expanding or contracting their reach dynamically depending on the reasoning step.
- Bad memory makes models verbose: Static 2-bit quantization doesn't just tank accuracy; it induces "algebraic hallucinations" (like retrieving corrupted intermediate values) that trap reasoning models in confused "Wait, something is wrong..." self-correction spirals, inflating sequence length.
- Keys are far Touchier than Values: Ablations reveal that dropping Key precision in the adaptive tier from 8-bit to 4-bit noticeably hurts math accuracy, whereas Values comfortably tolerate 4-bit compression alongside 8-bit Keys.
Key Results
Tested on DeepSeek-R1-Distill models (Llama-8B, Qwen-7B, 14B, and 32B), AdaKVQ consistently beats static 4-bit and 2-bit baselines (KIVI, KVQuant, RotateKV, KVTuner):
- Near-Lossless Accuracy at ~2.7 Bits: On R1-Qwen-14B, AdaKVQ achieves 63.69% average accuracy across all four benchmarks at an effective 2.7-bit cache width—nearly matching BF16 (64.73%) while outperforming 4-bit RotateKV (61.74%) and 2-bit KIVI (55.41%). On R1-Qwen-7B, it even slightly edges out BF16 (54.93% vs. 54.63%).
- Shorter, Cleaner Chains of Thought: On R1-Qwen-14B (AIME), 2-bit KIVI increased generation length by 8.31% while losing 11.67 accuracy points; AdaKVQ reduced generation length by 12.08% relative to KIVI-2bit (and 4.78% vs. BF16).
- 4.38× Throughput Boost: On ShareGPT workloads with R1-Qwen-7B on an 80GB A800 GPU, shrinking the cache lets AdaKVQ scale to much larger batch sizes, hitting up to 4.38× higher token throughput than BF16 under comparable peak memory.
Limitations and Future Work
While the authors do not include a formal limitations section, two practical boundaries emerge from their ablations and setup:
- Irreversible Demotion Risk: Once a token page is demoted to the 2-bit tier, its precision loss is permanent. Although EMA smoothing, hard lower bounds, and prompt-page protection mitigate premature demotion, extreme sudden shifts in retrieval span could still hit low-precision states.
- Bit-Width Floor: Attempting to push the compact tier down to 1-bit (
UINT1), or high-precision Keys down to 2-bit, introduces non-negligible accuracy drops. For future scaling, the authors note that AdaKVQ's throughput gains are expected to grow further with longer generation lengths and larger batch sizes.
Summary updated