# PatchKV: Weight-Space Compensation of KV Cache

DevFeed: [PatchKV: Weight-Space Compensation of KV Cache](<https://devfeed.tech/articles/patchkv-weight-space-compensation-of-kv-cache-132834.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2609.39329>)

Author: Chanryeol Lee, Chanhyuk Lee, Yeonwoo Choi, Donggyun Kim, Seunghoon Hong

Published: 2026-11-13T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [long-context](<https://devfeed.tech/topics/long-context.md>), [LLM Techniques](<https://devfeed.tech/topics/llm-techniques.md>), [LLM optimization](<https://devfeed.tech/topics/llm-optimization.md>), [LLM evaluation / benchmarking](<https://devfeed.tech/topics/llm-evaluation-benchmarking.md>)

Tags: [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [compression](<https://devfeed.tech/tags/compression.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [kv-cache](<https://devfeed.tech/tags/kv-cache.md>), [llms](<https://devfeed.tech/tags/llms.md>), [long-context](<https://devfeed.tech/tags/long-context.md>), [regression](<https://devfeed.tech/tags/regression.md>), [weight](<https://devfeed.tech/tags/weight.md>)

## AI overview

PatchKV aims to preserve quality under aggressive KV-cache compression by pairing an off-the-shelf compressed cache with a context-specific weight patch. At context-loading time, it computes the patch in closed form using ridge regression to align block-wise activations of context-derived reference queries under full and compressed caches. After merging the patch into the model, the authors report unchanged forward-graph structure and per-query inference cost for single-context, multi-query use. They report consistent improvements over cache-compression methods on long-context QA benchmarks (SCBench up to 170K tokens, SQuAD, and NIAH) and GSM8K, across three model architectures. The excerpt does not provide numerical results or detail the compression methods compared.

## Source excerpt

arXiv:2609.39329v4 Announce Type: replace 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.