Cut KV-cache accesses and speed up LLM decoding 2×–16× with post-training 'Double Sparsity'.

August 11, 20247 min

Overview

Decision SnapshotReady For Pilot

The method is implemented, evaluated on standard models and GPUs, and code is public; integration needs Triton kernels and careful buffering for overlap.

Citations1

Evidence Strength0.90

Confidence0.85

Risk Signals9

Trust Signals

Findings with numeric evidence: 4/4

Findings with evidence refs: 4/4

Results with explicit delta: 5/5

Reproducibility

Status: Code + data available

Open source: Partial

At A Glance

Cost impact: 80%

Production readiness: 70%

Novelty: 60%

Authors

Shuo Yang, Ying Sheng, Joseph E. Gonzalez, Ion Stoica, Lianmin Zheng

Links

Abstract / PDF / Code

Why It Matters For Business

If you serve large LLMs on GPUs, Double Sparsity cuts KV-cache bandwidth and GPU memory use, delivering multi× attention speedups and up to ~2× end-to-end throughput without retraining.

Who Should Care

Summary TLDR

Double Sparsity is a post-training method that combines token sparsity (use only important tokens) with channel sparsity (use a small set of feature channels) to avoid full attention computation and reduce KV-cache traffic. Using offline calibration and a small 4-bit label cache, it keeps the full KV cache but reads only important parts, achieving ~1/16 token+channel sparsity with negligible accuracy loss on tests. On GPUs it speeds up attention kernels by ~4–16× and end-to-end inference up to ~1.9×; offloading mode reduces GPU KV memory to 1/16 and gives up to ~16× throughput vs FlexGen for very long contexts. Code is public.

Problem Statement

Inference is memory-bound because KV cache accesses dominate decoding cost at long contexts. Existing post-training sparse attention either loses accuracy or fails to get wall-clock speedups due to poor token selection or non-contiguous memory access. The problem: pick important tokens cheaply at runtime so attention reads far less KV cache and runs faster without retraining.

Main Contribution

Double Sparsity: combine token sparsity and channel sparsity to select important tokens cheaply at runtime.

Offline calibration to find stable 'outlier' channels and a 4-bit label cache for contiguous reads and low bandwidth use.

Key Findings

Double Sparsity keeps accuracy nearly unchanged at a combined token+channel sparsity of 1/16.

NumbersLlama-2-7B perplexity 5.475.76 at 1/16

Practical UseRun offline calibration and use 1/16 sparsity as a practical default; expect tiny perplexity increase on evaluated benchmarks.

Evidence RefTable 2

Attention operator latency falls dramatically with Double Sparsity.

Numbersattention speedup ranges ~4×–16× depending on GPU/batch/seq

Practical UseIf your workload is bandwidth-bound (long context or large batch), expect multi× speedups in attention kernels by adopting Double Sparsity.

Evidence RefFigure 5

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
Perplexity (Llama-2-7B)5.475.76 at 1/16 sparsity5.47 (original)+0.29Wiki-2Small perplexity increase at 1/16; sharp drop beyond 1/16Table 2; Figure 9
Attention operator speedup≈4×–16×scaled_dot_product_attentionup to 16×A10G/A100 microbenchmarksPer-kernel speedups vary by GPU, batch, seq lengthFigure 5

What To Try In 7 Days

Run offline calibration on a small validation set to get outlier channels.

Implement the label cache and test 1/16 sparsity on your Llama-2-7B workload; compare perplexity and tokens/s.

If GPU memory is tight, test Double Sparsity-Offload with double buffering on a long-context workload.

Optimization Features

Token Efficiency
compute attention on ~1/16 tokens at runtime
Infra Optimization
Triton kernels for top-k attentionuses asynchronous CUDA streams and DGL gather kernel
Model Optimization
post-training sparse attentionchannel sparsity (offline-calibrated outlier channels)
System Optimization
contiguous memory layout via label cacheoverlap compute with async CPU→GPU copies (double buffer)
Training Optimization
none (post-training, no retraining required)
Inference Optimization
token sparsity (top-k token attention)label cache (4-bit) for contiguous readsKV offload with double-buffer prefetch

Reproducibility

Code AvailableYes
Data AvailableYes
Open Source StatusPartial
LicenseUnknown

Risks & Boundaries

Limitations

Performance depends on quality of offline calibration and layer embedding similarity.

Small-batch or very short-context workloads get smaller speedups due to kernel launch overheads.

When Not To Use

When you need zero-perplexity change and cannot accept any accuracy delta beyond strict baselines.

For tiny batch or very short contexts where kernel launch dominates runtime.

Failure Modes

Accuracy drops sharply when pushing sparsity beyond 1/16 (e.g., 1/32 shows large perplexity rise).

Insufficient overlap of communication and compute can negate offload gains.

Core Entities

Models

Llama-2-7BLlama-2-70BLlama-7BMistral-7BMixtral-8x7BVicuna-7B-16K

Metrics

perplexityattention operator speedupend-to-end throughput (tokens/s)GPU KV memory reduction

Datasets

Wiki-2MultifieldQAGovReportTriviaQAMMLUThe Pile (validation)

Benchmarks

wiki-2 perplexitykey-value retrievallong context benchmarksMMLU