Hybrid-Architecture LLM Agents: Redesigning State Caching for Higher Throughput

    Hybrid LLM architectures that combine full attention with linear or state-space layers can reduce KV cache overhead and improve long-context inference. This article explains how decoupled state-cache management, optimized memory pipelines, CPU memory expansion, and cross-node reuse help programming agents handle long, multi-turn sessions more efficiently. In evaluations on a latest-generation high-performance GPU, the approach achieved up to 3.14× higher prefill throughput and reduced P90 time to first token by as much as 88.4%.

    As large language models become better at processing long documents and multi-turn conversations, traditional architectures based entirely on standard self-attention are increasingly constrained by GPU memory capacity. To achieve faster decoding and reduce KV cache overhead, many modern open-source models are adopting hybrid architectures that combine full-attention layers with linear layers, such as state-space models.

    These architectures offer significant advantages for long-sequence processing and are becoming increasingly suitable for demanding workloads such as coding agents and document analysis. However, cache management becomes considerably more complex in long-context, multi-turn agent workloads.

    A pure Transformer model primarily needs to manage a continuously growing KV cache. A hybrid model must manage both the KV cache from full-attention layers and the internal hidden states maintained by linear or state-space layers. Conventional inference engines often struggle to handle these two fundamentally different cache types. As a result, historical context cannot be reused effectively across turns, redundant computation increases during prefill, and time to first token (TTFT) suffers. This directly affects the responsiveness of agent applications.

    To address this challenge, research teams have proposed a new hybrid state-cache architecture. It redesigns how KV and recurrent state caches are stored and scheduled, with the goal of improving hardware utilization and reducing repeated computation in long-context scenarios.

    1. Decoupled State-Cache Management

    The approach manages the KV cache of full-attention layers separately from the recurrent states of linear layers.

    For full-attention layers, it retains efficient paged-cache management. For linear layers, it introduces a compact, specialized format for storing recurrent states. Separating the storage paths and access logic prevents repeated initialization and forward computation during multi-turn interactions, substantially reducing wasted compute during prefill.

    2. Efficient Memory Layout and Pipelining

    Taking advantage of the characteristics of the latest generation of high-performance GPUs, the architecture optimizes memory-access patterns and reduces the overhead caused by fragmented or non-contiguous accesses.

    During prefill, loading, computing, and storing hybrid states are overlapped through a pipeline. This significantly reduces the waiting time associated with compute-intensive operations. When processing very long conversation histories, the model can therefore move data at a throughput close to the practical limits of the available hardware bandwidth.

    3. Large-Scale CPU Extension Cache

    For extremely long contexts and multi-user concurrency, the memory capacity of a single GPU is often insufficient. The architecture introduces an extension-cache layer backed by large-capacity CPU memory.

    Using a hot-and-cold data strategy, frequently accessed recent states remain in GPU memory, while older long-tail states are offloaded to CPU memory. This design expands the available cache capacity while keeping the risk of GPU memory overflow very low, making extremely long agent sessions more practical.

    4. Cross-Node Distributed State Reuse

    In a distributed inference cluster, different nodes may process branches of the same user’s request or receive traffic through load balancing. The hybrid state-cache architecture supports distributed storage natively, allowing KV caches and linear-layer states to be reused across nodes.

    When a request is routed to another node, the system does not need to recompute the long historical prefix. This can significantly improve overall cluster resource utilization.

    Performance Evaluation

    In practical tests, the research team replayed real multi-turn interaction traces from coding tools on a latest-generation high-performance GPU.

    Compared with a mainstream general-purpose open-source inference framework, the hybrid state-cache approach delivered up to 3.14× higher throughput during prefill. It also reduced P90 time to first token by as much as 88.4%.

    The performance gains remained significant even after adding up to 512 GB of CPU extension cache. This demonstrates strong scalability for extremely long-context workloads.

    Engineering Recommendations

    For teams building enterprise-grade agent applications, selecting a hybrid-architecture model and designing an efficient caching system can be an important way to improve system performance and responsiveness. The following considerations are particularly important.

    1. Match the Model Architecture to the Workload

    Not every workload benefits equally from a hybrid architecture. For coding-agent tasks that involve many turns and very long per-turn contexts, the long-context advantages of hybrid models can be substantial.

    For simpler single-turn question-answering workloads, a traditional Transformer may be sufficient. Teams should evaluate the match between model architecture and workload characteristics through representative performance testing.

    2. Combine Multi-Level Caching with Cloud-Native Infrastructure

    In cloud deployments, high-performance compute instances and network storage services can be used to build elastic inference infrastructure. For example, high-performance compute instances and a cloud-native container platform can simplify the construction of a distributed inference cluster with elastic scaling capabilities.

    The hybrid state-cache design can also be integrated with cloud-native storage volumes to support state persistence and sharing across nodes.

    3. Monitor and Schedule at Fine Granularity

    A robust logging, monitoring, and alerting system should track GPU memory utilization, CPU cache utilization, prefill duration, and cross-node state synchronization latency in real time.

    Based on these metrics, the system can dynamically adjust batch sizes and offloading policies to maintain stability under high concurrency.

    Conclusion

    Hybrid LLM architectures provide a promising approach to overcoming GPU memory limitations in long-context inference. However, redesigning state-cache management is essential to fully unlock their potential.

    Through decoupled cache management, multi-level capacity expansion, and cross-node state reuse, the new generation of cache architectures can significantly improve prefill throughput and time to first token. They also provide a strong foundation for building large-scale, highly responsive AI agent systems.