ZICQ
中 Log in / Sign up
Newsroom LLMs & Foundation Models #DeepSeek #Sparse Attention #SGLang #Long-Context Inference #Inference Optimization

MLI Restructures DeepSeek Sparse Attention for Faster Training-Free Decoding

Avatar of Mr.Xu

By Mr.Xu Compiled & Reviewed by Editorial

Published:

中文阅读 (Chinese) English Version

Summary:The paper introduces Multi-layer Indexer (MLI), a training-free method for DeepSeek Sparse Attention that exploits the substantial overlap between token selections made by adjacent layers. By reusing the preceding layer's index, MLI removes the serial dependency between the lightning indexer scan and sparse attention. The default implementation integrates with SGLang's production decode graph and composes with IndexCache, or IndexShare in GLM-5.2. Across 10K–195K-token contexts, MLI improves de


Core Idea: Turning Cross-Layer Reuse into Parallel Execution

In DeepSeek Sparse Attention (DSA), used by DeepSeek-V3.2 and the GLM-5 family, every attention layer is preceded by a lightning indexer. The indexer scans the full KV Cache, scores candidate tokens, and retains the top k=2048 positions for sparse attention. At long-context decoding, this indexer scan—not the sparse attention operation itself—becomes the dominant cost.

MLI exploits the high overlap between token selections in adjacent layers. Instead of computing a fresh index for every layer, a layer can reuse the selection produced by the preceding layer. The original serial dependency is therefore transformed into two interleaved dependency chains:

Layer L-1 indexer scan → Layer L-1 sparse attention

Layer L indexer scan → Layer L sparse attention

This allows each indexer to run concurrently with its corresponding attention layer, removing the need to wait for every preceding index scan to finish.

No model retraining or new weights are required. The default implementation runs inside SGLang's production decode graph without changing the attention kernel, while an optional fused decode kernel provides further acceleration for DeepSeek-V3.2.

Composition with IndexCache and IndexShare

MLI and IndexCache address different parts of the same bottleneck. IndexCache reduces the number of layers that retain an indexer; MLI makes the remaining indexers overlap with attention execution. GLM-5.2 ships the cross-layer reuse mechanism as IndexShare.

In the experiments, retention denotes the fraction of layers that keep an indexer. At equal retention, combining MLI with IndexCache improves decode throughput by as much as 14.5% on DeepSeek-V3.2 and 9.8% on GLM-5 at retention 1/2. At retention 1/4, the gains reach 7.9% and 5.1%, respectively. The improvements are largest when more indexers remain and increase with context length.

The systems can also trade indexer freshness for execution parallelism. At retention 1/r, MLI remains faster than IndexCache at 1/(2r) while preserving twice as many freshly computed selections.

Throughput, Accuracy, and System Cost

At 128K context and retention 1/4, DeepSeek-V3.2 reaches 1.32x the decode throughput of the unmodified model. For comparison, IndexCache reaches 1.28x at retention 1/8. MLI thus improves throughput without necessarily sacrificing the number of real-time index selections.

Accuracy on LongBench, RULER, and LongBench v2 stays within a few percentage points of IndexCache. The paper does not provide the complete per-task scores, so it remains difficult to assess quality losses on workloads where adjacent layers assign substantially different relevance weights.

The default implementation requires no new attention kernel and integrates with SGLang's production decode graph. A fused decode kernel is also available for DeepSeek-V3.2. The main added system complexity comes from cross-layer index reuse, scheduling synchronization, and state management rather than additional model memory.

Engineering Trade-offs

MLI depends on a structural assumption: adjacent layers should select largely the same tokens. If their selections diverge substantially, reusing an older index may omit tokens that the current layer considers relevant. The reported benchmark results suggest that the aggregate loss is limited, but production workloads such as repository analysis, multi-turn tool use, and long-document retrieval should be tested independently.

The upside also has a ceiling. Sparse attention itself, KV Cache bandwidth access, batch scheduling, and communication remain after index scans are hidden. As contexts grow further, or when the attention kernel cannot overlap effectively, MLI's marginal benefit will decline.

The scheduler-level implementation is easier to maintain, while the fused kernel may reduce launch overhead and intermediate memory traffic. Its actual gain depends on the GPU, batch size, sequence length, and kernel version. Production evaluation should therefore report P50 and P95 latency, per-token cost, and throughput under realistic traffic distributions rather than relying on a single peak number.

Deployment Recommendations

  1. Measure index overlap first: Record the Top-k intersection between adjacent layers on the target model and workload. Cross-layer reuse is risky if overlap is insufficient.
  2. Benchmark multiple retention ratios: Test at least 1/2, 1/4, and 1/8, comparing MLI, IndexCache, their composition, and the original DSA system.
  3. Track quality and latency together: Add domain-specific code retrieval, financial QA, and agent-trajectory tests to the standard long-context benchmarks.
  4. Start with the no-kernel-change path: Enable the default SGLang implementation before evaluating whether a fused kernel is justified by production bottlenecks.
  5. Examine batching interference: CUDA stream scheduling, SM occupancy, and inter-request resource contention may shift the optimal configuration, making single-request results insufficient.

MLI does not increase model capacity. It reorganizes the execution schedule of an existing sparse-attention system, using the redundancy already present across DSA layers to move expensive index scans off the critical serial path. The result is a training-free optimization path for faster long-context decoding with relatively limited implementation changes.


Source: Hugging Face Daily Papers (2026-11-02)

— END —

Tags: #DeepSeek #Sparse Attention #SGLang #Long-Context Inference #Inference Optimization

Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.

Community Comments

Loading live comments and annotations…