Which Heads Matter for Reasoning? RL-Guided KV Cache Compression

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Du, Wenjie, Jiang, Li, Tao, Keda, Liu, Xue, Wang, Huan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918527184666624
author Du, Wenjie
Jiang, Li
Tao, Keda
Liu, Xue
Wang, Huan
author_facet Du, Wenjie
Jiang, Li
Tao, Keda
Liu, Xue
Wang, Huan
contents Reasoning large language models exhibit complex reasoning behaviors via extended chain-of-thought generation that are highly fragile to information loss during decoding, creating critical challenges for KV cache compression. Existing token-dropping methods directly disrupt reasoning chains by removing intermediate steps, while head-reallocation methods, designed for retrieval tasks, fail to preserve the heads essential for generative reasoning. However, no existing method can identify which attention heads genuinely maintain reasoning consistency and control generation termination. To address this, we propose RLKV, which uses reinforcement learning as a probe to discover which heads contribute to reasoning quality by directly optimizing their cache usage against actual generation outcomes. This discovery naturally leads to an efficient compression strategy: we allocate full KV cache to reasoning-critical heads while aggressively compressing others with constant-size KV cache. Experiments reveal that a fraction of heads proves essential for reasoning, enabling 20--60% cache reduction with near-lossless performance across diverse tasks and models, and up to 2.06x end-to-end speedup at 60% reduction.
format Preprint
id arxiv_https___arxiv_org_abs_2510_08525
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Which Heads Matter for Reasoning? RL-Guided KV Cache Compression
Du, Wenjie
Jiang, Li
Tao, Keda
Liu, Xue
Wang, Huan
Computation and Language
Reasoning large language models exhibit complex reasoning behaviors via extended chain-of-thought generation that are highly fragile to information loss during decoding, creating critical challenges for KV cache compression. Existing token-dropping methods directly disrupt reasoning chains by removing intermediate steps, while head-reallocation methods, designed for retrieval tasks, fail to preserve the heads essential for generative reasoning. However, no existing method can identify which attention heads genuinely maintain reasoning consistency and control generation termination. To address this, we propose RLKV, which uses reinforcement learning as a probe to discover which heads contribute to reasoning quality by directly optimizing their cache usage against actual generation outcomes. This discovery naturally leads to an efficient compression strategy: we allocate full KV cache to reasoning-critical heads while aggressively compressing others with constant-size KV cache. Experiments reveal that a fraction of heads proves essential for reasoning, enabling 20--60% cache reduction with near-lossless performance across diverse tasks and models, and up to 2.06x end-to-end speedup at 60% reduction.
title Which Heads Matter for Reasoning? RL-Guided KV Cache Compression
topic Computation and Language
url https://arxiv.org/abs/2510.08525