Bridging the Gap: Position-Independent Cache Reuse for Hybrid SSM-Attention Architectures

Weikang Wang, Xin Zhou, Haiyang Liu, Lei Wang, Jun Liu, Weifeng ZhangNeurIPS 2026

TL;DR

Hybrid large language models combine the razor-sharp memory of standard Transformers with the lightning-fast linear scaling of State Space Models (SSMs). However, this architectural marriage breaks our best tricks for reusing precomputed document caches—because while Transformer caches snap together like Lego bricks, SSM states are stubbornly sequential. HyPIC solves this mismatch, letting hybrid models mix, match, and reuse precomputed text chunks on the fly to double response speeds without sacrificing accuracy.

What Problem Does This Paper Address?

Imagine you’re running a Retrieval-Augmented Generation (RAG) system. Different users ask different questions, pulling in varying combinations of the same underlying documents. Re-reading those documents from scratch every time is computationally wasteful.

In standard full-attention Transformers, we avoid this via Position-Independent Caching (PIC): we precompute the Key-Value (KV) cache for each document chunk offline, and at query time, concatenate them in whatever order we need, touching up just a few tokens to stitch the context together.

Recently, hybrid architectures (which interleave full-attention layers with recurrent SSM layers like Mamba) have surged in popularity for long-context tasks. Attention handles fine-grained recall; SSMs compress history into a compact, fixed-size hidden state for linear-time efficiency.

Here’s the catch: SSM states are strictly history-dependent—the state of Chunk B depends entirely on Chunk A having come right before it. While Attention layers allow flexible token-level cache reuse, SSMs only support rigid prefix matching. If Chunk B appears in a new order, the SSM suffers a cache miss, invalidating cache hits in adjacent attention layers and tanking the pipeline. Existing attempts to "average" isolated SSM states scramble temporal dynamics, causing generation quality to plummet.

Figure 1: The misalignment bottleneck in hybrid model cache reuse. Ti denotes the cached state for the i-th token, and Ti:j represents the chunk-level cache for the sequence from token i to j.

Methods

HyPIC aligns both layer types at the chunk level using an offline-online split. Offline, documents are processed independently: Attention layers save standard KV caches, while SSM layers save just two boundary states (near the start and end of the chunk) plus compact "decay" factors that govern how fast historical memory fades.

Online, when chunks are assembled into a new prompt, HyPIC applies a unified recomputation window of $2K$ boundary tokens (the last $K$ tokens of one chunk and the first $K$ of the next). While Attention layers follow standard PIC concatenation and boundary updates, HyPIC introduces three novel mechanisms for SSMs:

Figure 2: Overview of the state propagation pipeline in HyPIC.
  1. Residual State Propagation: Exploiting the linear recurrence of SSMs, HyPIC subtracts the offline isolated equation from the online equation. This cancels out the heavy token-by-token input processing in the middle of the chunk, allowing the model to leapfrog across the intermediate tokens by propagating just the difference (residual) between the offline and online starting states.
  2. Online Decay Correction: Because preceding context alters how much an SSM "forgets," using raw offline decay matrices introduces drift. HyPIC measures how much the decay shifted in the recomputed $K$-token prefix, decomposes that shift into magnitude and direction, and extrapolates it to calibrate the cumulative decay of the skipped middle region.
  3. Fast Parallel Recomputation: Recomputing boundaries chunk-by-chunk in a sequential Python loop creates terrible GPU launch overhead. Using linear superposition, HyPIC decouples data-driven responses from historical states: it runs one batched "zero-state" GPU scan across all boundaries simultaneously, links the anchor states via a lightweight tensor loop, and finishes with one final parallel scan. This drops $O(M)$ sequential kernel launches down to $O(1)$.

Datasets

No new benchmarks were introduced; the authors evaluated HyPIC on established long-context suites:

  • LongBench: MuSiQue, HotpotQA, and NarrativeQA (question answering), SAMSum (few-shot summarization), and LCC (code completion).
  • InfiniteBench: Passkey (needle-in-a-haystack retrieval) and LongBookQA, scaled up to prompts exceeding 50,000 tokens (50 chunks of 1,024 tokens).

