Why multi-GPU serving is mandatory: GLM-5.3's checkpoint is ~704 GB on disk — the weights alone exceed one 288 GB (287 GB measured) B300
DSA sparse attention: beyond 2048 tokens, per-token attention-core cost stops growing with context length; only a cheap indexer still scans the full context
FP8 KV + NVFP4 weights is the standard B300 serving setup, shifting memory pressure from KV capacity to MoE weight bandwidth
MoE Decode Intensity: Why Batches Collapse
With batch $B$, $E = 256$ experts, and top-$k = 8$ active per token, each expert averages only:
$$\text{tokens / expert} = \frac{B \cdot k}{E} = \frac{8 B}{256} = \frac{B}{32}$$
At $B = 256$, each expert GEMM sees only 8 tokens — far below the compute-bound ridge point
Systems consequence: we must pool decode batches across many GPUs via wide expert parallelism
Three Levers to Accelerate Inference
1. Lossy Shortcuts Shrink bytes & FLOPs per token without hurting quality
MiniMax-M3 (June 2026): blockwise top-$k$ sparse attention on GQA matches GQA quality on a 109B model while cutting per-token attention compute 28.4× at 1M context
Qwen3.8-Flash-Next (Aug 2026): converts full-attention layers to Qwen Sparse Attention (QSA) during continued pretraining
2026 Hybrid Recurrent–Attention Architectures
Linear attention and state-space layers (Mamba 2, Gated DeltaNet) keep a fixed-size recurrent state independent of sequence length $S$, interleaved with sparse/compressed attention for exact recall.
2026 Frontier Model
Layer Ratio & Mechanism
MoE & Serving Notes
Kimi K3 / K3.1 July 2026
3 Kimi Delta Attention : 1 gated MLA (1M context)
2.8T total / 104B active; 896 experts (16 active + 2 shared); MXFP4 QAT on experts
Qwen3.8-Flash-Next Aug 2026
3 Gated DeltaNet : 1 QSA sparse attention
125B total / 6B active; 512 experts (10+1); 51B n-gram embedding table in host RAM
Nemotron 3.5 Oct 2026
Hybrid Mamba–Transformer MoE
Fixed-size Mamba state slashes KV footprint alongside sparse Transformer layers
Replacing 75% of attention layers with recurrent layers removes most of the KV cache — but breaks the assumption that every layer stores uniform KV bytes per token
On Blackwell B300, native block-scaled paths make NVFP4 weights + FP8 KV cache the normal serving configuration, not an exotic optimization.
Quantization Methods: QAT, PTQ, GPTQ & AWQ
Quantization-Aware Training (QAT)
Simulate quantize/dequantize in the forward pass so weights adapt (e.g., Kimi K3 trains MoE experts with MXFP4 QAT)
Higher accuracy, but requires large-scale training
Post-Training Quantization (PTQ): cheap calibration after training
GPTQ: uses Hessian info to update remaining weights to compensate quantization error
AWQ: identifies the 0.1–1% salient weights hitting large activation channels (FP16 → INT3: 4× less memory, 3.2× speedup)
FP4 KV Cache: Memory Win vs. Long-Context Risk
Why compress KV below FP8?
NVFP4 KV cache halves memory footprint and HBM traffic relative to FP8 KV (used in DeepSeek-V4.1-Flash's 890 B/tok global KV)
Production kernels keep KV stored as FP4 in HBM and dequantize to FP8 inside the attention kernel
Long-context retrieval accuracy is actively disputed:
NVIDIA (vendor-reported): <1% accuracy loss on its benchmark suite
BitDecoding-FP4 (paper-reported): up to 8.5 points lost on RULER and MRCR when scales are uncalibrated
Engineering rule: never validate KV quantization on short-context benchmarks alone — always test needle-in-a-haystack and long-context retrieval (e.g., RULER/MRCR).
Model Pruning & Knowledge Distillation
Structured pruning + distillation (NVIDIA recipe): remove entire layers, attention heads, or hidden channels so the smaller model runs densely on GPU tensor cores
"Initialize & repair" beats training a small model from scratch in compute budget while preserving teacher quality
All methods so far are lossy — next, how do we speed up decode with zero change to the output distribution?
Speculative Sampling: Checking Beats Generating
Why it pays off: decode is memory-bound, so verifying $k$ tokens in one forward pass costs nearly the same as generating 1
Key guarantee: modified rejection sampling produces an exact sample from the target model $q$
Modified Rejection Sampling: Exactness Proof
Draft model $p$ proposes $k$ tokens $\tilde{x}_1,\dots,\tilde{x}_k$; target $q$ scores all $k+1$ positions in parallel
For each position $i$: accept $\tilde{x}_i$ with probability $\min\!\bigl(1,\; q(\tilde{x}_i)/p(\tilde{x}_i)\bigr)$
On the first rejection, resample from the residual distribution $\text{norm}\!\bigl(\max(q - p,\, 0)\bigr)$ and stop; if all $k$ accept, sample a bonus token from $q_{k+1}$
Proof on vocabulary $\{A, B\}$ — suppose draft oversamples $A$: $p(A) > q(A)$, so $p(B) < q(B)$.
Residual $\max(q - p, 0)$ places probability $0$ on $A$ and $1$ on $B$:
$$P(\text{sample } A) = p(A)\cdot\frac{q(A)}{p(A)} + p(B)\cdot 1 \cdot 0 = \mathbf{q(A)}$$
$$P(\text{sample } B) = p(B)\cdot 1 + p(A)\cdot\!\left(1 - \frac{q(A)}{p(A)}\right)\cdot 1 = p(B) + p(A) - q(A) = \mathbf{q(B)}$$
Unlike standard rejection sampling (which loops), the residual step guarantees at least 1 exact target token per verification pass.
Speculative Decoding as Deployed: EAGLE, MTP & Trees
Evolution: standalone small draft model (e.g., 70B/8B or 8B/1B) → Medusa (parallel heads) → EAGLE (conditions on target hidden states) → native MTP layers shipped with the checkpoint
Draft trees pack multiple candidate continuations into one custom attention mask, raising expected accepted tokens per target forward pass
Late-2026 Drafters & Speculative Scheduling
Block-parallel drafting (DFlash): drafts an entire block in one forward pass by injecting target hidden states into every draft layer
LMSYS (self-reported): >4.3× baseline throughput and 1.5× over 7-step MTP on Qwen3.5-397B at concurrency 1 (in SGLang)
Adaptive draft length (DSpark): estimates each draft token's survival probability to choose how many tokens to verify per request
DeepSeek (self-reported): 60–85% higher per-user speed than MTP-1 in DeepSeek-V4 serving (in SGLang)
Overlapped speculative scheduling (SGLang Spec V2): overlaps speculative bookkeeping and KV allocation for batch $t$ with GPU execution on batch $t+1$
Self-reported: +33% on Qwen3-8B on one B200 at concurrency 32
Benchmark hygiene: compare speculative speedups at matched temperature, dataset, and concurrency — gains shrink as batch size grows and decode approaches the compute roof.
Serving Live Traffic: Why Dynamic Workloads Are Hard
Training feeds clean rectangular tensors [B, S, D]. Live inference traffic is asynchronous, ragged, and full of repeated prefixes.
Asynchronous arrivals & finishes: requests arrive unpredictably and stop at different lengths — waiting to form a static batch stalls early requests
Variable sequence lengths: padding short sequences to match the longest sequence wastes both FLOPs and HBM bandwidth
Shared prefixes: system prompts, multi-turn chat histories, agent trajectories, and parallel sampling share long common prefixes
Next: how 2026 serving systems (using SGLang as our running example) solve each of these bottlenecks.
Continuous Batching & Selective Batching (Orca)
Iteration-level scheduling: insert arriving requests and evict finished ones at every decode step — zero waiting for a batch barrier
Selective batching: packs variable-length token streams densely for matrix multiplies while keeping attention per sequence
Chunked Prefill & Mixed Batching
Bounded decode latency: splitting long prompts into fixed-size chunks prevents a single prefill from stalling ongoing decodes
Roofline synergy: piggybacking compute-heavy prefill tokens onto memory-bound decode steps fills idle tensor cores on the same weight fetch
Standard in SGLang and vLLM; builds directly on continuous and selective batching.
PagedAttention: Virtual Memory for the KV Cache
Problem solved: pre-allocating max-length contiguous KV buffers causes severe internal fragmentation (unused reserved tokens) and external fragmentation (gaps between requests)
OS paging idea (vLLM): allocate fixed-size non-contiguous blocks on demand via a block table; share prefixes (system prompts, parallel sampling) with copy-on-write
RadixAttention (SGLang): retains finished requests' KV blocks in a radix tree indexed by token sequences
Any new request sharing a prefix (system prompt, multi-turn history, agent loop) hits the tree and skips prefill for those tokens
Hierarchical caching spills cold KV blocks from GPU HBM to host memory rather than discarding them, extending effective cache capacity for long-running agents
Hybrid KV Cache Managers for 2026 Models
Hybrid models break the classic assumption that every layer stores the same bytes per token
vLLM hybrid KV cache manager & SGLang Unified Radix Cache (Full + Mamba components) group layers by type into one shared pool and enforce a per-type prefix-hit rule
Because recurrent states overwrite in place, prefix reuse requires matching at explicitly saved checkpoints
Prefill / Decode Disaggregation
Follows directly from the roofline split: prefill is compute-bound while decode is memory-bound
Tradeoff: lower, steadier TPOT and independent pool scaling, at the cost of transferring the KV cache over RDMA (made practical by compact MLA/FP8 KV caches)
Wide Expert Parallelism for MoE Decode
Fixes MoE batch collapse: pooling tokens across $M$ GPUs raises tokens/expert by $M\times$, lifting expert GEMMs toward the compute roof
Data-parallel attention: avoids splitting KV-light MLA attention with tensor parallelism; each rank keeps distinct request KV caches
All-to-all & load balance: DeepEP dispatches/combines tokens across GPUs; EPLB replicates hot experts so stragglers do not stall the barrier
Attention–FFN Disaggregation (AFD)
Decouples memory-heavy KV storage (attention ranks) from weight-heavy expert GEMMs (FFN ranks) using ping-pong microbatches to overlap per-layer transfers
Measured reality on homogeneous GPUs: gains are modest — 0–17% (FastAFD self-reported up to 1.17× over the best vLLM wide-EP setup on GB200 NVL72)
Fragility: a mismatched attention-to-FFN GPU ratio leaves one side idle and loses throughput relative to co-located wide EP
Hiding CPU Overhead: Overlap Scheduling & CUDA Graphs
Overlap scheduling: CPU prepares metadata and KV tables for batch $t+1$ asynchronously while the GPU executes batch $t$
CUDA graphs: capture an entire decode step into one replayable graph so per-op kernel launch latency never dominates small batches
Fused kernels: FlashAttention, FlashDecoding, and fused paged-block reads eliminate intermediate HBM round-trips and extra launches
Sync-Free Model Runners & Persistent Megakernels
Sync-free model runners: remove per-step CPU–GPU synchronization barriers
Instead of copying token IDs and metadata back to the CPU each decode step, build next-step inputs directly on the GPU
vLLM Model Runner V2 (self-reported): +56% output throughput on Qwen3-0.6B on one GB200 by eliminating per-step host syncs
Persistent megakernels: fuse an entire decode step (or multi-layer loop) into one long-lived GPU kernel
Eliminates inter-kernel launch gaps and barrier overhead
Shipped as opt-in low-latency paths in SGLang (low-latency mode) and vLLM (specialized decode)
Where they help: gains are largest at batch 1 (single-user latency); standard kernels win at high batch
As Blackwell GPUs execute small decode steps in microseconds, host-side Python/CUDA overhead becomes a first-order bottleneck.
Constrained Decoding & Batch-Invariant Serving
Constrained decoding (structured outputs)
Masks invalid tokens from the vocabulary at every decode step so outputs strictly obey a JSON schema or context-free grammar
XGrammar is the default backend across vLLM, SGLang, and TensorRT-LLM: splits vocabulary into precomputed context-independent tokens plus a fast runtime pushdown stack
Systems constraint: mask computation must complete inside the overlapped CPU scheduler window so it adds zero GPU stalls
Batch-invariant & deterministic serving
Floating-point reduction order normally changes with batch size, causing non-deterministic outputs across load levels
DeepSeek DeepInfer ships batch-invariant inference and deterministic sampling for reproducible RL and auditing
Throughput cost: SGLang reported ~34% overhead with CUDA graphs (self-reported); research systems report single-digit overhead
Cache-Aware Routing & Agentic Workloads
Cache-aware routing: routers track live KV-cache residency and score instances by cached prefix plus load
llm-d benchmark (self-reported): P90 TTFT drops to 0.54 s with precise KV-event routing vs. ~93–95 s with load-only or random routing
Real agentic traffic (SemiAnalysis AgentX, Claude Code replay on DeepSeek-V4-Pro):