Dual-Path Collaborative Architecture for Agent Inference: Reducing KV Cache Transfer Bottlenecks
This article explains why GPU utilization alone can misrepresent service efficiency in LLM inference, especially in agent workloads with multi-turn dialogue, tool calls, and complex orchestration. It covers the rationale for separating Prefill and Decode, why KV Cache transfer becomes a bottleneck, the limitations of a traditional single-path approach, and how a dual-path collaborative architecture lets Decode-side resources participate in cache reading and forwarding. It also examines engineering challenges such as data sharding, routing, consistency, scheduling, and failure recovery, and outlines metrics for evaluating this type of architecture objectively.
In large model inference systems, GPU utilization does not always represent real service efficiency. This is especially true in agent scenarios composed of multi-turn dialogue, tool calls, and complex task orchestration. In these cases, the GPU is sometimes not “unable to compute fast enough” but rather “waiting too long for data.” This is one important reason inference systems have continued to evolve in recent years.
A representative improvement direction is to introduce a dual-path collaboration mechanism on top of Prefill and Decode separation, allowing compute resources in different stages to participate together in reading and transferring context data. This helps alleviate congestion on a single data path.
1. Why Split Inference into Prefill and Decode
Large model text generation can generally be abstracted into two stages.
The first stage is Prefill. The system sends the user input, historical dialogue, and possibly attached tool results into the model at once. After multi-layer network computation, it forms the intermediate states required for subsequent generation. One of the most important is the Key-Value Cache used by the attention mechanism, also known as KV Cache.
The second stage is Decode. Based on the already processed context, the model generates one new token at a time and appends the intermediate state corresponding to the new token to the cache. This process runs in a loop until generation ends or a stopping condition is reached.
For example, after a user enters a long question, the system first needs to perform batch computation on the complete input. This is Prefill. The model then produces output tokens one by one. This part is Decode. The two have clearly different computational characteristics:
- Prefill usually processes longer input sequences and is suitable for large-scale parallel computation.
- Decode generates only a small number of new tokens per round but repeatedly accesses existing context.
- Prefill more easily forms compute-intensive workloads.
- Decode is more susceptible to memory access latency, communication latency, and scheduling overhead.
Therefore, in actual deployment, the two stages are often assigned to different GPU resource pools so they can be optimized separately. This approach helps improve resource utilization, but it also introduces new data transfer problems.
2. Why KV Cache Becomes a New Bottleneck
In multi-turn dialogue, historical content has usually already been processed. If the system recomputes all context for every request, it not only increases computation but also significantly extends time to first token. Therefore, the system saves the KV Cache corresponding to historical context and reuses it directly when the next request arrives.
KV Cache can be stored in multiple locations:
- In the current GPU memory, with fast access but limited capacity;
- In the memory of other GPUs, requiring reads through the GPU interconnect network;
- In host memory or external storage, with larger capacity but usually less favorable access latency and bandwidth.
When context is short and concurrency is low, the cost of cache reads may not be prominent. In agent scenarios, however, a request often goes through multiple rounds of inference, tool calls, task planning, and result integration. Historical context keeps growing, and the size of KV Cache expands accordingly.
At this point, the Prefill side may encounter an execution state like this:
- The Prefill GPU is ready to compute;
- But the required KV Cache has not fully arrived;
- GPU compute units are waiting;
- The storage network or data movement path remains busy;
- The Decode side lacks new tasks for the moment and cannot work fully either.
In other words, the system bottleneck shifts from “insufficient compute capacity” to “insufficient data supply.” If only compute resources continue to be added without improving the data path, overall returns will become increasingly limited.
3. Problems with Traditional Single-Path Movement
In a relatively common architecture, the Prefill side handles two jobs at the same time:
- Reading KV Cache from external cache locations;
- Performing model computation on the input and generating new intermediate states.
These two tasks share the same set of network, DMA channels, or communication resources. When the cache scale is large, data reading occupies substantial bandwidth, preventing compute tasks from starting in time.
A simplified flow can be represented as:
External cache││ Read KV Cache▼Prefill GPU││ Context computation▼Generate new intermediate states│▼Decode GPU
In this mode, all cache data passes through the Prefill node. The Prefill node is both a compute node and a data entry point, making it prone to a centralized bottleneck.
More complexity comes from the bursty nature of agent requests. One stage may suddenly produce a large amount of historical context, while another stage may temporarily lack enough Decode tasks. Resource load therefore becomes clearly unbalanced: some GPUs are busy waiting for data, while the compute and network capabilities of other GPUs are not fully utilized.
4. Core Idea of Dual-Path Collaboration
The basic idea of dual-path collaboration is to stop making the Prefill GPU complete all cache movement alone. Instead, the Decode side also participates in data reading and then forwards the data to Prefill through a high-speed GPU-to-GPU interconnect network.
The new data flow can be abstracted as:
┌──────────────┐│ Prefill GPU ││ Context ││ computation │└──────┬───────┘▲│ GPU-to-GPU high-speed interconnect│┌──────────────┐ ││ Decode GPU │────────┘│ Read cache ││ and forward │└──────┬───────┘││ Access external KV Cache▼Cache storage system
There are three key changes.
1. Distribute data reading tasks to idle resources
If the Decode side currently has insufficient generation tasks, its compute and communication resources may be underutilized. It can then take on cache prefetching, sharded reading, or data forwarding tasks, improving overall resource efficiency.
2. Decouple external storage access from model computation
The Prefill GPU does not have to wait for all cache data to arrive before starting work. The system can split cache reading, data validation, shard reassembly, and model computation into a pipeline so that data movement and computation overlap as much as possible.
3. Use more efficient GPU-to-GPU communication links
External storage networks are usually better suited to persistent access, but in high-concurrency, large-scale cache transfer scenarios they may become a limiting factor. Dedicated high-speed interconnect networks between GPUs can often provide lower communication latency and higher device-to-device transfer capability.
It is important to note that a dual-path architecture is not simply sending data on a detour. It attempts to use parallel resources that are already idle in the system to form multi-channel data supply. The final effect depends on whether external storage bandwidth, GPU interconnect capability, cache distribution, and scheduling policies match one another.
5. Main Highlights of This Architecture
Highlight 1: Improve resource utilization
In traditional schemes, the Decode side may sit idle due to a lack of tasks. Dual-path collaboration turns it into a participant in data movement, allowing GPU compute, memory, and network capabilities to be used more fully.
The “utilization improvement” here should not be understood simply as all GPUs remaining fully loaded. Rather, it means improving overall system throughput, request completion speed, and effective compute time.
Highlight 2: Alleviate Prefill ingress congestion
When all KV Cache flows into the Prefill node, the Prefill side can easily become a single point of bottleneck. By reading in parallel across multiple nodes and then distributing data to target nodes, the input pressure on a single Prefill node can be reduced.
Highlight 3: Improve compute-communication overlap
Ideally, the system can perform the following operations at the same time:
- The Decode side reads the next batch of KV Cache;
- The GPU-to-GPU network transfers data that has been read;
- The Prefill side processes context that has already arrived;
- The scheduler prepares subsequent requests and cache shards.
When these steps can form a pipeline, overall waiting time decreases.
Highlight 4: Better suited to long-context and complex agent tasks
For single-turn, short-text requests, the benefits of this architecture may be limited because additional data forwarding and scheduling also incur costs. In long-context, multi-turn interaction, frequent tool calls, and high-concurrency tasks, however, KV Cache scale is larger and data access more easily becomes a bottleneck. The value of the dual-path approach becomes more obvious in these cases.
6. Engineering Issues That Cannot Be Ignored in Deployment
A dual-path architecture does not automatically deliver benefits simply by adding a forwarding step. Real deployment requires solving the following issues.
1. Data sharding and routing
The system needs to know which node, device, or storage tier a segment of KV Cache is located in and choose an appropriate reading path. If routing information is inaccurate, problems such as duplicate reads, cross-node detours, or data concentration on a single node may occur.
2. Transfer granularity
If data is split too finely, it creates substantial scheduling and communication metadata overhead. If it is split too coarsely, pipeline parallelism may be reduced. Practical systems usually need to choose shard size dynamically based on context length, network bandwidth, and request concurrency.
3. Cache consistency
In multi-turn dialogue, new tokens are continuously appended to KV Cache. The system must clearly define cache versions, append order, and invalidation rules to prevent Prefill from reading incomplete or stale data.
4. Scheduling policy
The Decode side should not always participate in data movement. If Decode is under high load, forcibly assigning reading tasks may instead affect generation latency. Therefore, the scheduler needs to consider:
- Current Decode queue length;
- Prefill waiting time;
- External storage bandwidth;
- GPU interconnect load;
- Request priority and deadlines;
- Cache hit rate and data size.
5. Failure recovery
When a GPU responsible for reading or forwarding fails, the system needs to switch to a backup path and reread data from another cache replica or storage tier. Otherwise, a single forwarding node failure may block the entire request chain.
7. How to Evaluate This Type of Innovation Objectively
From a technical route perspective, the value of dual-path collaboration is not that it proposes a simple idea of “letting idle GPUs help move data.” Rather, it reexamines resource boundaries in inference systems: a GPU is not only a compute device but can also become part of cache access, data prefetching, and high-speed forwarding.
This design is especially suitable for scenarios where compute resources are constrained but long-context and high-concurrency inference must be supported. Through system-level collaboration, it attempts to replace simple hardware stacking with more reasonable resource scheduling.
However, it is not a universal optimal solution for all workloads. For short-input, low-concurrency tasks, additional forwarding, scheduling, and synchronization may offset the benefits. In environments with weak GPU-to-GPU interconnect capability, data detours may also increase communication latency. Therefore, when evaluating this type of architecture, one should not look only at peak bandwidth or GPU utilization. The following metrics should also be considered:
- Time to first token;
- Total response time per request;
- Number of requests completed per unit time;
- KV Cache hit rate;
- External storage bandwidth utilization;
- GPU interconnect link utilization;
- Performance changes across different context lengths;
- Stability under high concurrency and burst traffic.
8. Conclusion
Prefill and Decode separation addresses the different characteristics of large model inference stages, but it may also make KV Cache transfer a new bottleneck. Especially in agent scenarios, long context, multi-turn interaction, and tool calls significantly increase cache access pressure, leaving some GPUs waiting for data while other GPUs lack effective tasks.
The core of the dual-path collaborative architecture is to let the Decode side participate in cache reading and data forwarding at appropriate times, and then use the high-speed GPU-to-GPU interconnect network to provide parallel data supply to Prefill. Its essence is a shift from “a single node handling all movement” to “multiple resources coordinating data supply,” thereby improving the balance between computation and communication.
From a longer-term perspective, competition in future inference systems will not be limited to model computation speed. It will also extend to system capabilities such as cache management, data layout, network topology, task scheduling, and failure recovery. Those who can coordinate computation, storage, and communication more effectively are more likely to achieve higher inference efficiency with limited hardware resources.
