ThinKV: Thought-Adaptive KV Cache Compression for Efficient Reasoning Models

Akshat Ramachandran (NVIDIA), Marina Neseem, Charbel Sakr, Rangharajan Venkatesan, Brucek Khailany, Tushar Krishna

International Conference on Learning Representations 2026 · Oral

Overview

The talk introduces ThinKV, a novel algorithm-system co-design framework engineered to optimize the KV cache for Large Reasoning Models (LRMs). Traditional Large Language Models (LLMs) typically generate outputs token by token, resulting in moderate output lengths and manageable decode-time memory overhead. However, the emergence of LRMs, which are trained to perform multi-step logical reasoning through explicit "chains of thought," has dramatically changed this landscape. These models generate lengthy intermediate reasoning tokens, often tens of thousands long, leading to a phenomenon called long output context generation and significantly ballooning KV cache sizes.

Watch on SlidesLive

Visual summary for ThinKV: Thought-Adaptive KV Cache Compression for Efficient Reasoning Models by Akshat Ramachandran, Marina Neseem, Charbel Sakr, Rangharajan Venkatesan, Brucek Khailany, Tushar Krishna
Visual summary for ThinKV: Thought-Adaptive KV Cache Compression for Efficient Reasoning Models by Akshat Ramachandran, Marina Neseem, Charbel Sakr, Rangharajan Venkatesan, Brucek Khailany, Tushar Krishna

Key moments

  1. 0:00 Introduction: Large reasoning models and KV cache growth
  2. 2:00 Challenges of LRM compression: token importance and fragmentation
  3. 3:00 ThinKV's core insight: Three distinct thought types
  4. 4:00 Thought-adaptive quantization and eviction policies
  5. 4:55 Identifying thought types using attention sparsity
  6. 5:30 Continuous Thinking Kernel: System design for lazy eviction
  7. 6:00 ThinKV performance results: memory savings and throughput gains
  8. 7:40 Q&A: Clarifying attention sparsity for transition thoughts

ThinKV: Thought-Adaptive KV Cache Compression for Efficient Reasoning Models

Speakers: Akshat Ramachandran (NVIDIA); Marina Neseem; Charbel Sakr; Rangharajan Venkatesan; Brucek Khailany; Tushar Krishna

Conference: ICLR 2026

YouTube: https://slideslive.com/39062069

Overview

The talk introduces ThinKV, a novel algorithm-system co-design framework engineered to optimize the KV cache for Large Reasoning Models (LRMs). Traditional Large Language Models (LLMs) typically generate outputs token by token, resulting in moderate output lengths and manageable decode-time memory overhead. However, the emergence of LRMs, which are trained to perform multi-step logical reasoning through explicit "chains of thought," has dramatically changed this landscape. These models generate lengthy intermediate reasoning tokens, often tens of thousands long, leading to a phenomenon called long output context generation and significantly ballooning KV cache sizes.

ThinKV addresses the critical challenge of KV cache growth in LRMs by proposing a thought-adaptive compression and eviction strategy. Unlike prior KV cache compression techniques primarily focused on long input contexts, ThinKV specifically targets the unique characteristics of LRM outputs. It leverages a deep understanding of LRM reasoning dynamics to differentially compress and evict tokens based on their inferred "thought type," ultimately achieving substantial memory savings and throughput improvements without significant accuracy degradation.

This work is particularly pertinent for the efficient deployment and scaling of advanced AI models that engage in complex, multi-step reasoning. By tackling the memory bottleneck associated with long reasoning chains, ThinKV enables higher batch sizes and lower inference costs, pushing the boundaries of what is economically feasible for state-of-the-art reasoning AI. The co-design approach, integrating algorithmic insights with system-level modifications, represents a significant step forward in optimizing the entire inference pipeline for these specialized and increasingly powerful models.

Background

▶ Watch: Introduction: Large reasoning models and KV cache growth (0:00)

The landscape of large language models has evolved considerably, with a recent shift from models that directly generate answers to Large Reasoning Models (LRMs). These LRMs are specialized LLMs, often trained via reinforcement learning or supervised fine-tuning, to explicitly perform multi-step logical reasoning. Instead of direct answer generation, LRMs generate extensive chains of thought, which can span tens of thousands of tokens. This intermediate reasoning is crucial for their problem-solving capabilities but introduces a significant memory challenge: the accumulation of these tokens in the KV cache during auto-regressive decoding.

Historically, the ML community has predominantly focused on optimizing for long input contexts, such as document Q&A, repository-level code understanding, or dialogue. Most existing KV cache compression techniques, like SnapKV or RocketKV, were developed with these scenarios in mind. They often overlook the distinct requirements of long output context generation characteristic of LRMs. The talk highlights a profiling exercise showing that for models like DeepSeek-R1-Distill-Llama and DeepSeek-Coder, generating 32,000 tokens with a batch size of 16, the KV cache size becomes prohibitively large. Even advanced techniques like Multi-Query Attention (MQA) and Grouped-Query Attention (GQA), while reducing KV cache redundancy, do not sufficiently mitigate this growth for long output contexts.

