Why does an AI agent respond more slowly the longer a conversation runs? Each turn resends the whole history, and the server often reprocesses all of it. AWS describes a technique called bi-directional KV cache transfer for the open-source serving engine vLLM that reduces this repeated work.
What problem does it address?
Agentic workloads are multi-turn: an agent reasons, calls tools and builds on earlier results.
A KV cache (key-value cache) stores the intermediate calculations a model makes for text it has already read. Reusing it saves the cost of recomputing that text. Time to first token (TTFT) is the delay before the first word of an answer appears.
How does split serving work today?
AWS points to prefill-decode disaggregation, where each request is split across specialized machines. A prefill node reads the prompt and builds its KV cache. A decode node then fetches those blocks and generates the reply.
AWS explains that conventional setups move KV cache only one way, from prefill to decode. That creates two inefficiencies in multi-turn use.
- After replying, the decode node holds cache entries for both the prompt and the new response. The prefill node cannot fetch them next turn, so it recomputes the earlier response tokens.
- The decode node keeps the session state while prefill nodes do not. Active sessions are therefore more likely to be evicted from prefill caches, and a full miss forces recomputation of the entire history.
AWS says this redundant work consumes more accelerator capacity and raises TTFT as conversations grow.
What changes with bi-directional transfer?
In AWS’s description, the decode node keeps eligible cache blocks after generating a reply and returns their location details in its streaming response. A router stores that information. On the next turn, the prefill node checks what it can reuse, and if enough tokens qualify under a configurable threshold, it reads the blocks back from the decode node before computing only the new remainder.
AWS says the transfer itself uses the same read mechanism in both directions, through the NVIDIA Inference Xfer Library connector. It also notes that prefill and decode nodes are architecturally different, so each keeps its own logic for handling block metadata. Decode nodes can only serve blocks they have already cached, while prefill nodes can provide complete prompt blocks.
What does the router do?
Coordinating reuse across turns requires a KV-cache-aware router. AWS describes it as a lightweight, stateful component sitting between the client, prefill and decode nodes. It maps a client-provided conversation ID to the decode node’s transfer details.
- On the first turn the lookup misses, and the request follows the standard prefill-to-decode path.
- The router saves the decode metadata from the response stream.
- On later turns it retrieves that metadata so prefill can reuse the cache, then refreshes it after generation.
AWS states that the router stores only block-location metadata, not the cached data itself, and gets it from the response stream instead of querying the decode node separately. vLLM’s repository includes an example proxy implementing this flow, which AWS says can be adapted to other environments.
What results did AWS report?
AWS reports multi-turn benchmarks on a deployment with one prefill and one decode node, running on Amazon EC2 P5en instances. Bi-directional transfer reduced TTFT by up to 1.6x for Qwen3-32B and up to 3.3x for GLM-5-FP8. AWS adds that results vary with workload and configuration. These are vendor-reported figures from a single post.
The instances are linked by AWS Elastic Fabric Adapter, a low-latency network using remote direct memory access (RDMA), which lets machines read each other’s memory directly. AWS says that on supported instance types, it moves cache blocks directly between GPU or AWS Trainium memory on the two nodes.
Where does it run?
AWS says it first built and validated the feature on AWS Trainium clusters connected with EFA, then contributed it to vLLM as an accelerator-agnostic capability. The reported benchmark results come from the P5en GPU cluster, which AWS says shows the benefits carry over to GPUs.
AWS also lists retention and recompute controls and reproduction steps for the benchmark among the post’s topics. The excerpt available here covers the architecture and router flow in detail but not those later sections, so exact settings and the full performance tables remain in AWS’s original post.
Open question
The reported gains come from a small one-prefill, one-decode deployment. How the benefit scales across larger clusters with many concurrent conversations is not shown in the material covered here.