TL;DR
Multi-turn LLM agents generate massive Key-Value (KV) caches that slow down inference and exhaust GPU memory, but standard compression methods mistakenly evict temporarily "dormant" information that becomes crucial later. CommitKV solves this by tracking token utility across tool-call boundaries, successfully distinguishing permanently completed context from temporarily inactive context. This lifecycle-aware approach delivers up to 5x memory savings and a 5.6x speedup while dramatically outperforming existing snapshot-based compression baselines.
What Problem Does This Paper Address?
Large language model (LLM) agents running on the popular Reasoning-and-Acting (ReAct) paradigm alternate between thinking, calling external tools, and processing returned observations. To avoid re-computing the entire conversation history at every single turn, systems reuse the Key-Value (KV) cache across turns. However, as the agent's trajectory grows, its KV cache balloons, leading to severe memory bottlenecks and increased attention computation latency.
Existing KV cache compression methods try to mitigate this by taking a "snapshot" of the attention weights at a given moment and evicting tokens with low scores. The authors of this paper identify a critical flaw in this strategy: low current attention does not mean future irrelevance. In multi-turn agent workflows, an early observation or fact might be temporarily dormant during a specific tool-use cycle, only to become vital later when formulating the final answer. Snapshot-based methods conflate these dormant tokens with genuinely useless ones, leading to premature eviction and catastrophic accuracy drops.
Methods
CommitKV introduces a lifecycle-aware compression pipeline that tracks how token importance evolves across commit transitions—the boundary where a tool call ends and its observation is returned. The pipeline operates in five main steps:
- Event Paging: The agent's interaction history is partitioned into contiguous blocks called event pages.
- Paired Deletion-Effect Measurements: Instead of relying on raw attention scores, CommitKV measures the actual deletion effect (how much the attention head's output changes if a page is removed). It measures this across two distinct windows: a pre-commit window ($Q_c^-$, right before the tool call finishes) and a post-commit window ($Q_c^+$, right after the tool's observation is integrated).
- Lifecycle Classification: By comparing the pre- and post-commit deletion effects using both absolute thresholds and relative percentile ranks, pages are categorized into states. A page that goes from high-influence to low-influence is deemed a completion candidate, while a page that stays low-influence is marked as dormant and kept.
- Greedy Joint Validation: To prevent small individual errors from compounding into a massive aggregate shift in attention, completion candidates are sorted and validated jointly. They are only approved for retirement if their combined deletion effect remains below a safe threshold ($\tau_{\text{joint}}$).
- Transition Protection: Pages that have a pre-commit measurement but are still waiting for their corresponding post-commit observation are explicitly protected from eviction to ensure their lifecycle can be fully evaluated.
Datasets
The authors evaluated CommitKV across six open-weight LLM backbones (including Qwen3-14B, Qwen3.6-27B, and DeepSeek-R1-Distill-Llama-8B) using eight benchmarks split into two functional categories:
- Reasoning-intensive: GPQA (graduate-level scientific Q&A), Bamboogle (multi-step compositional reasoning), MATH-500, and AIME25 (mathematics).
- Tool-use and evidence-intensive: FRAMES, GAIA, ToolHop, and xbench-DeepSearch (evaluating multi-turn tool use and evidence aggregation).
No new datasets were introduced; the focus was on rigorous evaluation against established, challenging agent benchmarks.
Key Insights and Ideas
- The Ambiguity of Low Attention: A token's lack of utility in the current turn is fundamentally ambiguous. It represents a superposition of two states: "permanently completed its role" or "temporarily dormant."
- Commit Boundaries as Natural State Transitions: The completion of a tool call is a logical anchor point. If a page was highly influential for generating a tool call but becomes irrelevant after the tool returns its data, it has successfully fulfilled its purpose and is safe to remove.
- The Importance of Joint Testing: Evicting tokens based purely on individual scores ignores the fact that errors accumulate. Testing candidates together ensures the model's internal attention representation doesn't drift too far from the uncompressed baseline.
Key Results
- Superior Accuracy Retention: Under a standard 4096-token KV cache budget, CommitKV outperformed the strongest compressed baseline by an average of 19.85% on Qwen3-14B and 5.49% on Qwen3.6-27B.
- Robustness Under Tight Budgets: Under an aggressive 2048-token budget, CommitKV outperformed the best baseline (R-KV) by 22.24% on average, substantially narrowing the gap to the uncompressed FullKV baseline.
- Massive Efficiency Gains: CommitKV achieved up to 5.00× savings in peak KV memory and a 5.62× end-to-end wall-clock speedup compared to uncompressed execution, without introducing prohibitive runtime overhead.
Limitations and Future Work
Although CommitKV significantly outperforms existing snapshot-based compression methods, a performance gap still remains between CommitKV and the uncompressed FullKV reference when operating under extremely constrained cache budgets (e.g., 2048 tokens). The authors state that future work will focus on closing this remaining accuracy gap under highly restrictive memory limits.
Summary updated