arXiv:2608.27128cs.CLAug 2026

Manuscript Offprint

arXiv:2608.27128

TwinKV: A Composable Repair Pass for KV Cache Eviction via Pairwise Key Redundancy

Hong Chen, Yudong Zeng, Yongwei Huang, Zuhao Ouyang, Junyan Zhang, Xuming Hu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Long-context inference is bottlenecked by the memory footprint of the key-value (KV) cache, a constraint that is tightest for small models deployed under strict resource budgets. Existing KV cache eviction methods score tokens for removal using the model's own attention distribution, or, in attention-free alternatives, by each key's distance from a single global reference point. We show with a controlled leave-one-out probe that attention magnitude is only weakly related to a token's true causal contribution to the model's answer (Spearman ρ=−0.004\rho = -0.004), calling into question the premise behind the dominant family of eviction methods. We introduce TwinKV, a training-free, attention-free redundancy signal that measures whether a token's key has a near-duplicate elsewhere in the context. Rather than deploying this signal as another standalone eviction policy competing against existing methods, we use it as a composable repair pass: given the fixed retained set already chosen by an arbitrary existing eviction policy, TwinKV audits that choice for two structural failure modes – tokens evicted despite having no surviving duplicate (orphans, information genuinely lost) and tokens retained despite a duplicate already occupying another slot (redundant donors) – and swaps the two, holding the policy's own budget exactly fixed and never altering its underlying scoring rule. Composed with four recent eviction policies across four benchmark suites – LongBench's 16 official sub-tasks, LooGLE's 4 sub-tasks, the synthetic-retrieval benchmark RULER, and a short-context MMLU-Pro no-harm control – and compression ratios {0.3,0.5,0.7}\{0.3, 0.5, 0.7\}, this repair pass improves the wrapped policy on Qwen3-4B in a majority of evaluated configurations for two of the four policies, is close to even for a third, and helps only a minority of configurations for the fourth – an adaptive baseline already near a performance ceiling on several benchmarks – with the average improvement across the three non-ceiling policies smallest at the loosest ratio tested; that fourth policy's pattern reverses entirely on RULER for Llama-3.2-1B, where it wins at every evaluated cell because its Alone score there starts far lower and has genuine room to improve. Llama-3.2-1B is not uniformly harder for the repair pass: it shows a smaller average gain on LongBench but a higher fraction of improved cells on both LongBench and LooGLE than Qwen3-4B, and a clean win on RULER; we report this full, model-dependent picture directly, along with the specific task structure (few-shot classification exemplars) where the repair pass does not help on either model.

1 INTRODUCTION

Long-context inference exposes a memory bottleneck that grows linearly with sequence length: every new token appends a key and a value vector to the KV cache at every attention layer, and this cache routinely exceeds the size of the model's own parameters well before the context window is exhausted. The bottleneck is sharpest for the models best suited to on-device and other severely resource-constrained deployments. Small models have the least memory headroom to spare, yet under long-context use they carry the same per-token cache footprint as their larger counterparts, so the fraction of available memory consumed by the cache – not the weights – is what determines whether long-context inference is feasible at all.

KV cache eviction addresses this bottleneck by discarding a fraction of cached key-value pairs during prefill and retaining only a budget-constrained subset for the remainder of generation. Existing eviction methods score tokens by consulting the model's own attention distribution, either directly as accumulated attention mass toward each position (Zhang et al., 2023; Li et al., 2024b), as attention averaged over a pyramidal per-layer budget schedule (Cai et al., 2024), or through an attention-free recency-and-sink heuristic calibrated to approximate where attention concentrates in practice (Xiao et al., 2024). A separate line of work removes the dependence on attention weights directly, instead scoring each key by how far it sits from a single reference point, the mean key vector across the context, and treating keys that deviate most from this centroid as important (Park et al., 2025).

We begin from a direct empirical test of the premise shared by the attention-consulting family of methods: does the attention a token receives reflect its true causal contribution to the model's answer? We measure this with a leave-one-out marginal utility – how much removing a context chunk actually hurts the log-probability the model assigns to the correct answer – and compare it against the attention that chunk received during the original forward pass. Pooled across chunks and samples on a real long-context QA benchmark, the two are statistically indistinguishable from uncorrelated (Spearman ρ=−0.004\rho = -0.004, p = 0.96; Figure 1a, Section 2). Attention magnitude, in this setting, does not reliably identify which tokens the model actually needs to answer correctly.