Compressing LRMs presents unique challenges compared to traditional LLMs. Firstly, the importance of tokens and their progression in LRMs is highly non-linear. A token deemed low importance at one stage might become critically important later in the reasoning chain. Existing techniques might prematurely evict such tokens, leading to irretrievable loss of crucial information. Secondly, these prior methods often treat all tokens uniformly, failing to account for the differential importance of various parts of a reasoning chain.

Beyond these algorithmic challenges, KV cache compression at decode-time introduces a systems-level problem: internal memory fragmentation. When tokens are evicted from the KV cache, they leave "memory holes" that cannot be easily filled by subsequent, newly generated tokens. These new tokens are allocated fresh memory locations, effectively negating the memory savings from eviction. While some works attempt gather-based compaction to coalesce these fragmented locations, this operation is often memory-intensive and falls on the critical path, increasing the time per output token and hindering overall throughput. ThinKV emerges as a solution to these multifaceted challenges, proposing a training-free, decode-time algorithm-system co-design approach specifically tailored for LRM KV cache compression.

Key Findings

▶ Watch: ThinKV's core insight: Three distinct thought types (3:00)

ThinKV's core innovation lies in its ability to understand and exploit the internal reasoning dynamics of Large Reasoning Models (LRMs). The key findings can be summarized as follows:

  1. Decomposition of Thought Types: LRM chains of thought can be robustly decomposed into three distinct categories: Reasoning, Execution, and Transition thoughts. Initial analysis using keyword matching (e.g., "think," "approach" for reasoning; mathematical/code syntax for execution; "wait" for transition) confirmed this classification.
  2. Hierarchical Importance of Thought Types: Through a counterfactual thought importance experiment, ThinKV established a clear hierarchy: Reasoning thoughts are the most critical for generating correct outputs, followed by Execution thoughts, and then Transition thoughts. This hierarchy forms the basis for adaptive compression.
  3. Attention Sparsity as a Proxy for Thought Types: Critically, ThinKV discovered that the degree of attention sparsity in the attention maps of several LRM layers directly correlates with these thought types. Specifically, Transition thoughts exhibit the highest sparsity, Reasoning thoughts moderate sparsity, and Execution thoughts the least sparsity. This enables a dynamic, runtime classification of thought types without relying on cumbersome keyword matching.
  4. Thought-Adaptive Quantization (Think Before You Quantize): Leveraging the importance hierarchy, ThinKV applies differential precision to each thought type. Reasoning and Execution thoughts are quantized to 4-bit (NVFP4), while less critical Transition thoughts are compressed further to 2-bit (ternary). This results in significant memory savings with minimal accuracy degradation.
  5. Thought-Adaptive Eviction (Think Before You Evict): ThinKV identified a fascinating phenomenon: the emergence of a Transition thought significantly diminishes the importance of all prior Reasoning and Execution thoughts. This insight led to a dynamic eviction policy where tokens associated with previous thoughts are progressively evicted upon the occurrence of a new Transition thought.
  6. System-Level Solution for Memory Fragmentation (Continuous Thinking Kernel): To address the pervasive problem of memory fragmentation caused by eviction, ThinKV introduces the Continuous Thinking Kernel. This system-level design modifies vLLM's PagedAttention with lazy eviction and thought-aware paging. Instead of immediately removing evicted tokens, they are merely marked, allowing subsequent new tokens to reuse those memory locations, thereby eliminating memory holes and avoiding costly compaction.

These findings collectively enable ThinKV to achieve near-lossless accuracy while using only 37% of the full KV memory, demonstrating an average precision of 3.6 bits, and yielding up to 3x higher batch sizes and 58x higher throughput on an NVIDIA H100 GPU compared to existing baselines.

Technical Deep Dive

▶ Watch: Identifying thought types using attention sparsity (4:55)

ThinKV's technical prowess stems from its intricate algorithm-system co-design, which begins with a deep analysis of LRM behavior and culminates in a modified memory management system.

The foundational insight of ThinKV is the decomposition of LRM chains of thought into three distinct thought types: Reasoning, Execution, and Transition. Initially, these types were identified heuristically using keyword matching:

  • Reasoning thoughts are characterized by introspective or planning keywords like "think," "approach," or "remember."
  • Execution thoughts involve concrete actions, often manifesting as mathematical operations or code syntax.
  • Transition thoughts act as delimiters or markers, typically containing words like "wait."

