ParisKV: Fast and Drift-Robust KV-Cache Retrieval for Long-Context LLMs
Yanlin Qi, Xinhang Chen, Huiqiang Jiang, Qitong Wang, Botao Peng, Themis Palpanas
TL;DR
ParisKV addresses the dual challenges of drift-robustness and latency in KV-cache retrieval for long-context LLMs. It introduces a GPU-native, drift-insensitive two-stage retrieval pipeline that normalizes and rotates queries/keys onto a unit hypersphere, uses data-independent centroids for collision-based pruning, and then reranks with calibrated 4-bit quantized codes, fetching final KV entries on demand via UVA. The approach yields strong accuracy, often matching or exceeding full-attention quality, and delivers substantial throughput and latency improvements—up to $2.8\times$ faster decoding within the runnable range and up to $17\times$ and $44\times$ latency reductions over state-of-the-art baselines at million-token scales. This work enables scalable, long-context inference with maintaining accuracy while reducing GPU memory pressure and data movement, facilitating practical deployment of very-long-context LLMs.
Abstract
KV-cache retrieval is essential for long-context LLM inference, yet existing methods struggle with distribution drift and high latency at scale. We introduce ParisKV, a drift-robust, GPU-native KV-cache retrieval framework based on collision-based candidate selection, followed by a quantized inner-product reranking estimator. For million-token contexts, ParisKV supports CPU-offloaded KV caches via Unified Virtual Addressing (UVA), enabling on-demand top-$k$ fetching with minimal overhead. ParisKV matches or outperforms full attention quality on long-input and long-generation benchmarks. It achieves state-of-the-art long-context decoding efficiency: it matches or exceeds full attention speed even at batch size 1 for long contexts, delivers up to 2.8$\times$ higher throughput within full attention's runnable range, and scales to million-token contexts where full attention runs out of memory. At million-token scale, ParisKV reduces decode latency by 17$\times$ and 44$\times$ compared to MagicPIG and PQCache, respectively, two state-of-the-art KV-cache Top-$k$ retrieval baselines.
