Speculative Decoding for Long Contexts: Sharing KV Caches and Sparse Indices

    A draft-model design reuses a sparse-attention target model’s KV caches and selected attention positions, eliminating separate draft-side context caches. This article explains the architecture, the index-overlap assumption that makes it viable, reported gains on long-context and agent workloads, and the limitations teams should evaluate before deployment.

    1. Why Draft Models Can Become a Bottleneck

    As context windows expand to hundreds of thousands or even millions of tokens, some major large language models have adopted native sparse attention. Each layer uses an indexer to select a fixed number of top-k historical positions for each query at inference time. Attention is computed only over those positions; the rest are skipped.

    This approach balances model quality and computational cost, but it introduces a new tension for speculative decoding.

    In standard speculative decoding, a much smaller draft model proposes several candidate tokens. The target model then verifies them in parallel and accepts the valid portion, allowing a single target-model forward pass to produce multiple tokens.

    Traditional draft models generally follow the design of dense models: they maintain their own full KV cache or truncate it with a sliding window. That overhead was relatively modest when the target model also stored a full KV cache.

    Once the target model reduces its own KV-cache footprint, however, the draft model’s cache becomes a much larger share of total memory consumption. The consequences extend beyond GPU memory:

    • Additional prefill work: Computing the draft model’s KV cache adds latency before the first token.
    • Reduced prefix-cache effectiveness: Separate draft-side caching lowers prefix-cache hit rates and compounds redundant work in multi-turn and high-concurrency workloads.
    • Smaller concurrent batches: Cache pressure limits the batch sizes the service can support, reducing overall throughput.

    The more efficient the target model becomes, the more visible the draft model’s historical-state overhead becomes.

    2. The Core Design: Share KV Caches and Sparse Indices

    A recently open-sourced draft-model design addresses this problem through two forms of reuse:

    1. KV sharing: Each draft layer is paired with a corresponding target-model layer and reads that layer’s existing KV cache directly. The draft model does not maintain a separate context cache.
    2. Index sharing: Draft layers do not run their own index-scoring logic. Instead, they use the sparse positions already selected by the corresponding target-layer indexer.

    The target model has already stored the relevant KV state and selected the positions to attend to. The draft model reuses both.

    This eliminates separate draft-side context-cache storage, along with the additional cache-related burden on prefill, prefix caching, and concurrency.

    3. The Key Assumption: Earlier Index Selections Remain Useful

    Sharing indices raises an important question. Speculative decoding proposes a block of tokens at once, so later tokens in that block rely on index selections generated earlier rather than fresh selections for each token.

    If those earlier selections differ substantially from the positions each later token would choose for itself, draft quality could deteriorate.

    Measurements reported in the paper show that, for the particular sparse-attention target model tested, selections made one step ahead still covered roughly 90% of the positions selected by subsequent tokens themselves.

    That overlap is the foundation of the method. Because it is high, the loss in draft accuracy from reusing indices remains acceptable.

    For teams considering other sparse models, this coverage metric may be more informative than the headline end-to-end benchmarks. It is an initial test of whether the design is likely to transfer: do previously selected positions remain relevant enough for subsequent draft tokens?

    4. Reported Results: Greater Benefits at Longer Contexts

    Under the same training recipe, the method achieved a higher average number of accepted tokens per step than both a conventional block-parallel drafting approach and a sparse-matching baseline:

    • General tasks: Approximately 3.9%–10.5% higher.
    • Long-context tasks up to 128K tokens and agent tasks: Approximately 10.0%–31.5% higher.
    • Throughput at a 64K-token context: Approximately 62% and 81% higher in two tests covering high-concurrency operation and a setting with matched single-user decoding speed.

    Official materials also report decoding speedups for agent workloads. Token-generation speed exceeded 4× in some cases, reached approximately 4.5× on one long-horizon agent benchmark, and averaged around 3.4× overall.

    These are decoding-speed figures, not claims about equivalent reductions in total agent execution time.

    The reported pattern is clear: longer contexts and greater cache pressure increase the relative value of this design.

    That makes it particularly relevant to agent workflows, where tool calls, multi-step planning, and long-document processing can produce contexts spanning tens of thousands of tokens. These workloads place substantial pressure on long-context decoding.

    5. Limitations and Open Questions

    The approach is not a universal solution.

    It depends on native sparse attention

    Layer-by-layer sharing requires a target model with a per-layer indexing structure. The design described here does not apply directly to dense-attention models. Sliding-window alternatives would also need separate validation of the index-coverage assumption.

    The baselines were trained by the authors

    The paper’s comparison baselines were reproduced by the authors using the same training recipe. This supports a controlled comparison, but the community still needs to establish how much of the reported benefit carries over to third-party inference frameworks.

    Index coverage is model-dependent

    The roughly 90% coverage figure was measured on a specific model. A different indexer design or a different number of selected positions could change that result.

    Teams should measure coverage again rather than assume the same overlap will hold across sparse-attention architectures.

    6. Practical Implications for Inference Teams

    For teams operating their own inference services, three lessons are directly useful:

    • Start with cache accounting. Measure how much memory the draft model’s KV cache consumes relative to the target model’s cache. That ratio helps establish the potential optimization opportunity.
    • Prioritize structural reuse for sparse targets. If the target model uses sparse attention, evaluate designs that reuse its existing structure rather than giving the draft model an independent cache and indexing path.
    • Validate with real agent workloads. Long-context performance can differ substantially from short-chat performance. Treat published results as directional evidence, not a substitute for testing your own workloads.

    The broader architectural lesson is that inference accelerators need to evolve alongside the target model. As attention becomes sparser and more selective, draft models, cache systems, and schedulers must align with that structure.

    For long-context inference, reusing the target model’s existing state and selection work can be more valuable than optimizing a separate drafting pipeline in isolation.