RoCoKV: Uncertainty-Aware KV Cache Compression for Faster Inference

RoCoKV compresses reasoning model KV Cache with uncertainty and redundancy awareness, achieving real speedup on vLLM.
RoCoKV tackles the linear KV Cache growth in large reasoning models' long chains of thought, which are filled with redundant loop and self-verification tokens. It introduces two complementary mechanisms: uncertainty-guided adaptive pruning that adjusts compression strength by model confidence, and redundancy-aware token selection that lowers retention weight for tokens similar to recent reasoning. Co-designed with vLLM via a fused three-stage CUDA decoding kernel as a plug-and-play plugin while preserving paged KV layout and CUDA graph capture, it achieves 1.27x speedup and 38% throughput improvement on AIME25 with DeepSeek-R1-Distill-Llama-8B.
Large reasoning models generate long chains of thought, and during this process the memory footprint of the KV Cache grows linearly with sequence length, becoming a major bottleneck for inference serving. However, these reasoning trajectories are filled with redundant tokens produced by loops, self-verification, and corrections—tokens that have low utility yet may receive high attention scores, making them difficult for traditional compression methods to remove without harming reasoning quality. RoCoKV proposes a KV Cache compression scheme targeting this pain point, and through co-design with the serving stack, converts it into real end-to-end speedup.
The Dilemma of Redundant Tokens and the Compression Approach
The chains of thought generated by reasoning models are not always efficient. The model may repeatedly confirm the same conclusion, wander down incorrect paths before correcting itself—the tokens produced in these processes contribute little to the final answer. But attention mechanisms do not naturally distinguish "useful" from "redundant"—a repeated low-information token may receive high attention weight due to its position or contextual associations. Pruning the KV Cache directly by attention scores can easily delete content critical to reasoning coherence.
RoCoKV's starting point is precisely to circumvent this contradiction: rather than relying solely on attention scores to judge token value, it re-evaluates which tokens are worth keeping from two dimensions—model confidence and content redundancy.

