Reproduce “PQCache: Product Quantization-based KVCache for Long Context LLM Inference” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Hailin Zhang, Xiaodong Ji, Yilin Chen, Fangcheng Fu, Xupeng Miao, Xiaonan Nie, Weipeng Chen, Bin Cui

PQCache introduces a Product Quantization-based KVCache management system for Large Language Models, reframing KVCache storage and retrieval as an embedding retrieval problem. This approach enables efficient inference with context lengths up to 128K tokens and beyond, achieving higher model quality compared to existing baselines while maintaining low, stable serving latency.

Key insights

  • Managing KVCache for long-context LLMs can be effectively framed as an embedding retrieval problem, allowing the application of sophisticated Approximate Nearest Neighbor Search (ANNS) techniques.
  • Product Quantization (PQ) can efficiently compress KVCache keys and enable rapid approximate retrieval of relevant key-value pairs from CPU memory without significantly compromising model quality.
  • Achieving efficient long-context inference requires a meticulous system-algorithm co-design, including asynchronous operations, overlapping computations, and multi-tier caching, to effectively hide the latency of KVCache offloading and retrieval.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.