Standard autoregressive large language model (LLM) generation produces one token per forward pass. Because modern inference architectures must read tens of gigabytes of model weights from high-bandwidth memory (HBM) into SRAM to process each solitary token at low batch sizes, generation is strictly memory-bandwidth bound rather than compute bound.
Speculative decoding alters this hardware equation. By pairing a fast draft mechanism with parallel verification by the primary target model, inference engines can generate multiple accepted tokens per target forward pass without altering the underlying mathematical output distribution. However, deploying speculative decoding in production environments introduces structural trade-offs across latency, memory allocation, and aggregate system throughput.

The Hardware Bottleneck: Arithmetic Intensity in Autoregressive Generation
During the autoregressive decode phase, the arithmetic intensity (defined as floating-point operations per byte of memory transferred) is remarkably low. For a 70-billion parameter model operating in FP16/BF16, generating a single token requires moving approximately 140 GB of model weights across the memory bus. On an NVIDIA H100 GPU with 3.35 TB/s of HBM3 memory bandwidth, reading these weights takes roughly 41.8 milliseconds, even though the tensor cores are capable of nearly 1,000 TFLOPS of compute.
When batch sizes are small (batch size = 1 to 4), the GPU compute cores spend most of their execution cycles waiting on memory transfers. Speculative decoding exploits this idle compute capacity: verifying a sequence of candidate tokens concurrently inside a single forward pass takes virtually the same wall-clock time as processing one token, because the model weights only need to be loaded from memory once for the entire candidate batch.
Lossless Verification: Rejection Sampling and Distribution Matching
A foundational requirement for speculative decoding in enterprise pipelines is distribution invariance: the generated output distribution of the combined system must match the target model distribution identically.
Formulated independently by Leviathan et al. (2022) and Chen et al. (2023), exact speculative sampling achieves this through a modified rejection sampling procedure:
- A draft mechanism generates a sequence of candidate tokens with probability distribution .
- The target model evaluates the entire candidate sequence in parallel in a single forward pass, obtaining the true probability distribution .
- For each candidate token from to , the token is accepted with probability:
- If candidate token is rejected, the sampling loop terminates for that speculative step. A replacement token is immediately sampled from the residual distribution:
- If all candidate tokens are accepted, the target model samples one additional bonus token from at zero incremental memory-load cost.
Under greedy decoding (temperature = 0), verification simplifies to exact string matching (). Under stochastic sampling (temperature > 0), the residual sampling formula guarantees mathematical equivalence to sampling directly from .
Drafting Paradigms: Architectures and Heuristics
Modern production engines support three primary drafting topologies, each with distinct trade-offs in memory footprint, latency overhead, and acceptance rates.
1. Independent Small Draft Models
The classical approach pairs a small model with a large target model from the same family (for example, Llama-3.2-1B drafting for Llama-3.3-70B).
- Advantages: Works out of the box with off-the-shelf checkpoints sharing the same tokenizer and vocabulary. No specialized custom architecture modifications required.
- Disadvantages: The draft model must execute sequential autoregressive steps, incurring its own memory-bandwidth overhead. If the draft model is too large, the time spent drafting outweighs the verification speedup. If the parameter mismatch is too large, acceptance rates drop sharply.
2. Multi-Head and Feature-Level Speculation (Medusa and EAGLE)
To eliminate the latency of running an entire secondary transformer, multi-head architectures append lightweight predictive layers directly to the target model.
- Medusa (Cai et al., 2024): Augments the target model's final transformer layer with multiple linear heads. Each head predicts the token at offset in parallel. Because standard hidden states discard inter-token dependencies, Medusa relies on tree-structured decoding to evaluate multiple candidate combinations concurrently.
- EAGLE (Li et al., 2024) and EAGLE-2 (Li et al., 2024): Improves on Medusa by operating in the feature space rather than token space. EAGLE passes the second-to-top hidden state and the embedding of the previous token through a single-layer transformer decoder head. By utilizing high-dimensional contextual embeddings, EAGLE significantly reduces feature uncertainty, boosting average acceptance lengths beyond standalone draft models while requiring minimal extra memory.
3. Prompt Lookup Decoding and N-Gram Matching
Prompt Lookup Decoding (PLD) and heuristic n-gram matchers eliminate draft neural networks entirely.
- Mechanism: The engine searches the prompt and recent generation history for recurring n-gram patterns matching the current context window suffix. If a match is found, the subsequent tokens are proposed as candidates.
- Performance: In document summarization, code refactoring, RAG multi-hop retrieval, and structured JSON generation, where variable names and boilerplate repetitive structures dominate, PLD yields acceptance rates comparable to neural draft models at zero parameter memory cost and microsecond draft latency.
Tree-Based Speculation and Custom Verification Masks
Linear draft sequences (evaluating a single chain of tokens) suffer from high rejection rates if early tokens have high entropy. Modern implementations utilize tree-based speculative decoding.
Rather than predicting a single path, the draft system constructs a directed tree of plausible candidate paths (for example, exploring 3 candidates for position 1, and 2 sub-branches for each path at position 2).
To verify a non-linear tree in a single target forward pass, engines construct a custom non-causal 2D attention mask. Each candidate token in the flattened sequence attends only to its direct ancestors in the draft tree and prior prompt context. After verification, the engine selects the longest valid accepted branch and discards the rejected paths from the KV cache.
The Production Serving Dilemma: Latency vs. Throughput
The most critical operational decision when deploying speculative decoding is recognizing when it accelerates serving and when it degrades performance.
Low Concurrency (Inter-Token Latency Optimization)
When serving interactive single-user requests (coding assistants, conversational agents, real-time voice pipelines), the GPU operates far below its compute capacity. Speculative decoding reduces time-per-output-token (TPOT) by 1.8x to 3.2x depending on domain entropy and model pairing.
High Concurrency (Throughput Saturation)
In high-throughput batch processing environments where the GPU serves 32 to 128 concurrent streams, the hardware transitions from memory-bandwidth bound to compute-bound.
In this regime, speculative decoding introduces several throughput penalties:
- Compute Contention: The target model forward pass must evaluate tokens per sequence instead of 1 token. When tensor cores are already fully utilized, verifying speculative tokens steals FLOPs from other requests in the batch.
- KV Cache Fragmentation: Tree verification requires allocating temporary KV cache blocks for unaccepted draft candidates. Under vLLM and SGLang PagedAttention managers, this increases peak memory pressure per sequence, reducing the maximum number of concurrent requests the engine can schedule before triggering KV cache eviction or request preemption.
- Draft Model Overhead: Running an independent draft model consumes memory bandwidth and GPU compute that could otherwise serve primary decoding requests.
As concurrency scales up, the net system throughput (measured in total tokens generated per second across all users) can decrease by 15% to 35% when speculative decoding is active compared to standard continuous batching.
Production Implementation Guidelines
Engineers deploying speculative decoding in inference engines such as vLLM, SGLang, and TensorRT-LLM should follow these practical guidelines:
- Audit Target Workloads: Enable speculative decoding on latency-critical endpoints (interactive agents, IDE completions) where batch sizes remain under 8. Disable speculative decoding on background batch processing queues (offline document ingestion, bulk classification).
- Match Draft and Target Tokenizers: Standalone draft models must share the exact vocabulary and tokenization merges as the target model. Tokenizer discrepancies cause immediate verification failure.
- Select Heuristic Speculation for Repetitive Domains: For code transformation and JSON extraction tasks, start with Prompt Lookup Decoding before deploying neural draft models. PLD introduces zero weight footprint and avoids tensor parallel synchronization overhead.
- Deploy EAGLE Heads for Dense Chat: For generalized interactive chat, EAGLE-style feature decoders provide the highest acceptance rate per parameter overhead without requiring a full secondary model checkpoint.
- Monitor Real-Time Acceptance Rates: Instrument engine metrics tracking average accepted tokens per step. If the empirical acceptance length drops below 1.3 tokens per verification step, the draft overhead exceeds the verification gain, and speculative decoding should be dynamically disabled.
Sources
- Fast Inference from Transformers via Speculative Decoding (Leviathan et al., 2022)
- Accelerating Large Language Model Decoding with Speculative Sampling (Chen et al., 2023)
- Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads (Cai et al., 2024)
- EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty (Li et al., 2024)
- EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees (Li et al., 2024)
- vLLM Speculative Decoding Documentation
- SGLang Speculative Decoding Architecture