To validate the importance of these thought types, a counterfactual thought importance experiment was conducted. This involved systematically removing each thought type and observing its impact on the LRM's output quality. The results confirmed a clear hierarchy: Reasoning thoughts were found to be the most critical, followed by Execution thoughts, with Transition thoughts being the least impactful on overall output accuracy.

This established hierarchy directly informed ThinKV's thought-adaptive quantization scheme, dubbed "Think Before You Quantize." Instead of uniform quantization, ThinKV assigns different precision levels based on a token's thought type. Reasoning and Execution thoughts, being more critical, are quantized to 4-bit precision, leveraging formats like NVFP4. Transition thoughts, deemed less important, are aggressively compressed to 2-bit precision, using a ternary format. The talk mentions using E4M3 for 8-bit, but the optimal configuration found was Reasoning at 4-bit, Execution at 4-bit, and Transition at 2-bit, achieving high compression with minimal accuracy loss. This heterogeneous quantization prevents unaligned memory access issues by ensuring that tokens of different quantization levels do not share the same memory page, a concept integrated into the system design.

Complementing quantization is the thought-adaptive eviction policy, termed "Think Before You Evict." This policy leverages another key observation: the emergence of a Transition thought acts as a natural boundary, significantly diminishing the importance of all preceding Reasoning and Execution thoughts. Consequently, upon detecting a Transition thought, ThinKV progressively evicts tokens from all prior Reasoning, Execution, and Transition thoughts. This dynamic, context-aware eviction is a stark contrast to static or uniformly applied eviction policies that might discard crucial information prematurely.

A critical challenge for implementing these adaptive strategies at runtime is accurately identifying thought types without keyword matching, which is cumbersome and inefficient. ThinKV solves this by correlating thought types with the degree of attention sparsity in the LRM's attention maps. Analysis revealed a consistent pattern:

  • Transition thoughts exhibit the highest attention sparsity.
  • Reasoning thoughts show moderate sparsity.
  • Execution thoughts have the least sparsity.

This correlation allows ThinKV to differentiate thought types dynamically. An offline calibration step uses kernel density estimation (KDE) to determine sparsity thresholds for classification. During generation, a refresh period of 128 tokens is used to measure the sparsity ratio and update the classification of thought types, ensuring adaptability to evolving reasoning patterns.

The algorithmic innovations are seamlessly integrated into a system-level solution called the Continuous Thinking Kernel. This kernel is built upon a modified version of vLLM's PagedAttention, specifically designed to tackle the pervasive problem of internal memory fragmentation. Key modifications include:

  1. New Block Table Entries: ThinKV introduces new entries in the block table, visually represented in green, to manage thought types and eviction status.
  2. Thought-Aware Paging: Each thought type is constrained to occupy its own dedicated page. This ensures that pages do not contain a mix of different quantization formats (e.g., 4-bit and 2-bit tokens), thereby preventing unaligned memory access and simplifying memory management.
  3. Lazy Eviction Scheme: When a token is selected for eviction, it is not immediately removed from memory. Instead, it is merely marked for eviction using a new eviction mask flag within the block table entry. When subsequent new tokens are generated, the block table manager first checks for existing eviction flags. If an evicted memory location is available, it is reused by the new token, and its eviction flag is unset. This lazy eviction mechanism effectively reclaims fragmented memory on the fly, eliminating memory holes without incurring the overhead of explicit gather-based compaction, which would otherwise be on the critical path and degrade performance.

By intertwining these algorithmic insights with a robust system design, ThinKV provides a comprehensive, efficient, and practical solution for managing the KV cache in demanding Large Reasoning Models.

Experimental Setup & Results

▶ Watch: Continuous Thinking Kernel: System design for lazy eviction (5:30)

The effectiveness of ThinKV was rigorously evaluated on several Large Reasoning Models (LRMs), including DeepSeek-R1-Distill-Llama and DeepSeek-Coder, specifically focusing on their performance on the AIME dataset. The experimental setup was designed to simulate the challenging conditions of long output context generation, where LRMs produce extensive chains of thought.

For initial profiling and to demonstrate the problem, inference was conducted with a batch size of 16 and a substantial generation length of 32,000 tokens. This setup starkly highlighted the significant KV cache growth even with existing optimizations like MQA and GQA.

ThinKV's performance was then benchmarked against prior baselines, with a focus on memory footprint, accuracy, and throughput. A 1024 token budget was used for comparison, representing a practical constraint for KV cache size.

