Efficient Serving for Dynamic Agent Workflows with Prediction-based KV-Cache Management
Haoyu Zheng, Fangcheng Fu, Jia Wu, Binhang Yuan, Yongqiang Zhang, Hao Wang, Yuanyuan Zhu, Xiao Yan, Jiawei Jiang
NeurIPS page · OpenReview · Open on the map
Category: Efficient LLM Inference & Training › Efficient LLM Serving Scaling · Type: system or tooling · Keywords: dynamic agent workflows, KV-cache management, prediction-based, LLM serving, cache reuse
Areas: Memory › Model Memory Optimization › KV Cache Optimization; AI Agents › Agent Optimization and Evaluation › KV Cache Optimization
Summary
PBKV is a prediction-based KV-Cache management system that dynamically reuses cache entries in LLM agent workflows, achieving up to 1.85× speedup over LRU on dynamic workflows.
Explained to a 5-year-old
In a big computer program, many little helpers (agents) work together to solve tasks. They often share what they learned so they don’t have to start from scratch. Sometimes the helpers change which tasks they do, making it hard to know what to keep saved. The system watches past helpers’ actions and guesses what will happen next, keeping the most useful saved parts. This helps the helpers work faster by reusing what they already know.
Explained to a 5-year-old, longer
Imagine a big computer brain that can talk and answer questions, called an LLM. To do complicated jobs, it uses several small helpers, each specialized in a different part of the task. These helpers need to remember what they have seen before, because remembering saves time and effort. The helpers keep this memory in a special place called a cache, usually on a fast piece of hardware. When the helpers work together in a sequence, they often need the same memory, so sharing that memory can make everything faster. However, sometimes the order of helpers changes depending on the problem, making it hard to know which memory will be needed next. Old methods either only looked at each helper individually or assumed the order never changes, so they missed many chances to reuse memory. The new idea watches how helpers have acted in the past and guesses which helpers will be called in the future for a new task. Based on those guesses, it decides which memory entries are likely to be useful and keeps them in the fast cache. If the guesses are wrong, the system plays it safe and does not rely too much on them, avoiding losing important memory. This way, the helpers can quickly find the information they need without recomputing everything. As a result, the whole system runs faster, especially when the helpers change their order often.
For a technical reader
The system, called PBKV, predicts which agents will be invoked in future steps of a workflow by blending historical patterns with the current task context. It then estimates how much each cached key-value entry can be reused and keeps the most promising entries in GPU memory. To guard against prediction mistakes, PBKV conservatively applies these predictions during both cache eviction and prefetching, ensuring stability. Evaluations on three workflow benchmarks show speedups of up to 1.85× over a simple LRU policy for dynamic workflows and 1.26× over the prior state-of-the-art KVFlow on static workflows. This approach reduces serving latency and GPU memory pressure for dynamic LLM-based agent pipelines.
Problem
Dynamic LLM agent workflows have variable sequences of agents, making it hard to efficiently reuse KV-Cache across tasks. Existing cache management either works at the agent level, missing reuse opportunities, or assumes static agent sequences, which does not reflect real-world dynamic workflows.
Method
The approach predicts future agent invocations by combining historical workflow patterns with the current task context, estimates the reuse potential of cache entries, and retains high-potential entries in GPU memory while conservatively handling prediction errors during eviction and prefetching.
Results
The approach achieves up to 1.85× speedup over LRU on dynamic workflows and up to 1.26× speedup over the SOTA baseline KVFlow on static workflows.
Contributions
It introduces a prediction-based cache management technique that handles dynamic agent sequences and conservatively manages prediction errors, along with experimental validation on multiple workflow benchmarks.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction