[Paper Review] SideQuest: Model-Driven KV Cache Management for Long-Horizon Agentic Reasoning
SideQuest enables a model-driven auxiliary memory-management thread to evict stale KV-cache entries during long-horizon agentic reasoning, reducing peak memory usage with minimal accuracy loss.
Long-running agentic tasks, such as deep research, require multi-hop reasoning over information distributed across multiple webpages and documents. In such tasks, the LLM context is dominated by tokens from external retrieval, causing memory usage to grow rapidly and limiting decode performance. While several KV cache compression techniques exist for long-context inputs, we find that existing heuristics fail to support multi-step reasoning models effectively. We address this challenge with SideQuest -- a novel approach that leverages the Large Reasoning Model (LRM) itself to perform KV cache compression by reasoning about the usefulness of tokens in its context. To prevent the tokens associated with this management process from polluting the model's memory, we frame KV cache compression as an auxiliary task executed in parallel to the main reasoning task. Our evaluations, using a model trained with just 215 samples, show that SideQuest reduces peak token usage by up to 65% on agentic tasks with minimal degradation in accuracy, outperforming heuristic-based KV cache compression techniques.
Motivation & Objective
- Motivate the memory bottleneck in long-horizon agentic reasoning due to growing KV caches.
- Propose a model-driven KV cache eviction mechanism that operates as an auxiliary task in parallel to main reasoning.
- Demonstrate that semantic, self-guided eviction outperforms fixed heuristics in dynamic multi-step tasks.
- Show that parallel auxiliary reasoning maintains accuracy while significantly reducing peak memory and memory reads.
Proposed method
- Introduce SideQuest, which runs an auxiliary memory-management thread in parallel with the main ReAct reasoning process.
- Use the LRM itself to perform staleness reasoning and generate deletion commands for KV cache entries (e.g., del_cursors).
- Frame memory management as an auxiliary task with its own trigger phrase (Memory management mode) and training via hindsight-annotated data.
- Generate training data with two traces: main traces to preserve core reasoning (logit distillation) and auxiliary traces to teach eviction (cross-entropy).
- Train via joint optimization combining distillation loss on main traces and cross-entropy loss on auxiliary traces to enable trigger-based auxiliary behavior.
Experimental results
Research questions
- RQ1Can a model-driven auxiliary process effectively identify and evict stale tool outputs in multi-step agentic tasks?
- RQ2Does parallel auxiliary reasoning reduce peak KV-cache usage and memory reads without substantially harming accuracy?
- RQ3How does SideQuest compare to heuristic KV-cache eviction methods in dynamic, long-context research-like workloads?
Key findings
- SideQuest reduces peak token usage by 56-65% compared to the uncompressed baseline.
- SideQuest reduces KV-cache memory reads by 53-71% relative to the baseline.
- Accuracy degradation is small, up to 2% on FRAMES and 5% on BrowseComp, outperforming heuristic baselines.
- In serving benchmarks, SideQuest increases system throughput by 83.9% and reduces total runtime by 36.8%.
- SideQuest maintains near-zero non-completion rates, unlike several heuristic baselines that cause higher failure rates.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.