AI 101 — What is speculative decoding?

Share
AI 101 — What is speculative decoding?

If you've ever wondered why an LLM feels slow to type out long answers — or why Nvidia's engineers spent a September 2026 blog post telling model designers how many attention groups to use — the answer is a technique called speculative decoding.

Speculative decoding is an inference speedup where a small, fast "draft" model guesses several upcoming tokens, and the big target model verifies them all in a single pass instead of generating one token at a time. The output is bit-identical to what the big model would have produced on its own; it's just reached the end of the prompt faster.

That's the whole idea. Two models, one extra step, no quality loss. The math that decides whether the trick pays off comes from the GPU underneath, which is why a chipmaker is now telling model designers how to build for it.

Why it matters right now

LLM inference is bottlenecked by memory bandwidth, not raw FLOPS — the model spends most of its time loading weights from high-bandwidth memory into the compute units rather than crunching numbers. Autoregressive generation amplifies this: the GPU generates one token per forward pass, then waits. Speculative decoding amortizes that wait by batching several guesses into a single verification pass.

The technique moved from a research curiosity in late 2022 (the original paper from Yaniv Leviathan, Matan Kalman, and Yossi Matias at Google) to a production technique used by every major serving stack — vLLM, TensorRT-LLM, llama.cpp — within three years. Today, DFlash, a diffusion-style draft from Jian Chen, Yesheng Liang, and Zhijian Liu, reaches roughly 6× lossless speedup, while EAGLE-3 from researchers including Yuhui Li at Peking University and Hongyang Zhang at Waterloo is the current favourite for large models on GPUs.

Nvidia's September 2, 2026 developer guide turned the speedup into an architecture rule: the optimal draft length is bounded by the GPU's attention tile size of 128, so a model with 8 attention groups should target 15 draft tokens, while one with 32 should target three. Get the math wrong and you pay for a half-filled tile. Inference optimization is no longer bolted on after the fact — it's a design constraint baked in before training starts.

The mental model

Think of a slow, careful editor reading a manuscript aloud. Normally, she reads one word at a time, pronounces it, breathes, reads the next. Speculative decoding hires a fast intern to read ahead — "the cat sat on the mat, then on the —" — and the editor only has to listen and say "yes, agreed" for each word the intern got right. When the intern guesses wrong ("rug" instead of "sofa"), the editor corrects and the intern starts again from there. The editor's final manuscript is identical to what she'd have produced alone, but she finished in roughly a third of the time because most of the easy words were pre-vetted.

The intern is the draft model — a smaller, cheaper transformer that runs fast. The editor is the big target model. The "yes, agreed" check is one parallel verification pass that scores every drafted token at once. The system only emits tokens the big model would have emitted itself, which is why the output is lossless rather than approximately faithful.

A concrete analogy

A barista at a busy café takes orders one at a time, makes each drink, hands it over, takes the next order. The bottleneck isn't the espresso machine — it's the human loop. A second barista, faster but less experienced, calls the next few likely orders into a queue while the first barista works. When the order is right, the first barista just confirms and pours. When it's wrong, the second barista stops guessing and the queue is rebuilt from that point.

Most guesses are right (especially in routine orders), so the first barista's per-drink time drops sharply. If every guess were wrong, the system would just add overhead — which is why speculative decoding only pays off when draft and target models share enough vocabulary, style, and distribution that the draft is usually close.

Common misconceptions

"It changes the output." It does not. The verification step rejects any draft token the target model wouldn't have produced, so the final sequence is identical bit-for-bit. This is unlike quantization or distillation, which change the model's weights and can shift answers subtly.

"It needs an external second model." Not always. Self-speculative decoding uses parts of the same model — skipping intermediate layers, or reusing a mixture of experts routing decisions — to draft and verify within one network.

"It's a training trick." It's purely an inference technique. The big model isn't retrained. Training a separate draft model is the expensive option — Nvidia's guide puts it at one to ten trillion tokens of additional compute — but training-free variants (EAGLE-3, Medusa, the Lookahead family) avoid that cost.

"It always speeds things up." Only when acceptance rate is high. If the draft model guesses wrong constantly, the verification pass wastes time. The geometry of the GPU — tile sizes, KV-cache layout — sets a hard ceiling on how long each draft chunk can be, which is why hardware now drives model design rather than the other way around.

"It's only for text." The same trick works wherever an autoregressive decoder exists — image generation with diffusion-style drafts, speech recognition (Whisper variants reach roughly 2× speedup), and increasingly tool-using agents that generate many short steps.

Where to learn more

The original 2022 paper, "Fast Inference from Transformers via Speculative Decoding," is the cleanest formal treatment — short, well-cited, and freely available on arXiv. For the engineering view, Nvidia's September 2026 developer blog walks through six leading variants with training costs and use cases. The vLLM documentation explains how speculative decoding is wired into production serving stacks. For context on the units and architecture the trick rides on, see our AI 101 — What is a token in AI? explainer.

Do you think labs should publish the speedup number for speculative decoding the way they publish benchmark scores, or treat it as plumbing? Write to us via our contact page.

Get SiliconNoon in your inbox

One email a day with the AI stories that matter — what happened, the numbers, and why it matters. No spam, unsubscribe in one click.

Read more

AI 101 — What is an NPU (neural processing unit)?

AI 101 — What is an NPU (neural processing unit)?

An NPU is a chip built for one job: running the math that neural networks do, at a fraction of the power a general-purpose CPU or a graphics GPU would burn. The name covers anything from the block inside your phone's processor to a USB stick in a robot to a rack card in a datacenter. Vendors also call it an AI accelerator or a neural engine, and it is the hardware reason "on-device AI" stopped being a marketing phrase. Why this matters right now The NPU is the quiet spec war of 2026.

AI 101 — What is CUDA?

AI 101 — What is CUDA?

CUDA is the software layer that lets ordinary programs run on NVIDIA's graphics chips — and it is the foundation nearly all modern AI is built on. Short for Compute Unified Device Architecture, it first shipped on February 16, 2007, and it turned graphics cards — machines designed to draw video games — into general-purpose computers that any developer could program. Before CUDA, using a graphics chip for serious math meant writing code in the chip's own graphics language, in fragments, with…

AI 101 — What is an AI data center?

AI 101 — What is an AI data center?

An AI data center is a building full of specialized computers — mostly GPUs — designed from the power feed to the cooling pipes to train and run AI models at massive scale. From the outside it looks like any windowless warehouse. Inside, the difference is density: racks of chips packed so tight, and drawing so much power, that ordinary air conditioning and ordinary grid connections no longer do the job. Why it matters right now. These buildings have become the physical front line of AI.

AI 101 — What is a GPU, and why does AI need one?

AI 101 — What is a GPU, and why does AI need one?

A GPU is a computer chip built to do thousands of small arithmetic operations at the same time — which turns out to be the exact shape of the math inside a modern AI model. The name stands for graphics processing unit, because the chip was designed to draw video games frames. AI is the job it turned out to be extraordinary at. If you follow AI news, the GPU is the noun that never leaves the sentence: who is buying them, who cannot get enough of them, why one chip costs more than a car, why…

AI 101 — What is an embedding?

AI 101 — What is an embedding?

An embedding is a list of numbers that represents the meaning of something — a word, a sentence, a photo, a song — so a computer can compare meanings using arithmetic. The rule is simple and surprisingly powerful: things that mean similar things get similar lists of numbers. That's the whole idea, and it's the foundation of semantic search, recommendation feeds, and most of what people call "AI memory." Why it matters right now Embeddings are the invisible layer under nearly every AI feature…