Modern KV cache management assumes the chatbot workload: prompts arrive once and the cache grows append-only, so prefix caching and forward-only eviction are correct by construction. Agentic LLMs break this assumption. Their conversations evolve through policy-driven editing: failed tool calls are retried, stale outputs dropped, trajectories pivoted. Two distinct cache problems result. First, identical content moves to new positions between turns, invalidating exact-prefix caches even though the underlying KV would still be valid; recent work on position-independent caching for MLA addresses this reuse problem. Second, and this paper's focus, a policy may need to direct the serving system to actively remove or replace a span of cached content and continue without re-prefilling everything that came after. No existing primitive offers this. Production agentic harnesses fall back to re-prefill on every edit, paying full prefix-recomputation cost; kernel-level eviction methods make their own decisions and cannot accept policy directives from outside the kernel. We introduce Leyline, a serving-side primitive that closes this gap. A declarative directive 4-tuple separates what to edit from how to preserve position correctness. The policy declares the edit and its mode (in-place splice or prefix-trimmed re-prefill for semantic forgetting); an architecture-agnostic interface routes to a per-architecture kernel that restores attention math via a closed-form RoPE-rotation correction. The splice kernel lifts replay cache-hit by +11.2 pp and cuts latency by up to 241 ms. A ten-line truncation rule routed through the same interface lifts agentic solve rate by +14.3 pp on debug-gym. The mechanism is open; the policy space it enables is the agenda.


翻译:摘要:现代KV缓存管理假设聊天机器人工作负载:提示词一次性到达,缓存仅以追加方式增长,因此前缀缓存和仅向前逐出在结构上正确。智能体大语言模型打破了这一假设。它们的对话通过策略驱动的编辑演化:失败的函数调用被重试、过时输出被丢弃、轨迹被转向。这导致了两个不同的缓存问题。第一,相同内容在轮次间转移到新位置,使精确前缀缓存失效,即使底层KV仍然有效;近期针对MLA的位置无关缓存工作解决了这一复用问题。第二,也是本文的重点,策略可能需要指导服务系统主动删除或替换一段缓存内容,并在不重新预填充所有后续内容的情况下继续执行。现有原语无法实现此功能。生产环境中的智能体框架每逢编辑都回退到重新预填充,承担完整的前缀重计算成本;内核级逐出方法自行决策,无法接受内核外部的策略指令。我们提出Leyline,一种填补此空白的服务端原语。声明式指令四元组将编辑内容与位置正确性保持分离。策略声明编辑及其模式(原地拼接或前缀截断式重新预填充以实现语义遗忘);架构无关接口将操作路由到特定架构的内核,该内核通过闭式RoPE旋转校正恢复注意力计算。拼接内核将回放缓存命中率提升11.2个百分点,延迟降低最高241毫秒。通过同一接口路由的十行截断规则在debug-gym中将智能体求解率提升14.3个百分点。该机制是开放的,它启用的策略空间是未来议程。

0
下载
关闭预览

相关内容

博士论文 | 面向大模型推理的内存高效算法
专知会员服务
7+阅读 · 7月27日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
通过集成 XNNPACK 实现推理速度飞跃
TensorFlow
26+阅读 · 2020年7月30日
注意力机制可解释吗?这篇ACL 2019论文说……
机器之心
11+阅读 · 2019年6月16日
Transformer-XL:释放注意力模型的潜力
谷歌开发者
31+阅读 · 2019年2月19日
【泡泡图灵智库】密集相关的自监督视觉描述学习(RAL)
泡泡机器人SLAM
11+阅读 · 2018年10月6日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月12日
VIP会员
最新内容
俄乌无人机战争的六大启示
专知会员服务
9+阅读 · 8月3日
《无人机空中监控:通信实验洞察》
专知会员服务
7+阅读 · 8月3日
从采集到决策:美军视角下的战术情报范式重构
《履带式无人地面战车技术发展现状》
专知会员服务
7+阅读 · 8月2日
《无人机脆弱性利用:网络空间力量的新域》
专知会员服务
10+阅读 · 8月1日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员