PatchKV: Weight-Space Compensation of KV Cache
Chanryeol Lee, Chanhyuk Lee, Yeonwoo Choi, Donggyun Kim, Seunghoon Hong
Abstract
Long-context inference with Large Language Models (LLMs) is bottlenecked by the linearly growing memory of the key-value (KV) cache. Existing compression methods reduce the cache through token eviction or approximation, but degrade sharply at aggressive compression budgets. We propose PatchKV, a training-free framework that compensates KV cache compression methods by carrying part of the context in the model's weights. PatchKV pairs an off-the-shelf compressed KV cache with a context-specific weight patch, which is computed once at context-loading time and served for downstream queries for the context. The weight patch is derived in closed form via ridge regression, by aligning the block-wise activations of context-derived reference query tokens under the full cache and the compressed cache. Once merged into the model, the patch leaves the forward graph and per-query inference cost unchanged in the single-context, multi-query setting. Across long-context QA (SCBench with up to 170K tokens, SQuAD, NIAH) and math (GSM8K) benchmarks on three model architectures, PatchKV consistently improves cache compression methods, suggesting an alternative direction to compensate them at aggressive budgets. Code is available at https://github.com/cusasak/PatchKV.
Create a lesson
Metadata
- Comments
- NeurIPS 2026. Code available at: https://github.com/cusasak/PatchKV
Related papers
CrossGMN: Graph Metanetworks for Cross-Architecture Weight-Space Transformations
Shared title terminologycs.LGAdir Dayan, Yam Eitan, Haggai Maron
Local Affine Quantization for KV Caches: From Shared Ranges to Prediction Error
Shared title terminologycs.LGShrey Shah, Rohith Kukkala
PolicyPolish: LLM-Guided Weight Editing of Reinforcement Learning Policies for Dynamic RMSA in Elastic Optical Networks
Shared title terminologycs.LGMasayuki Shimoda
MLP Cache: A Post-Hoc Memory-Compute Trade-off for Transformer Inference
Shared title terminologycs.LGHuzheng Yang, Yiqiao Huang, Qingqiao Hu et al.
Learning interpretable Schur forms of recurrent weight matrices
Shared title terminologycs.LGAlexander Lanine, Liana Akobian, N Alex Cayco-Gajic
ReAgent: Closed-Loop Self-Healing for Open-Weight Tool-Calling Agents, from Structural Hallucinations to Decision Errors
Shared title terminologycs.LGCharlie Galvin, Katie Kitchen, Chiara Picardi