Key Insights and Ideas

  • Prefix errors predict future drift: How can you correct the memory decay of 900 skipped tokens without looking at them? The authors discovered a clear linear correlation between how much a chunk's decay diverges in its first $K$ prefix tokens and how much it diverges in the rest of the chunk. Measuring the boundary gives you a reliable compass for the interior.
Linear correlation between decay errors in chunk prefixes and subsequent intermediate regions.
  • Linear superposition breaks sequential bottlenecks: Even though recurrent states depend on one another sequentially, separating the zero-state input response from the initial state propagation lets GPUs crunch all chunk boundaries in parallel.
  • Constant-size SSM caching: Unlike KV caches that balloon linearly with chunk length, HyPIC’s per-chunk SSM cache footprint remains constant for a fixed $K$, with decay metadata taking up less than 1% of the SSM cache size.

Key Results

Tested across Nemotron-H (8B), Qwen3.5 (9B & 27B), Kimi-Linear (48B MoE), and pure-SSM Mamba-Codestral (7B):

  • Speedup & Accuracy: At $K=64$, HyPIC matches Full Recompute generation quality while achieving an average $2\times$ speedup in time-to-first-token (TTFT) on LongBench, and up to $2.5\times$ speedup on 50K-token InfiniteBench tasks.
  • Crushing Naive Baselines: On 50K-token Passkey retrieval, heuristic SSM fusion methods (Average and A-Decay) scored 0.00% accuracy, whereas HyPIC maintained a perfect 100%.
  • Dynamic RAG Hit Rates: On a shuffled streaming MuSiQue workload (50 chunks, Qwen3.5-9B), HyPIC achieved a 66.76% cache hit ratio, compared to just 2.32% for Marconi (a hybrid prefix-caching baseline).

Limitations and Future Work

  • MoE Routing Bottlenecks: TTFT speedups are noticeably smaller on Mixture-of-Experts models like Kimi-Linear (e.g., ~1.45$\times$ vs. ~2.5$\times$ on dense models for InfiniteBench). Because fewer parameters are active per token, sequence/attention compute takes up a smaller slice of total latency relative to expert routing overhead. The authors note that future, heavily optimized MoE kernels will shift the bottleneck back toward attention/SSM layers, amplifying HyPIC's gains.
  • Transition Approximations for Delta Networks: For complex Gated DeltaNet architectures (Qwen3.5, Kimi-Linear), storing exact state-transition interactions is memory-prohibitive, requiring HyPIC to approximate propagation using only the primary scalar or diagonal decay factors.

Summary updated

Abstract

Hybrid large language models (LLMs) integrating state space models (SSMs) and full attention face a critical caching bottleneck due to mismatched caching granularities. While full attention allows flexible, token-level cache reuse, SSMs are always restricted to coarse-grained block- or request-level reuse. Consequently, an SSM layer's cache miss can easily invalidate successful fine-grained hits in adjacent attention layers, disrupting the entire reuse pipeline. To resolve this, chunk-level position-independent cache (PIC) reuse is highly desirable to align the caching granularity across all layers. However, enabling PIC reuse for history-dependent SSMs remains fundamentally challenging. To bridge this gap, we propose HyPIC, the first unified framework achieving PIC reuse for hybrid architectures. We introduce residual state propagation and online decay correction, which efficiently adapt offline SSM chunk caches to new contexts by explicitly recomputing minimal boundary tokens. Furthermore, we design a fast parallel recomputation pipeline exploiting the linear superposition property of SSMs to eliminate sequential bottlenecks. Experiments on diverse hybrid models and datasets demonstrate that HyPIC achieves a 2$\times$ speedup in time-to-first-token (TTFT) while maintaining highly competitive accuracy. Code is available at: https://github.com/Lenovo-ICI/HyPIC.
BibTeX
@inproceedings{wang2026bridging,
  author = {Weikang Wang and Xin Zhou and Haiyang Liu and Lei Wang and Jun Liu and Weifeng Zhang},
  title = {{Bridging the Gap: Position-Independent Cache Reuse for Hybrid SSM-Attention Architectures}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=SZ24HRIAMK},
}
Figure