arxiv.org·2026/10/19
Agentic LLM 应用将用户请求展开为多轮模型与工具调用,KV 状态驻留 GPU 显存可免后续重算,但大规模部署下显存代价高昂。论文刻画 Microsoft M365 的 Deep Research、Enterprise Assistant、Coding Agent、Enterprise Chat 生产轨迹,覆盖超 1.21 亿次模型调用,发现 Deep Research 上下文随调用持续增长、多数 token 由前缀缓存命中。作者以公开的 Llama-2-70B KV 布局估算,全部活跃会话按峰值驻留约需 501.8 TB HBM。轨迹回放显示,设置空闲上限可将峰值需求压低 3.6 倍而重算份额几乎不变;显存收紧后仅靠逐出不够:LRU 使 63% 的 Deep Research 调用重算,多分辨率保留 MRR 改为把 LRU 选中的会话 KV 状态降为 int4,重算比例降至 13.6%。放置另成约束:后续调用落到不同部署时缓存复用大幅下滑,即便显存无限,把 KV 视作部署本地也会显著抬高重算下限。结论主张改变 KV 表示的保留策略,配合部署感知路由或迁移,并计划开源参数化轨迹生成器 AgenticTraceSim 与驻留回放框架。
为什么重要 该结论直接约束推理集群的显存容量规划与请求路由:agent 负载的容量瓶颈在于 KV 驻留,而非算力。适合 做推理集群容量规划、KV cache 与请求路由的工程人员
智能体大语言模型(LLM)应用将一个用户请求转化为在不断增长的上下文上执行的一系列模型调用和工具调用。将该上下文的键值(KV)状态保留在 GPU 内存中,可以让后续调用复用它而不是重新计算它,但在机群规模下这需要大量内存。
我们刻画了四条生产环境中的 Microsoft M365 工作负载轨迹(Deep Research、Enterprise Assistant、Coding Agent 和 Enterprise Chat),涵盖超过 1.21 亿次模型调用。
在 Deep Research 中,应用发出 89% 的模型调用,中位上下文到第 30 次调用时从约 10K 增长到 68K 个 token。约 80% 的上下文 token 由前缀缓存提供服务。
以公开的 Llama-2-70B KV 布局代替保密模型,一个第 99 百分位的 Deep Research 会话就超过了 NVIDIA H100 的 80 GB HBM,而在峰值时保持所有活跃会话估计需要 501.8 TB 的 HBM,尽管推理仅占用该保留时间的 5.6%。
轨迹驱动的重放表明,一小时的空闲上限可将这一上限削减 3.6 倍,同时仅将需要重新计算上下文的调用比例从 4.07% 提高到 4.53%。
在更紧张的预算下,仅靠驱逐是不够的:在最繁忙时段需求的十分之一的情况下,LRU 驱逐使 63% 的 Deep Research 调用重新计算,clairvoyant furthest-next-use(全知的最远未来使用)驱逐使 31% 重新计算,而将 LRU 会话的 KV 状态降级为 int4 的多分辨率保留(MRR)则将其降至 13.6%。
部署位置施加了另一个独立的限制:当下一次调用到达不同的部署时,缓存上下文复用率从 89% 降至 29%,而将 KV 状态视为部署本地(deployment-local)会使无限内存下的重计算下限从 5.4% 升至 20.2%。这些发现推动了改变 KV 状态表示的保留策略,并结合部署感知的路由或迁移。
我们计划发布 AgenticTraceSim(一个参数化轨迹生成器)以及一个驻留重放框架。
Agentic large language model (LLM) applications turn one user request into a sequence of model and tool calls over a growing context.
Retaining this context's key-value (KV) state in GPU memory lets later calls reuse it instead of recomputing it, but at fleet scale this needs substantial memory.
We characterize four production Microsoft M365 workload traces (Deep Research, Enterprise Assistant, Coding Agent and Enterprise Chat) spanning more than 121 million model calls.
In Deep Research, the application issues 89% of model calls and the median context grows from about 10K to 68K tokens by the 30th call.
About 80% of context tokens are served from the prefix cache.
With the public Llama-2-70B KV layout standing in for confidential models, one 99th-percentile Deep Research session exceeds the 80 GB HBM of an NVIDIA H100, and holding all live sessions at their peak needs an estimated 501.8 TB of HBM, although inference occupies only 5.6% of that retention time.
Trace-driven replay shows that a one-hour idle cap cuts this ceiling by 3.6x while raising the share of calls that recompute context only from 4.07% to 4.53%.
Under tighter budgets, eviction alone is insufficient: at one tenth of the busiest hour's demand, LRU eviction makes 63% of Deep Research calls recompute and clairvoyant furthest-next-use 31%, whereas multi-resolution retention (MRR), which demotes the LRU session's KV state to int4, lowers this to 13.6%.
Placement imposes a separate limit: when the next call reaches a different deployment, cached-context reuse drops from 89% to 29%, and treating KV state as deployment-local raises the recompute floor under unlimited memory from 5.4% to 20.2%.
These findings motivate retention that changes the representation of KV state, together with deployment-aware routing or migration.
We plan to release AgenticTraceSim, a parametric trace generator, and a residency replay framework.
EVIDENCE / METHODS
要点
Agentic 应用把一次用户请求展开成串行的模型调用与工具调用,上下文随之不断增长。
原版排版与图表 · 手机无法内嵌时可在浏览器打开。PDF 插件内选文不能传给网页助手。