Speculative Decoding Tutorial: 12 Steps, 75 Min [2026] A tutorial published on Shattered.io lays out a 12-step, roughly 75-minute harness for measuring speculative decoding speedups across four configurations — a plain baseline, n-gram lookup, a small draft model and EAGLE3 — on the reader's own hardware. The tutorial cites Google's claim of up to a 3x inference-speed improvement from Gemma 4 multi-token-prediction drafters without quality degradation, while noting that figure is a vendor claim and that real gains depend on GPU, prompt mix and concurrency. It gives the acceptance-rate formula (1 – a^(k+1)) / (1 – a), which yields about 3.4 tokens per target pass at a = 0.8 and k = 4 versus about 1.9 at a = 0.5, and warns that speculative decoding helps memory-bound low-QPS workloads but often yields no gain for a saturated multi-tenant API. Don't miss new tech stories on Google Add Shattered once in the Google app and our stories show up in your news suggestions. Add now https://www.google.com/preferences/source?hl=en&q=https%3A%2F%2Fshattered.io%2F How Speculative Decoding Works and When It Pays Off Speculative decoding lets a cheap proposer guess several tokens ahead while the full model checks every guess in a single forward pass, so the text stays the same and the number of expensive passes drops. Google claims up to a 3x inference-speed improvement https://blog.google/innovation-and-ai/technology/developers-tools/multi-token-prediction-gemma-4/ from its Gemma 4 multi-token-prediction drafters without degradation in output quality or reasoning logic. That is a vendor claim, and your own number will land somewhere below it or occasionally above it depending on GPU, prompt mix and concurrency. The 12 steps below build a small lab that measures the real speedup on your hardware, in about 75 minutes, with four configurations: a plain baseline, n-gram lookup, a small draft model and EAGLE3. The reason it works is simple. Generating one token with an 8B-parameter model means reading all of its weights from GPU memory, and the arithmetic units sit mostly idle while that happens. Checking five candidate tokens in the same pass costs only slightly more than checking one, because the weights are read once either way. If the proposer guessed right, you bank several tokens for the price of one step. If it guessed wrong, you keep the tokens up to the first mistake and lose a little time on the rest. The open-weight field keeps moving, and the best open source LLM https://shattered.io/best-open-source-llm-october-2026-kimi-glm-deepseek/ options in late 2026 increasingly ship with draft heads or matching drafters. That makes speculative decoding a default thing to evaluate, not an exotic trick. The catch is that every serving stack names the knobs differently, the docs lag the code, and most tutorials online show numbers from a different GPU, a different prompt set and a different library version. A repeatable harness fixes that. The acceptance math you should keep in your head. Call the chance that the target model accepts any single drafted token the acceptance rate, written as a. If the draft proposes k tokens per step and each is accepted independently with probability a, the expected number of tokens produced per target pass is 1 – a^ k+1 / 1 – a . With a = 0.8 and k = 4, that works out to about 3.4 tokens per pass. With a = 0.5 and k = 4, it falls to about 1.9. The drafter is not free, so divide by the cost of the extra work. If one draft step costs 10 percent of a target pass, then k = 4 adds 0.4 of a pass, and the back-of-envelope ceiling at a = 0.8 is about 3.4 divided by 1.4, or about 2.4x. Real systems land below that because verification adds overhead and acceptance is not independent, but the shape holds: acceptance rate dominates everything. When it helps and when it hurts. Decode is memory-bound at small batch sizes, which is where speculation shines. As you pile on concurrent requests, the GPU turns compute-bound, the spare capacity that verification relied on disappears, and rejected tokens become pure waste. The vLLM speculative decoding guide reportedly frames the technique as a way to cut inter-token latency in medium-to-low-QPS, memory-bound workloads, and that matches what the sweep in Step 12 usually shows. A single-user local assistant benefits most. A saturated multi-tenant API often sees no gain at all. The lossless property. In greedy mode temperature 0 , a drafted token is accepted only if it equals the token the target would have picked, so the final text should match a non-speculative run. With sampling, vLLM and similar engines use a rejection-sampling rule that preserves the target distribution. Small numeric differences from batching can still flip a near-tie, so the harness counts identical outputs instead of assuming all of them match. Some stacks also expose opt-in lossy verification modes more on that in the advanced tips , and those break the guarantee on purpose. A worked example before you spend GPU time. The numbers here are hypothetical and exist only to show the reasoning. Suppose a chat reply averages 250 output tokens and one user sees 40 tokens per second without speculation, so a reply takes about 6.3 seconds. A 1.8x per-user gain cuts that to roughly 3.5 seconds, which people notice. Now take a nightly batch job that nobody watches. The same 1.8x gain at a single stream means little there, because the job cares about aggregate throughput at full batch, and that is exactly where speculation tends to fade. The same technique can be a clear win for one product and irrelevant for another, which is why the lab measures both views. Speculative Decoding Methods in vLLM v0.33.0 Compared vLLM’s documentation lists model-based methods EAGLE, MTP and draft models plus n-gram and suffix decoding, all configured through a single --speculative-config JSON argument. The table summarizes how they differ in what you must download and when they tend to win. The last column is analysis based on how each method works, not a measured result, so treat it as a hypothesis for the lab to confirm. | Method | Separate draft checkpoint | Training needed | Likely sweet spot | Config key | |---|---|---|---|---| | Draft model | Yes, a small model with the same tokenizer | No, if a matching small sibling exists | General chat when a same-family small model exists | draft model | | N-gram lookup | No | No | Code edits, JSON extraction, summaries that copy the prompt | ngram | | Suffix decoding | No | No | Agent loops that repeat earlier tool output | suffix | | EAGLE3 | Yes, a head trained for your exact target | Yes, unless a published head exists | Open-ended chat at low concurrency | eagle3 | | MTP | No, uses heads built into the target | Built in by the model maker | Models that ship with native prediction heads | mtp | | Medusa and MLP speculator | Yes | Yes | Legacy setups only | Removed reportedly in 0.33.0 | Draft model. A small sibling of your target proposes tokens, and the big model verifies them. The draft must share the target’s tokenizer, which in practice means the same model family. According to vLLM’s release notes, draft-model speculation reportedly landed on the newer Model Runner V2 in v0.31.0. It is the most intuitive method and the easiest to reason about, but it costs extra VRAM for the draft weights and its own KV cache. N-gram lookup. No model at all. The engine looks at the last few tokens, searches the prompt for the same sequence and proposes whatever followed it there. When the output copies from the input rewriting code, extracting fields from a paragraph, quoting a document acceptance can be very high at almost zero cost. When the output is fresh prose, it proposes nothing useful, and you pay a small lookup tax for nothing. Suffix decoding. A cousin of n-gram lookup that matches against earlier generated text and, in recent vLLM builds, reportedly against a cross-request memory on the GPU. It targets repetitive agent workloads. The lab skips it because its benefit depends on the traffic pattern, but the harness makes it a one-line addition. EAGLE3. A small trained head that reads the target’s hidden states to propose tokens. NVIDIA describes EAGLE3 as a separate draft model that proposes tokens for the larger target to verify, which means you need a published checkpoint that matches your target. The lab uses the vllm-project copy of the EAGLE3 Llama 3.1 8B Instruct checkpoint https://huggingface.co/vllm-project/EAGLE3-LLaMA3.1-Instruct-8B/blob/main/README.md . Its model card says the copy mirrors the yuhuili original at a specific commit, made on 2026-10-30, because vLLM’s CI uses it and the original lives on a personal account. That is a supply-chain decision worth copying in your own pipelines. MTP. Multi-token prediction uses extra heads that the model maker trained into the target itself, so there is no second download. In vLLM it is enabled with the method set to mtp and num speculative tokens set to 1. It only works on models that actually contain those heads. A model without them needs EAGLE or a draft model instead. Medusa and MLP speculators. Older tutorials still show these. The 0.33.0 release notes reportedly removed both, along with the legacy Ray compiled-graph executor. If a guide tells you to launch with a Medusa head, check its date before you spend an evening on it. What changed in the last quarter. Three shifts matter for anyone working from an older guide. First, vLLM v0.33.0 is the current line, built on PyTorch 2.14, and its notes reportedly add refiners for block-diffusion drafters such as DFlash and DSpark, drop Medusa and the MLP speculator and carry an opt-in lossy verification policy. Second, vendors now publish training paths for drafters and not only finished checkpoints. AMD’s ROCm team described EAGLE3 training on Instinct MI350X on October 27, 2026, and NVIDIA’s NeMo AutoModel documentation carries an EAGLE-3 recipe. Third, model makers increasingly ship the drafter alongside the model, as Google did for Gemma 4. The practical effect is that a draft path you ruled out earlier this year may exist today, so re-test instead of relying on memory. Prerequisites and Versions The lab targets a single Linux box with one NVIDIA GPU. Everything below was chosen so that each component has an official source for its current state as of November 13, 2026. | Component | Version used | Notes | |---|---|---| | GPU | NVIDIA, 24 GB of VRAM or more | Weights for an 8B model at 16-bit precision take roughly 16 GB before KV cache. GeForce RTX 5090 is NVIDIA’s current desktop flagship, and any card with enough memory works. | | NVIDIA driver | A current production driver | Install the driver on its own. PyTorch wheels bring their own CUDA runtime, so a full CUDA toolkit is optional for this lab. | | Python | 3.12 | vLLM requires 3.10 or newer and recommends 3.12 or newer. | | vLLM | 0.33.0 | The current release line. It moved to PyTorch 2.14 and dropped CUDA 12.9 support, and it is compatible with CUDA 13.x. | | PyTorch | 2.14 installed by vLLM | Do not pin it yourself. Let the vLLM wheel pick it. | | httpx | Latest | Async HTTP client for the benchmark script. | | Target model | meta-llama/Llama-3.1-8B-Instruct | Gated on Hugging Face. Accept the license first. | | Draft model | meta-llama/Llama-3.2-1B-Instruct | Same tokenizer family as the target. Also gated. | | EAGLE3 head | vllm-project/EAGLE3-LLaMA3.1-Instruct-8B | Trained for the exact Llama 3.1 8B Instruct target. | | uv | Latest | Fast environment manager, optional but used below. | Two honest caveats. First, Llama 3.1 8B Instruct is not a new model, but it is the best-documented target for a three-way comparison because a published EAGLE3 head, a same-tokenizer small sibling and vLLM’s own CI all exist for it. The harness is model-agnostic through three environment variables, so you can swap in a newer target once you have a matching drafter. Second, plan for about 30 GB of free disk for the three checkpoints and the Hugging Face cache, and a Hugging Face token with access to the gated Llama repositories. Record the stack before you run anything. Save the output of nvidia-smi , vllm --version and uv pip freeze next to the results, because a speedup without its stack attached cannot be reproduced and will mislead whoever reads it six months from now. The inference ecosystem moved quickly in the last quarter, with a new vLLM release line, new drafter checkpoints and changed defaults, so a result is only as good as the versions behind it. Steps 1 to 3: Define Metrics, Check the GPU, Build the Environment Step 1: Fix the metrics before you touch the GPU. A benchmark that changes its definition halfway through is useless. The lab records five numbers per run, and the table says what each one answers. | Metric | How the harness computes it | What it tells you | |---|---|---| | Aggregate tok/s | Total completion tokens divided by wall-clock time for the whole batch | Throughput. This is the number a busy server cares about. | | P50 decode tok/s | Per request, tokens minus 1 divided by end minus first token time , then the median | Per-user speed. This is what one person typing into a chat feels. | | P50 and P95 TTFT | Time from request start to first content chunk | Whether speculation hurt the first-token delay. It should not move much. | | Acceptance rate | Accepted draft tokens divided by proposed draft tokens, from the server’s metrics | Why a method won or lost. | | Identical outputs | Count of requests whose text equals the baseline text at temperature 0 | Whether the lossless property held in practice. | Decide now what counts as a win. A reasonable rule: a method earns its place if it improves P50 decode tok/s by a clear margin at the concurrency you actually run, without lowering aggregate throughput at your peak load, and with the identical-output count staying near the full set. Step 2: Check the GPU and driver. Confirm the card is visible, note its memory, and make sure nothing else is holding VRAM. nvidia-smi --query-gpu=name,memory.total,memory.used,driver version --format=csv The output should list your GPU name, total memory, a near-zero used figure and the driver version. If another process holds several gigabytes, stop it now. A draft model and its cache need headroom, and a half-full GPU produces confusing out-of-memory errors in Step 10. Step 3: Create the project and install vLLM 0.33.0. The environment uses uv with Python 3.12. If you prefer pip and venv, the same package names apply. mkdir -p ~/specdec-lab/{data,results,logs} && cd ~/specdec-lab curl -LsSf https://astral.sh/uv/install.sh | sh uv venv --python 3.12 .venv source .venv/bin/activate printf 'vllm==0.33.0\nhttpx\n' requirements.txt uv pip install -r requirements.txt python -c "import vllm, torch; print 'vllm', vllm. version , 'torch', torch. version " Expected output on the last line: vllm 0.33.0 torch 2.14.