Cache Engineering for Agents
- ID: e1a68b9a
- 原文链接: https://arxiv.org/abs/2610.28577
- PDF: https://arxiv.org/pdf/2610.28577v1
- 作者: Tianyu Fu, Ruoxi Wang, Zihan Min, Zhongqi Ren, Zhihao Li, Tengxuan Liu, Shengxu Mu, Hanling Zhang, Yu Wang
- 日期: 2026-10-20
- 更新: 2026-10-20
- 分类: infra
- 来源类型: paper
- 标签: kv-cache, agent-serving, inference-optimization, cache-policy
- 质量评分: 4/5
- 抓取时间: 2026-10-22T04:21:44Z
中文导读
LLM agent 轨迹越走越长,KV cache 的 I/O 与存储成为主导成本;裁剪或摘要历史的上下文工程会改前缀令后续缓存态失效并触发昂贵 re-prefill,保留太少又伤精度论文提出 cache engineering:agent 用 drop 把选中缓存排除出未来注意力用 repos 调整保留键的位置编码,直接控制活跃 KV 缓存,不改轨迹也不重预填充并指出服务端难题 history dependence:同一 token 序列在不同缓存操作序列下缓存态不同,前缀匹配不足以正确复用,为此 co-design AKV serving 引擎对外无状态兼容现有 serving API,对内管理有状态的复用驱逐与恢复tool-response rolling-drop 策略较阈值触发摘要平均提升 1.7 分成本降 27.7%;AKV 输出吞吐至多 1.2xP95 延迟 1.5x;缓存策略递归自我改进再省 7.1% 成本代码:github.com/thu-nics/AKV
为什么值得关注
Agent 轨迹 KV 缓存变成可直接操作的资源:drop/repos 免重预填充,AKV 引擎解决同前缀不同缓存态的复用,基准 +1.7 分成本 -27.7%
论文于 2026-10-20 提交 arXiv(cs.CL),摘要与元数据均来自 arXiv 官方页面。
关键信息
- 论文标题:Cache Engineering for Agents
- 作者:Tianyu Fu, Ruoxi Wang, Zihan Min, Zhongqi Ren, Zhihao Li, Tengxuan Liu, Shengxu Mu, Hanling Zhang, Yu Wang
- arXiv:https://arxiv.org/abs/2610.28577
- 发布时间:2026-10-20
- arXiv 分类:cs.CL
- 关联标签:kv-cache, agent-serving, inference-optimization, cache-policy
English Abstract
Large Language Model (LLM) agents can handle increasingly complex tasks, navigating long trajectories of observations and actions. As these trajectories grow, key-value (KV) cache I/O and storage become the dominant cost. Trajectories can also exceed the LLM's maximum context length, requiring control over active cache growth. Prior work uses context engineering to reduce cache size by trimming or summarizing history. However, modifying the trajectory prefix invalidates subsequent cached states and triggers costly re-prefilling of retained context. Task accuracy can also suffer when too little context is retained to limit re-prefill costs. We propose cache engineering as a new scheme. It allows agents to directly control their active KV cache without modifying the trajectory or re-prefilling retained context. Specifically, agents can proactively use drop to exclude selected cache from future attention and repos to adjust retained keys' position encodings. We formalize these cache operations and identify history dependence as a serving challenge: identical token sequences can yield different cache states under different cache operation sequences, making prefix matching insufficient for correct cache reuse. Thus, we co-design the AKV serving engine. It provides a stateless interface compatible with existing serving APIs, while internally managing stateful cache reuse, eviction, and restoration. Experiments show that a tool-response rolling-drop cache policy improves average benchmark scores by 1.7 points and reduces average cost by 27.7%, compared with conventional threshold-triggered summarization. With AKV, it achieves up to 1.2x the output throughput and a 1.5x speedup in P95 request latency. Recursive self-improvement of cache policies further reduces cost by 7.1% over expert design. Our code is at https://github.com/thu-nics/AKV.
English Summary
LLM agent trajectories grow long enough that KV cache I/O and storage dominate cost; trimming or summarizing history invalidates cached states and triggers costly re-prefilling. Cache engineering lets agents directly control their active KV cache without modifying the trajectory: drop excludes selected cache from future attention, repos adjusts retained keys' position encodings. The paper identifies history dependence as a serving challenge (identical token sequences yield different cache states under different operation sequences, so prefix matching is insufficient for correct reuse) and co-designs the AKV serving engine: a stateless API with stateful reuse, eviction, and restoration internally....
Obsidian Notes
- 内容由
opencli arxiv paper拉取 arXiv 元数据与摘要生成。 - 中文导读与价值判断均锚定在条目已有摘要、论文摘要、作者、日期与分类信息上;未补充论文摘要之外的实验细节。