The headline results demonstrate ThinKV's substantial improvements:

  • Memory Efficiency: ThinKV achieved near-lossless accuracy while utilizing only 37% of the full KV memory. This represents a dramatic reduction in memory footprint for long output contexts.
  • Average Precision: The thought-adaptive quantization scheme, combining 4-bit for Reasoning and Execution thoughts and 2-bit for Transition thoughts, resulted in an impressive average precision of 3.6 bits per token across the KV cache.
  • Batch Size: Due to its superior compression ratio and efficient memory management, ThinKV enabled significantly higher batch sizes. On an NVIDIA H100 GPU, ThinKV achieved a batch size of up to 938, which is 3x higher than existing baselines. This allows for more concurrent reasoning tasks, crucial for real-world deployments.
  • Throughput: The increased batch size directly translated to a massive improvement in inference throughput. ThinKV demonstrated up to 58x higher throughput compared to prior methods. This is a critical metric for reducing inference latency and operational costs in production environments.
  • Accuracy: Crucially, all these performance gains were achieved with near-lossless accuracy, confirming that the thought-adaptive compression and eviction strategies effectively preserve the integrity of the LRM's reasoning process. The talk explicitly states that on the AIME dataset for several different LRMs, ThinKV maintains near-lossless accuracy.

The experiments validate that ThinKV's algorithm-system co-design, encompassing thought decomposition, adaptive quantization, dynamic eviction, and the Continuous Thinking Kernel with lazy eviction, provides a robust and highly effective solution for the memory and performance bottlenecks of Large Reasoning Models.

Practical Implications

▶ Watch: Q&A: Clarifying attention sparsity for transition thoughts (7:40)

ThinKV's innovations carry significant practical implications for a wide range of stakeholders involved in the development and deployment of Large Reasoning Models (LRMs).

For practitioners and model builders, ThinKV offers a pathway to deploying more capable LRMs that generate extensive, multi-step chains of thought without encountering prohibitive memory constraints. This means that models can be designed to reason more deeply and explicitly, potentially leading to more accurate and robust solutions for complex problems, such as advanced coding, scientific discovery, or intricate logical puzzles. The ability to maintain near-lossless accuracy while significantly reducing memory footprint directly translates into more powerful and reliable AI applications.

Infrastructure teams and deployers stand to benefit immensely from ThinKV's efficiency gains. The dramatic reduction in KV cache memory usage (down to 37% of full memory) and the resultant increase in batch size (3x on H100) and throughput (up to 58x) mean that more LRM inference can be packed onto existing hardware. This directly lowers the total cost of ownership (TCO) for running LRM services, as fewer GPUs are needed to serve the same workload, or conversely, existing infrastructure can handle significantly larger workloads. The lazy eviction mechanism effectively solves the persistent problem of internal memory fragmentation, a common headache for systems managing dynamic memory allocations, thereby simplifying memory management and improving overall system stability and performance. ThinKV's training-free nature also simplifies adoption, as it doesn't require expensive retraining of pre-existing LRM checkpoints.

However, there are practical considerations and tradeoffs. The approach requires a deep understanding and modification of the underlying inference serving framework (like vLLM's PagedAttention). This system-level modification, while powerful, means that ThinKV is not a drop-in solution and requires engineering effort to integrate. The classification of thought types via attention sparsity relies on offline calibration, meaning some initial setup is necessary. While the talk specifies that ThinKV requires GPUs for execution and does not suggest a non-GPU architecture, it does emphasize that the solution makes current GPU-based paradigms more efficient, especially for modern GPUs designed for both compute-bound and memory-bound workloads. The generalizability to other LRM architectures or future reasoning paradigms beyond the current "chain of thought" structure would also need continuous validation.

In essence, ThinKV empowers the next generation of reasoning AI by making it substantially more efficient to run, thereby accelerating research and enabling broader commercial adoption of these advanced models.

Key Takeaways

  • LRMs introduce "long output context generation," causing massive KV cache growth that traditional compression methods, designed for long input contexts, fail to address.
  • ThinKV decomposes LRM reasoning into distinct "Reasoning," "Execution," and "Transition" thought types, with a clear hierarchy of importance (Reasoning > Execution > Transition).
  • Attention sparsity acts as a reliable, runtime proxy for identifying these thought types, enabling dynamic classification without keyword matching.
  • Thought-adaptive quantization and eviction are applied: Reasoning/Execution thoughts are 4-bit, Transition thoughts are 2-bit, and prior thoughts are progressively evicted upon new Transition thoughts.
  • The "Continuous Thinking Kernel," a modified vLLM PagedAttention with lazy eviction and thought-aware paging, effectively solves memory fragmentation by reusing evicted memory locations.
  • ThinKV achieves near-lossless accuracy with only 37% of full KV memory usage, an average of 3.6 bits per token, and delivers up to 3x higher batch sizes and 58x higher throughput on NVIDIA H100 GPUs.

About the Speaker(s)

The talk was presented by Akshat Ramachandran from NVIDIA. He collaborated with a team of researchers including Marina Neseem, Charbel Sakr, Rangharajan Venkatesan, Brucek Khailany, and Tushar Krishna. The affiliations mentioned for the team include both NVIDIA and Georgia Tech, indicating a strong collaboration between industry and academia on this research.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026