KV Cache and Paging Mechanism
KV Cache is the core structure in autoregressive inference that caches the Key/Value tensors of historical tokens to avoid redundant computation; its GPU memory usage grows linearly with the length of the generated sequence. PagedAttention, introduced by vLLM, borrows the idea of virtual memory paging from operating systems, dividing the KV Cache into fixed-size blocks allocated on demand, thereby mitigating memory fragmentation and supporting prefix sharing and continuous batching. This layout means that "deleting the cache of some tokens" is no longer a simple contiguous memory truncation but involves fine-grained management at both the block and token levels—which is exactly why compression algorithms must be compatible with the paged layout.
Two Core Mechanisms: Uncertainty and Redundancy
Uncertainty-Guided Adaptive Pruning
RoCoKV's first component dynamically adjusts compression strength based on the model's output confidence. When the model is in an uncertain phase—for example, facing a complex sub-problem and needing to explore multiple reasoning paths—the algorithm allocates more memory budget and retains more complete KV information; when the model exhibits high confidence and the reasoning path is converging, it applies stronger pruning. The core insight of this adaptive strategy is that "critical moments" in the reasoning process require richer contextual support, while smooth progression phases can tolerate more aggressive compression.
Redundancy-Aware Token Selection
The second component targets repetitive content in reasoning trajectories. RoCoKV identifies tokens highly similar to recent reasoning content and lowers their weight in retention decisions, thereby encouraging the model to keep tokens with greater information content and diversity. This mechanism directly addresses the redundancy caused by loops and self-verification—similar reasoning fragments are no longer mechanically retained simply because they have high attention scores.
Why Attention-Score Pruning Fails
Common KV Cache compression methods (such as sliding-window-based approaches, H2O-style heavy-hitter retention, or attention-score Top-k) rely on cumulative historical attention as a proxy for token importance. But this proxy is unreliable in chain-of-thought scenarios: tokens from looped confirmations and self-repetition accumulate high scores because they are repeatedly attended to, while their actual information gain is low; meanwhile, some premise tokens that appear only once but are crucial to subsequent reasoning may instead receive low scores. By introducing two orthogonal signals—confidence and redundancy—RoCoKV essentially replaces a single attention statistic with "whether the current reasoning state needs more context" and "whether this token has already been covered by recent content," thereby correcting this proxy bias.
Co-Design with the Serving Stack: From Algorithmic Savings to Real Speedup
Compression at the algorithmic level alone is not enough to bring actual speedup to inference serving. RoCoKV was deeply co-designed with the vLLM serving stack: it developed a fused three-stage CUDA decoding kernel and integrated it into vLLM as a plug-and-play plugin, while keeping its paged KV layout and CUDA graph capture mechanism unchanged. This means RoCoKV's algorithmic savings can be directly converted into end-to-end throughput gains without sacrificing the optimization features already present in the serving framework.
This co-design is the key that distinguishes RoCoKV from purely academic compression methods. Many KV Cache compression studies stop at offline metrics, whereas RoCoKV incorporates kernel implementation, memory layout compatibility, and serving framework integration into a single design loop.
CUDA Graph Capture
CUDA Graph records a sequence of GPU kernel calls as a static computation graph and replays it as a whole, thereby eliminating the CPU scheduling overhead of launching each kernel individually—this is especially important for the many small operators in the decoding phase. Inference frameworks typically fix tensor addresses and shapes at graph capture time, but KV Cache compression dynamically changes the number of tokens involved in computation, which can break graph capture or cause fallback if not handled properly. RoCoKV integrates while keeping the CUDA graph capture mechanism unchanged, meaning its pruning decisions must be completed under a capture-friendly static structure—this is one of the key constraints on its engineering feasibility.
Experimental Results: Accuracy and Throughput Win-Win Under Constrained Budgets
The research team conducted extensive experiments on three reasoning benchmarks and two reasoning models. Under constrained KV Cache budgets, RoCoKV consistently improves reasoning accuracy and outperforms current state-of-the-art KV Cache compression methods.
When deploying DeepSeekAd-R1-Distill-Llama-8B on vLLM, RoCoKV achieved 1.27x speedup and 38% throughput improvement on AIME25, the hardest evaluation reasoning benchmark; on a long synthetic benchmark it reached 1.43x speedup and 45% throughput improvement, compared against the Full-KV baseline. These data show that combining uncertainty awareness with redundancy awareness not only preserves reasoning quality but also unlocks substantial performance gains in real serving scenarios.
Implications for Reasoning Model Serving
RoCoKV's approach reveals a notable trend: KV Cache compression is shifting from generic "one-size-fits-all" strategies toward customized designs tailored to the characteristics of reasoning workloads. The chains of thought of reasoning models have statistical characteristics distinct from ordinary dialogue—long-tail distributions, phase-wise confidence changes, local repetition—and these characteristics provide additional signal dimensions for compression algorithms.
At the same time, RoCoKV's plugin-style integration path shows that for a compression algorithm to coexist with a production-grade inference framework, it must be designed under engineering constraints such as memory layout and computation graph capture. Algorithmic innovation and serving stack co-design are both indispensable. For service providers deploying reasoning models, solutions like this that balance accuracy and throughput offer more practical reference value than research that purely pursues compression ratio.
One-line Summary
RoCoKV compresses reasoning model KV Cache with uncertainty and redundancy awareness, achieving real speedup on vLLM.
Paragraph Summary
RoCoKV addresses the problem that in large reasoning models' long chains of thought, the KV Cache grows linearly with sequence length and is filled with redundant tokens from loops and self-verification. It proposes two complementary mechanisms: uncertainty-guided adaptive pruning dynamically adjusts compression strength based on model confidence, retaining more context during exploration and pruning more aggressively during convergence; redundancy-aware token selection lowers the retention weight of tokens highly similar to recent reasoning content, encouraging retention of tokens with greater information content. To convert algorithmic savings into real speedup, RoCoKV is deeply co-designed with vLLM, developing a fused three-stage CUDA decoding kernel and integrating it as a plug-and-play plugin while keeping the paged KV layout and CUDA graph capture unchanged. Experiments show that under constrained budgets its accuracy outperforms existing methods, and on DeepSeek-R1-Distill-Llama-8B it achieves 1.27x speedup and 38% throughput improvement on AIME25.
Related articles

Prompt Engineering for Beginners: From Writing Prompts to Engineering Thinking
Starting from the essence and four functions of prompts, this article systematically explains the six-step process, four success criteria, learning value, and practical limitations of prompt engineering to help you build a complete understanding.

Anthropic Launches Nasdaq IPO: AI Giant's Listing and Risk Disclosures
Anthropic officially launches its Nasdaq IPO under ticker ANT, with market valuation expected to potentially exceed SpaceX's record. The prospectus devotes nearly 100 pages to AI risks, while first-half revenue grew over 14x but net losses widened sharply, reigniting the AI bubble debate.

Rust cURL Clone Uses 4,832 unsafe Blocks—Is the Memory Safety Myth Broken?
A Rust cURL clone uses 4,832 unsafe keywords, challenging Rust's memory safety narrative. We analyze what unsafe really means, compare Fil-C, and examine rewrite motives.