Beyond Speedup - Utilizing KV Cache for Sampling and Reasoning

Zeyu Xing, Xing Li, Hui-Ling Zhen, Mingxuan Yuan, Sinno Jialin Pan

In the realm of Large Language Model (LLM) inference, the Key-Value (KV) cache is traditionally viewed as the unsung hero of efficiency. Its primary job is straightforward: store past attention states so the model avoids recomputing them for every newly generated token. But what if this necessary "side effect" of inference was actually a rich, untapped source of contextual information?

A new paper, Beyond Speedup - Utilizing KV Cache for Sampling and Reasoning, argues exactly that. The authors demonstrate that the KV cache can serve as a "cost-free" embedding, rivaling much heavier traditional methods for evaluating and controlling model reasoning.

The Problem: The High Cost of Hidden States

Modern LLMs are increasingly tasked with complex reasoning, often utilizing techniques like Chain-of-Thought. To make these models more reliable, researchers employ "self-evaluation" or "adaptive reasoning"—techniques where the model analyzes its own internal states to decide if it is on the right track or if a problem requires deeper "slow thinking."

The standard approach for this internal analysis relies on hidden states. However, storing hidden states alongside the KV cache is a VRAM nightmare. As context lengths grow, saving these states can nearly double the memory requirements of a model, making real-time deployment of adaptive reasoning prohibitively expensive.

VRAM usage comparison showing that storing hidden states alongside the KV cache significantly increases memory requirements.

The authors pose a critical question: Can we extract the same reasoning insights using only the KV cache we already have in memory?

Methods: Repurposing the KV Cache

To bypass the memory bottleneck of hidden states, the researchers introduce the concept of KV-Embeddings. Instead of extracting the full hidden state of every layer, they aggregate the Key and Value tensors already stored in the cache to form a lightweight text representation.

Overview of the proposed KV-Embedding applications: KV-CoE for trajectory analysis and KV-Classifier for adaptive reasoning control.

This concept is applied in two primary ways:

  1. KV-CoE (Chain-of-Embedding): The authors adapt the traditional "Chain-of-Embedding" technique. Instead of tracking how hidden states evolve across layers, KV-CoE tracks how KV-embeddings evolve across tokens. This allows the system to estimate the confidence of a reasoning path without storing extra activations.
  2. KV-Classifier (Fast/Slow Switch): The team trained a lightweight Multi-Layer Perceptron (MLP) to analyze the pooled KV cache from the prompt encoding phase. This classifier assigns a "difficulty score" to the input prompt.
  3. Dynamic Control: Based on the difficulty score, the system dynamically injects special control tokens (like <think> or </think>) to force the model into a "slow thinking" mode (detailed reasoning) or a "fast thinking" mode (direct answer). It can even switch mid-generation if the perceived difficulty changes.

Key Results and Insights

The authors validated their approach across several benchmarks, including MTEB (for general embedding quality), MATH and TheoremQA (for reasoning evaluation), and GSM8K and MATH500 (for adaptive switching).

  • Massive Efficiency Gains: On the MATH500 benchmark using Qwen3-8B, the dynamic generative switch reduced average token counts from 4,150 (full reasoning) to just 727. This 5.7× reduction in token generation was achieved with only a minimal 3.2% drop in accuracy.
  • Competitive Performance: In self-evaluation tasks, KV-CoE achieved AUROC scores comparable to, and sometimes exceeding, methods that rely on full hidden states. For instance, on TheoremQA with Qwen2-7B, KV-CoE-R hit an impressive AUROC of 88.87.
  • The "Free Lunch" of Representations: Because the KV cache is an unavoidable byproduct of autoregressive inference, utilizing it for downstream tasks adds virtually zero memory or FLOP overhead. By avoiding hidden state storage, the method remains within the standard memory footprint, making it highly deployment-friendly.

Limitations and Future Directions

While powerful for specific use cases, the authors note that KV-embeddings are not a universal replacement for dedicated embedding models. They are optimized for causal modeling rather than contrastive similarity, meaning they shouldn't be used for broad semantic retrieval tasks like RAG. Additionally, the vector space of KV caches is often biased or "squashed" (anisotropy), requiring specific pooling strategies to extract useful signals.

Currently, the method relies on simple mean pooling across heads and layers. Future work could explore more sophisticated attention-based pooling to capture even finer nuances in the cache.

Ultimately, by proving that the KV cache is a versatile and low-cost foundation for sampling and reasoning, this research opens the door for smarter, more efficient LLM inference without demanding larger GPUs.

Summary updated

BibTeX
@inproceedings{xing2026beyond,
  author = {Zeyu XING and Xing Li and Hui-Ling Zhen and Mingxuan Yuan and Sinno Jialin Pan},
  title = {{Beyond Speedup - Utilizing KV Cache for Sampling and Reasoning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=GUhmiJaAzv},
}
Figure