NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

HARD-KV: Head-Adaptive Regularization for Decoding-time KV Compression

Yuxuan Yang, Feiyang Ren, Bowen Zeng, Dalin Zhang, Jinpeng Chen, Gang Chen, Huan Li

Introduction: The "Static-Dynamic" Mismatch

As Large Language Models (LLMs) scale to process and generate increasingly longer contexts, the Key-Value (KV) cache—the memory footprint required to store past token information—grows linearly. This expansion creates a massive bottleneck for both inference speed and memory utilization.

Recent research indicates that "head-adaptive" compression, which dynamically allocates memory budgets across different attention heads based on their relative importance, yields significantly higher accuracy than uniform, one-size-fits-all compression. However, a fundamental conflict arises when deploying these algorithms in production. Modern high-performance inference engines, such as vLLM, rely heavily on CUDA Graphs and PagedAttention. These system-level optimizations demand rigid, static, and predictable memory layouts to function efficiently. Consequently, a "Static-Dynamic" mismatch occurs: algorithms require dynamic memory fluctuations to maintain accuracy, while systems demand static patterns to maximize throughput.

The HARD-KV Framework

To resolve this conflict, the authors introduce HARD-KV, a unified framework designed to bridge dynamic token selection with rigid system constraints. HARD-KV achieves this through three core innovations:

1. Cascade Cache Hierarchy

Rather than treating the KV cache as a monolithic block, HARD-KV organizes token lifecycles across a three-tier architecture:

  • Tier 1 (Dense): Retains the most recent tokens in full, preserving crucial local context.
  • Tier 2 (Sparse): Employs adaptive selection to maintain only the most "information-dense" tokens.
  • Tier 3 (Condensed): Compresses the oldest tokens into a constant-sized storage format through eviction or merging strategies.

2. Logits Calibration

Different compression algorithms utilize disparate metrics (e.g., L2 norms or raw attention scores) to determine token importance. HARD-KV introduces a novel Logits Calibration mechanism that normalizes these diverse metrics into a unified probability space. This calibration enables consistent Top-$p$ (nucleus) budgeting across heterogeneous attention heads, ensuring critical information is preserved regardless of the underlying compression heuristic.

3. System-Aware Index Regularization

To bridge the efficiency gap, HARD-KV implements a system-level regularization step. Dynamic token selection naturally produces fragmented, messy memory indices. HARD-KV rewrites these dynamic indices into contiguous physical layouts, rendering them fully compatible with the high-speed, static optimizations required by modern inference engines.

Key Insights and Innovations

  • Mitigating Selection Collapse: The researchers observed that naively applying Top-$p$ sampling to modified attention scores often triggers "selection collapse," where the retained token budget drops precipitously. Logits Calibration, utilizing temperature scaling, resolves this by aligning the selection pattern with the raw attention distribution.
  • The "Voting" Period: HARD-KV employs a Cautious Update Strategy rather than evicting tokens based on a single snapshot. The time a token spends in the Dense tier acts as a "voting period"; a token is only compressed or evicted after consistently proving its irrelevance over multiple decoding steps.
  • Memory-Time Integral (MTI): The paper introduces MTI as a comprehensive metric to evaluate true system costs, jointly accounting for the memory footprint of a request and its total execution time.

Experimental Results

The authors evaluated HARD-KV in demanding long-decoding scenarios (generating over 10,000 tokens), focusing on complex mathematical reasoning tasks where accuracy is notoriously difficult to maintain. Testing on AIME24, AIME25, and U-Math benchmarks using the Qwen3 model family (4B, 8B, and 32B in "think" modes) yielded impressive results:

  • Throughput: HARD-KV achieved up to a 2× improvement in throughput compared to static baselines.
  • Accuracy: The framework delivered up to a 1.5× performance gain over standard compression methods on math-reasoning tasks.
  • System Efficiency: By effectively managing sparsity utilization, the system avoids memory fragmentation stalls and maintains high-fidelity generation in 10k+ token scenarios, all while remaining fully compatible with CUDA Graphs.

Limitations and Future Directions

While highly effective, the authors note that raw attention logits can still accumulate "noise" over extremely long trajectories, potentially degrading performance in high-budget settings. Future work will focus on extending HARD-KV from decoding-time compression to streaming scenarios (handling infinite data flows) and exploring hybrid memory structures that combine constant-sized and linear-sized memory for superior scaling.

Summary updated

BibTeX
@inproceedings{yang2026hard,
  author = {Yuxuan Yang and Feiyang Ren and Bowen Zeng and Dalin Zhang and Jinpeng Chen and Gang Chen and Huan Li},
  title = {{HARD-KV: Head-Adaptive Regularization for Decoding-time KV Compression}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=K0yRIwmG1e},
}
Figure