Efficient Recurrent State Compression: A New Path to Boost LLM Inference Throughput

    As large language model architectures evolve to incorporate linear attention, state space models, and hybrid recurrent structures, recurrent states have emerged as a significant memory bottleneck during inference. This article explores a novel compression method that decomposes recurrent states into a dominant component and a low-rank residual. By applying differentiated strategies during the prefill and decoding phases, this approach reduces memory footprint and bandwidth pressure while maintaining accuracy. Empirical results demonstrate up to 42% throughput improvement with controllable precision loss, offering a practical pathway for optimizing next-generation inference infrastructure.

    1. The Neglected Second Memory Bottleneck

    When discussing the memory overhead of large language model inference, most engineering practices focus on the attention mechanism’s KV cache, which scales linearly with context length and is the most prominent cost in long-context scenarios. However, as new-generation model architectures widely adopt linear attention, state space models (SSMs), or hybrid recurrent structures, another overhead is quietly expanding: the Recurrent State.

    The recurrent state has a seemingly friendly characteristic: its size is fixed and does not grow with context length. But “fixed” does not mean “small.” Taking a mainstream fast inference model as an example, the recurrent state for a single request can reach hundreds of MBs when unoptimized, equivalent to the attention cache overhead of thousands of tokens. More challenging is its access pattern:

    • High-frequency read/write: For every generated token, the recurrent state must be fully read, updated, and written back once. The bandwidth pressure is directly proportional to the number of decoding steps.
    • Resource contention: The state must compete for limited GPU memory capacity alongside the KV cache and prefix cache of active requests, directly squeezing the system’s concurrency capacity.
    • Full-lifecycle presence: From the prefill phase to the entire decoding cycle, the state resides in memory, covering the entire request lifecycle.

    Therefore, after context length is gradually “tamed” by technologies like prefix caching and paged attention, the recurrent state naturally becomes the next optimization target worth conquering.

    2. Core Insight: Recurrent States are Compressible Tensors

    The prerequisite for compression is finding redundancy. Statistical analysis of recurrent states across massive real inference trajectories reveals a key pattern: the recurrent state read and written at each step exhibits significant structural characteristics in its numerical distribution.

    Specifically, it can be decomposed into two parts:

    1. Dominant Component: There is a near-fixed principal component direction in the state matrix. Regardless of input variations, a large chunk of the state’s energy is concentrated in a slowly changing direction. This part can be represented and incrementally maintained at a very low cost.
    2. Low-rank Residual: After stripping away the dominant component, the remaining content exhibits a clear low-rank structure, meaning it can be approximated by the product of two small matrices, with a rank much smaller than the original dimensions.

    Mathematically, this observation is not surprising—the recurrent state is essentially the integral of historical information, naturally carrying “memory inertia” with highly correlated change directions. Based on this decomposition, the compression approach follows naturally: instead of storing and moving the full state matrix, the model directly reads and updates the state in the decomposed form of “dominant component + low-rank residual.” The read/write byte count drops proportionally with the decomposed parameter count, alleviating the memory access bottleneck.

    An illustrative expression is as follows:

    1. Original form: S ∈ R^(d×k), full read/write at each step
    2. Decomposed form: S ≈ u·v^T + A·B^T
    3. u·v^T is the dominant component (direction approx. fixed, incrementally maintained)
    4. A·B^T is the low-rank residual (rank r ≪ min(d,k))
    5. Read/write cost: Drops from O(d·k) to O(d + k + r·(d+k))

    3. Differentiated Strategies for Two Phases

    Excellent system design does not use a single hammer for all nails. This compression method (hereafter referred to as the state decomposition compression scheme) adopts differentiated strategies for the two phases of inference.

    3.1 Prefill Phase: Reducing Deep Computation

    The goal of prefill is to compress long prompts into the recurrent state. The scheme leverages the incremental nature of the decomposed form, allowing the state to accumulate directly in a compressed shape during prefill. This avoids the “inflate then shrink” path of first building a complete dense state and then applying post-compression processing. This not only reduces peak memory but also cuts down on intermediate computation in deep layers.

    3.2 Decoding Phase: Reducing State Storage

    The decoding phase is the main battlefield for recurrent state overhead. The state always resides in memory in its decomposed form, and each step’s update only affects the dominant component coefficients and low-rank factors, rather than the full matrix. Empirical data shows: the single-request recurrent state drops from about 113MB to around 29MB in the initial compression stage, with an average footprint of about 43MB throughout the compression-maintenance cycle. This equates to a memory footprint reduction of roughly 60% to 75%, and this freed-up space can be immediately allocated to more concurrent requests or longer prefix caches.

    3.3 Compression Cycles and Accuracy Control

    Low-rank approximation inevitably introduces errors; the key is whether the errors are controllable and non-accumulating. The scheme adopts a periodic state realignment mechanism: when the residual rank grows to a threshold or cumulative error reaches the budget, a state reconstruction is triggered, pulling it back onto the low-rank manifold. Combined with the incremental correction of the dominant component, the error is bounded, preventing the drift problem of “increasing deviation with more compression” in long-sequence decoding.

    4. Empirical Performance and Quality Trade-offs

    Any compression technology must answer two questions: how much faster is it, and how much precision is lost?

    4.1 Throughput and Latency

    On data-center-grade next-generation GPUs, paired with a mainstream high-throughput inference framework, tests were conducted using typical long-context, multi-turn interaction trajectories like programming assistant (Agent) sessions. The results show:

    • Peak throughput per GPU increased by approximately 16% to 42%, with the magnitude varying based on load characteristics (context length, concurrency).
    • Under the constraint of the same P90 client-side end-to-end output rate—meaning compression is not achieved at the expense of user experience—the throughput improvement still reached about 23% to 42%.

    The latter set of figures is more convincing from an engineering perspective: it indicates that the gains are not from a latency-throughput trade-off shift, but a genuine improvement in system efficiency. The fundamental reason is that decoding shifts from “bandwidth-bound” back to “compute-bound,” significantly increasing the number of tokens that can be served per unit of time.

    4.2 Accuracy Regression Evaluation

    Regarding precision costs, the study conducted systematic quality evaluations across five models and six checkpoints, covering various benchmarks such as general QA, code generation, and long-text understanding. The evaluation concluded that the precision loss introduced by compression is within an acceptable range for the vast majority of tasks. This validates the universality of the “dominant component + low-rank residual” hypothesis across different model families—this is the value of the structural prior: it is not a parameter-tuning trick for a specific model, but a utilization of the inherent laws of recurrent states.

    5. Practical Recommendations for Engineering Implementation

    For teams looking to reuse this approach on their self-built inference platforms, the following points are worth noting:

    1. Profile State Distribution First: Before introducing compression, perform Singular Value Decomposition (SVD) analysis on your model’s recurrent state to confirm the dominant component proportion and the effective rank of the residual. Avoid blindly applying it to models where the structural prior does not hold.
    2. Coordinate with Existing Memory Management: The memory released by compression should be integrated into a unified paging and scheduling system. For example, in containerized inference services on cloud platforms, the saved memory budget can be fed back to the request scheduler to dynamically increase the concurrency limit.
    3. Set Error Budgets and Monitoring: Incorporate state reconstruction frequency, residual rank, and reconstruction trigger counts into the inference service’s monitoring and alerting system, and correlate them with downstream quality metrics to form an observable “performance-accuracy” closed loop.
    4. Gradual Rollout and A/B Testing: Compression is a lossy optimization. It is recommended to gradually roll it out in scenarios insensitive to minor numerical disturbances, such as programming assistants and document summarization, before broader promotion.

    6. Conclusion

    The essence of recurrent state compression is transforming “structural priors at the architecture level” into “resource dividends at the system level.” As KV cache optimization enters deep waters, fixed but massive resident memory like recurrent states will become the new battleground for inference efficiency competition. The “dominant component + low-rank residual” decomposition paradigm proves that as long as the right structure is found, writing to memory does not require reading the entire network. For inference infrastructure teams, this is both an immediate cost-reduction path and an important sample for understanding the collaborative design of next-generation model architectures and systems.