Reproduce “CommonKV: Compressing KV Cache with Cross-layer Parameter Sharing” 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

Yixuan Wang, Haoyu Qiao, Lujun Li, Qingfu Zhu, Wanxiang Che

CommonKV introduces a training-free method to compress the Key-Value (KV) cache in Large Language Models by employing cross-layer parameter sharing and adaptive merging. It achieves up to 98% KV cache compression when combined with other techniques, maintaining over 95% end-to-end performance on long-context benchmarks.

Key insights

  • While KV caches across adjacent Transformer layers exhibit notable dissimilarity, hidden states (inputs to the attention module) maintain a high degree of consistency.
  • The dissimilarity in KV caches primarily stems from differing layer-specific Key and Value projection matrices rather than the hidden states themselves.
  • Inducing consistency in the latent KV cache through cross-layer parameter sharing allows for more effective and less lossy merging, improving upon direct merging of dissimilar KV caches.

Summary by alphaXiv.

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