arXiv(opens in a new tab)cs.LGOct 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2610.11245

Read What Matters: Query-Adaptive Quantization for KV Caches

Siddharth Bhandari, Lucas Gretta, Krishna Balasubramanian, Shiva Kasiviswanathan

Abstract

KV-cache entries are stored before their future queries are known, but each decoding query needs precision in different places. We study this mismatch using separate budgets for retained bits and bits fetched per query. READKV stores each key and value in a progressive code whose prefixes support different reconstruction precisions. For each query, it allocates key-channel prefixes using the query, computes attention from the reconstructed keys, and then allocates value-token prefixes using that attention. Stored entries remain unchanged. Each stage optimizes a calibrated distortion objective under a fixed budget; we prove exact allocation under diminishing refinement gains and relate these objectives to attention-output error. We also exhibit a finite-dimensional attention family where query-dependent access strictly outperforms every query-independent reader at the same read budget, even with unrestricted competing encoders and decoders.

Across six base models, reading four bits on average from an eight-bit cache increases C4 perplexity by at most 0.66%, using about one quarter of the logical reads and half the retained capacity of a 16-bit cache. It is consistently more accurate than storing and fully reading four bits at the same payload-read budget. Retaining more bits than each query fetches is aimed at long-context decoding, where the cache bytes moved per step, rather than the weights, dominate cost. Long-context question answering and retrieval on two instruction-tuned models provide additional quality evidence. On the tested 8K-token, batch-one, single-layer workload on an NVIDIA A10G, a restricted eight-bit READKV reader with a two-bit mean payload-read budget has 39% lower latency than the tested TurboQuant codec.

1 Introduction

Long-context autoregressive language models maintain a key-value (KV) cache to avoid recomputing representations of earlier tokens. During decoding, each new query accesses this cache, and repeated reads can incur substantial memory traffic as the context grows. However, a query may depend primarily on a subset of key dimensions, and its attention may concentrate on a small fraction of value tokens. These observations motivate query-dependent reads that fetch the cache information needed at each decoding step.

We propose READKV, which separates stored bits per scalar, W, from average payload bits read per scalar, R. Its progressive representation lets each query choose how much precision to fetch while preserving unread detail for later queries. This design is motivated by the write-once, read-many structure of the KV cache. Retaining additional precision increases storage and insertion cost, but does not require every later query to fetch those extra bits. For an 8,192-token prompt followed by 128 decoding steps, storing eight bits while reading four, rather than storing and reading four, adds write traffic equal to just 0.79% of cumulative reads in the payload-only model of Appendix A. Stored precision and read volume therefore impose distinct costs. Decoding is often bound by memory traffic: each step moves the model weights once and each cached entry once per request. The bits fetched per entry thus set the cache traffic of a step, while the bits retained per entry set how many requests fit in memory and are served per step. A fixed-rate code couples the two, because every stored bit is fetched on every step; a progressive code decouples them, and at (8, 2) READKV's logical reads are about one quarter of its retained bits. The design therefore targets long contexts and large batches, where the cache rather than the weights dominates the bytes moved per step (Appendix A.6). Device latency also depends on selection, reconstruction, and temporary memory traffic.

Existing work reduces retained KV precision, varies stored precision using importance estimates, or selects cache features and tokens for the current query. READKV instead makes scalar reconstruction depth a query-time

Up to T - i later reads

Figure

Figure 1: Write-once, read-many KV-cache access. Token i's key and value vectors are stored once and may be read by up to T - i later queries. Fixed-precision quantization fetches the same full W-bit code each time. READKV stores a progressive W-bit code and lets each query fetch different prefixes under an average read budget R<WR < W; unread refinements remain available.

access decision while leaving the stored record unchanged. The closest systems precedent already combines precision tiers with selective bit-plane retrieval [Xie et al., 2025]. Section 6 distinguishes these approaches and Appendix B gives a more detailed comparison.

We formalize this distinction through separate storage and read budgets, as illustrated in Figure 1. We focus on the partial-read regime R<WR < W, where access decisions determine which information is fetched; R=WR = W permits full-record decoding. Our main contributions are as follows.

  • We formulate KV-cache compression with separate storage and read budgets. A cache entry is encoded before its future queries are known, and each query may fetch only a budgeted subset of the stored bits. This distinguishes retained capacity from transferred payload and enables direct comparisons between query-independent and query-dependent access.

  • We introduce READKV (Algorithm 1), which stores progressive key and value codes. The current query selects key prefixes; attention computed from their reconstructions selects value prefixes. Different queries can therefore use different precisions from the same stored entries without rewriting them.

  • We analyze why query-dependent access can help and how READKV allocates its read budget (Section 4). On two finite-dimensional families, READKV achieves strictly lower worst-case key-score and attention-output MSE, respectively, than every query-independent branching reader with the same read budget (Theorems 1 and 2). We then analyze READKV's allocation rule, which repeatedly assigns the next prefix bit to the key channel or value token for which it gives the largest predicted error reduction. Theorem 3 identifies when this rule is optimal for each stage and relates the resulting key and value objectives to the final attention-output error. Together, these results explain both why query-dependent reading can help and how READKV uses its read budget.

  • Across six base models, READKV (W = 8, R = 4) stays within 0.66% of uncompressed perplexity and has lower perplexity than fully reading a four-bit cache at the same payload-read budget. Question answering and retrieval on two instruction-tuned models show further quality-read tradeoffs. In a separate single-layer benchmark on an NVIDIA A10G, READKV (W = 8, R = 2) has 39% lower latency and 62–65% fewer DRAM read bytes than a fused quantized codec.

References (100)

Couldn't load all references. Reload the page to try again.