arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2605.06472cs.LG
收藏

基于预测的动态代理工作流高效服务系统

Efficient Serving for Dynamic Agent Workflows with Prediction-based KV-Cache Management

Wuhan University(武汉大学);Dameng Database(达梦数据库);Shanghai Jiao Tong University(上海交通大学);Macquarie University(麦考瑞大学);HKUST(香港科技大学)

Haoyu Zheng, Fangcheng Fu, Jia Wu, Binhang Yuan, Yongqiang Zhang, Hao Wang, Yuanyuan Zhu, Xiao Yan, Jiawei Jiang

AI总结:

本文提出PBKV系统,通过预测未来代理调用并管理KV缓存,提升动态工作流的效率,实验显示在动态工作流中比LRU快1.85倍,在静态工作流中比KVFlow快1.26倍。

摘要:

基于工作流的LLM代理执行复杂任务,通常共享大量上下文,允许KV缓存重用以节省计算。现有方法或在代理层面管理缓存无法利用工作流内的重用机会,或在工作流层面管理缓存但假设每个工作流调用静态代理序列。然而,实际工作流通常是动态的,代理调用序列及由此引发的缓存重用机会取决于每个任务的上下文。为高效服务此类动态工作流,我们构建了PBKV(基于预测的KV缓存管理)系统。对于每个工作流,PBKV通过融合历史工作流的指导和目标工作流的上下文,预测未来几步的代理调用。基于预测,PBKV估计缓存条目的重用潜力,并将高潜力条目保留在GPU内存中。为应对预测误差,PBKV在缓存淘汰和预取过程中保守使用预测。实验表明,PBKV在动态工作流中比LRU快1.85倍,在静态工作流中比SOTA基线KVFlow快1.26倍。

英文摘要:

LLM-based workflows compose specialized agents to execute complex tasks, and these agents usually share substantial context, allowing KV-Cache reuse to save computation. Existing approaches either manage KV-Cache at agent level and fail to exploit the reuse opportunities within workflows, or manage cache at the workflow level but assume that each workflow calls a static sequence of agents. However, practical workflows are typically dynamic, where the sequence of invoked agents and thus induced cache reuse opportunities depend on the context of each task. To serve such dynamic workflows efficiently, we build a system dubbed PBKV (\textbf{P}rediction-\textbf{B}ased \textbf{KV}-Cache Management). For each workflow, PBKV predicts the agent invocations in several future steps by fusing the guidance from historical workflows and context of the target workflow. Based on the predictions, PBKV estimates the reuse potential of cache entries and keeps the high-potential entries in GPU memory. To be robust to prediction errors, PBKV utilizes the predictions conservatively during both cache eviction and prefetching. Experiments on three workflow benchmarks show that PBKV achieves up to $1.85\times$ speedup over LRU on dynamic workflows, and up to $1.26\times$ speedup over the SOTA baseline KVFlow on the static workflow.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