This motivates an importance signal that does not route through attention at all. Our signal is structural: a token's information survives eviction, in the sense that the model can still recover it later, exactly when an equivalent copy exists elsewhere in the surviving context. A fact restated, paraphrased, or otherwise echoed more than once in a long passage can lose one of its copies without loss; a fact stated exactly once cannot. We operationalize this directly on key vectors: for each token, we count how many other, non-adjacent tokens have a near-duplicate key, measured by cosine similarity above a fixed threshold, and use this twin count as an inverse importance score. This redundancy signal, TwinKV, is training-free, uses no attention weights of any kind, and requires no task-specific calibration.

Because the signal is computed from the context alone, it needs no access to any other compressor's internal scoring rule – only the budget and the set of positions that compressor has already decided to keep. This makes it deployable not as another standalone policy competing against existing eviction methods, but as a lightweight repair pass applied after an arbitrary existing policy has already made its decision. Given that policy's retained set, TwinKV checks each evicted token for a surviving duplicate and each retained token for a redundant one, and swaps an unrecoverable eviction for a wasted retention wherever it finds a mismatch, holding the wrapped policy's own budget exactly fixed. Because every decision under this signal is a judgment about a token's uniqueness relative to the rest of the context rather than its distance from one fixed reference point, the resulting notion of importance is qualitatively different from anchor-based alternatives; Section 3 makes this distinction, and the repair mechanism itself, concrete.

Composed with four recent KV cache eviction policies across four benchmark suites (LongBench, LooGLE, RULER, and a short-context MMLU-Pro control) and compression ratios {0.3,0.5,0.7}\{0.3, 0.5, 0.7\}, this repair pass improves the wrapped policy on Qwen3-4B in a majority of evaluated configurations for two of the four (StreamingLLM, up to 64% of cells; PyramidKV, 57%), is close to even for a third (SnapKV, 41%), and helps only a minority of configurations for the fourth (ExpectedAttention, 16%), with the average improvement across the three non-ceiling policies smallest at the loosest ratio tested; ExpectedAttention is an adaptive baseline that is already near a ceiling on several benchmarks, leaving the correction with more room to disturb a good decision than to improve it. This pattern is consistent with the causal story above: attention-derived signals degrade fastest exactly where the eviction budget is tightest and every decision is load-bearing, so the structural gaps TwinKV repairs become more consequential as the budget shrinks, except where there is little structural gap left to repair. The strength of this effect is not uniform across model families, baselines, or task structures, and we report all of these boundaries directly rather than only the settings where it is strongest.

Our contributions are:

• We show, with a controlled leave-one-out probe on real long-context QA data, that attention magnitude is only weakly related to a token’s true causal contribution to the model’s answer, calling into question the premise shared by the dominant family of KV cache eviction methods.

• We introduce TwinKV, a training-free, attention-free redundancy signal that identifies prunable tokens through pairwise key-vector similarity rather than attention mass or distance from a single global anchor.

• We show this signal is naturally deployed not as a standalone scorer but as a composable repair pass: it detects when an arbitrary existing eviction policy’s retained set contains an unrecoverable gap alongside a redundant slot, and swaps the two, leaving the wrapped policy’s own scoring rule and budget untouched.

• We derive a rotation-invariant form of the redundancy signal for architectures using a non-uniform, per-dimension rotary schedule to extend context length (e.g. LongRoPE), where the raw post-RoPE key comparison conflates content redundancy with a position-dependent rotation term; the substitution we derive is provably invariant to this term regardless of rotary schedule.

• We validate the repair pass by composing it with four recent eviction policies across four benchmark suites, two model families, and compression ratios {0.3,0.5,0.7}\{0.3, 0.5, 0.7\}, showing it improves the wrapped policy in a majority of configurations for two of the four on the primary model (Qwen3-4B), is close to even for a third, and helps only a minority of configurations for the fourth (adaptive) baseline, with the advantage across the three non-ceiling policies smallest at the loosest ratio tested; we also report where and why it does not transfer uniformly – a smaller average gain but a higher fraction of improved cells on Llama-3.2-1B for LongBench and LooGLE, a clean cross-family reversal on RULER for the fourth baseline, and a few-shot-template failure mode on LongBench's TREC sub-task for both models.