When a single bottleneck threatens end-to-end availability, because autoregressive LLM decoding is HBM-bandwidth-bound rather than compute-bound, verifying K=5 draft tokens in a single batched target pass costs nearly the same latency as generating 1 target token.
TL;DR30-second simplified summary▾
Core Mechanics: Serving Llama-3-70B (BF16, ~140 GB weights across 8x H100 80GB NVLink GPUs, TP=8, 3.35 TB/s HBM3 bandwidth) achieves < 2% Tensor Core utilization at small batch sizes (1–8).
Visual & Structural Flow: Depicts 1B-3B Draft Proposes K=5 Tokens; 70B Verifies All in 1 Pass (Draft (1B/Eagle) -> Target 70B (TP=8) -> Paged KV Cache); Speculative Step & KV-Cache Rollback States (DRAFT K=5 -> VERIFY 70B -> ROLLBACK KV).
Trade-Offs & Production: Two common mistakes break speculative decoding: Using argmax(p) == argmax(q) when temperature > 0: Breaks mathematical equivalence to target sampling, distorting diversity and quality. Achieve >= 2.4x speedup (>= 60 tok/s) with exact target-model distribution: Replicated Draft / Eagle-2 Head: Run the draft model unsharded (TP=1 replicated, or.
Failure Modes & Application: Speculative decoding is built into production inference engines (vLLM, TensorRT-LLM, SGLang): Interactive Coding Copilots: High token-acceptance rates on boilerplate syntax push 70B models past 70–90 tok/s.
Why 70B LLM decoding is HBM-bandwidth-bound at 24 tokens/sec.
Why this matters: The mechanism: understand how Why 70B LLM decoding is HBM-bandwidth-bound at 24 tokens/sec works from first principles.
Think of Why 70B LLM decoding is HBM-bandwidth-bound at 24 tokens/sec as the intuition layer for Speculative Decoding for Faster LLM Inference: The mechanism: understand how Why 70B LLM decoding is HBM-bandwidth-bound at 24 tokens/sec works from first principles.
Serving Llama-3-70B (BF16, ~140 GB weights across 8x H100 80GB NVLink GPUs, TP=8, 3.35 TB/s HBM3 bandwidth) achieves < 2% Tensor Core utilization at small batch sizes (1–8). Every single generated token must stream all 140 GB of weights from HBM (~42 ms/token), capping single-request throughput at ~24 tokens/sec.
Wasted Tensor Core FLOPS and high interactive TTFT/TPOT latency.
Why this matters: The problem: see what breaks without Wasted Tensor Core FLOPS and high interactive TTFT/TPOT latency under real concurrency or scale.
Because HBM reads dominate 98% of decode wall-clock time, processing 1 token vs.
6 tokens in parallel takes nearly identical time (~42 ms vs ~45 ms).
1B-3B Draft Proposes K=5 Tokens; 70B Verifies All in 1 Pass
Verifying K=5 draft tokens in one 70B forward pass yields ~4 accepted tokens per ~55ms step (>= 60 tok/s).
- Problem
- How to implement Speculative Decoding for Faster LLM Inference without hitting unbounded tail latency, state divergence, or operational fragility.
- Naive Solution
- Use a single unpartitioned path with unbounded retries and synchronous global coordination.
- Why It Fails
- Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
- Alternatives
- Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
- Engineering Decision
- When a single bottleneck threatens end-to-end availability, because autoregressive LLM decoding is HBM-bandwidth-bound rather than compute-bound, verifying K=5 draft tokens in a single batched target pass costs nearly the same latency as generating 1 target token.
- Trade-Offs
- Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
When Speculative Decoding for Faster LLM Inference experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?
Why greedy argmax checks and TP=8 draft models break.
Why this matters: The problem: see what breaks without Why greedy argmax checks and TP=8 draft models break under real concurrency or scale.
Two common mistakes break speculative decoding:
- Using
argmax(p) == argmax(q)whentemperature > 0: Breaks mathematical equivalence to target sampling, distorting diversity and quality. - Sharding the tiny 1B draft model across
TP=8: Adds8xNVLinkAllReducesync overhead (~0.3 ms/layer) per draft token, blowing past the< 15 msdraft budget.
Why greedy argmax checks and TP=8 draft models break
- Head-of-line blocking on long prompts
- O(N^2) KV fragmentation
- Unfiltered RAG leaks ACLs
- Zero-waste paged KV blocks
- Pre-retrieval ACL & RRF rerank
- Continuous batching boosts tok/s
Enterprise solution: Lossless Rejection Sampling + Eagle/Replicated Draft.
Why this matters: Operational control: configure bounds, failure handling, and safe production defaults.
Achieve >= 2.4x speedup (>= 60 tok/s) with exact target-model distribution:
- Replicated Draft / Eagle-2 Head: Run the draft model unsharded (
TP=1replicated, or Eagle-2 speculative head) in< 10 msforK=5tokens, fitting comfortably inside the62.5 GB/GPUremaining HBM. - Single Parallel Target Verification (
~45 ms): Run one70Bforward pass overK+1tokens to obtainp_1..p_{K+1}. - Lossless Modified Rejection Sampling: Accept token if . On first rejection at , discard draft tokens , roll back their KV-cache blocks (
PagedAttention), and sample 1 corrected token from —guaranteeing2–6tokens per step with zero quality loss.
Speculative Step & KV-Cache Rollback States
Modified rejection sampling guarantees the exact output distribution of Llama-3-70B while amortizing HBM weight reads.
Where speculative decoding accelerates AI serving.
Why this matters: Scope boundary: identify where this pattern fits best and where simpler or async alternatives win.
Speculative decoding is built into production inference engines (vLLM, TensorRT-LLM, SGLang):
- Interactive Coding Copilots: High token-acceptance rates on boilerplate syntax push
70Bmodels past70–90 tok/s. - Prompt-Lookup / N-gram Speculation: Uses input context spans as zero-cost drafts for RAG & summarization.
- Quantized Draft + BF16 Target: Pairs an FP8/INT4 draft head with a lossless BF16 verifier.
Practice: Make the trade-off yourself.
Why does verifying K=5 draft tokens in a single 70B target forward pass take nearly the same time (~45 ms) as generating 1 token (~42 ms)?