Many LLM servers use speculative decoding. It lets a model write two or three tokens in about the time of one, and the text that comes out is the same as without it.

The short version: speculative decoding covers for missing memory bandwidth with spare compute. On machines where memory bandwidth is the bottleneck, such as the DGX Spark, it is most of the decode speed. One model on two Sparks writes about 15 tokens/s without its drafter and 17 to 38 with it.

That sounds like a trade that should not exist. Faster usually means cheaper approximations. This post explains why there is no catch: where the time goes when a model writes, what speculative decoding changes, and why the answers stay the same.

Why writing is slow

A model writes one token at a time. The input for the next token is the token just written, so the steps have to run in order.

Each step reads all of the model’s weights from memory to compute a single position. Reading the weights takes most of the step. The GPU’s arithmetic units spend most of it waiting.

Reading a prompt is different. All the prompt’s tokens are known in advance, so the model computes thousands of positions in one pass over the weights. That is why a long prompt is read in seconds while the answer comes out word by word.

The idea: guess, then check

Speculative decoding makes writing look more like reading. A small, fast drafter guesses the next few tokens. Those guesses fill in the inputs the model would otherwise have to wait for. The model then computes all those positions in one pass. Going from the front, it keeps the guesses that match its own choice. At the first mismatch it keeps its own token and drops the rest.

An analogy. A professor (the model) has to go to the library (the weights) to decide each next word. The round trip takes an hour. Solving one question takes a minute. Only the questions brought along can be solved.

  • No assistant: three words take three trips, 3 hours 3 minutes.
  • With an assistant (the drafter) who guesses “really nice . let’s walk”: the professor writes six question sheets, one for each position, and makes one trip, 1 hour 6 minutes. Three words are confirmed.

The professor still solved every word. Only the number of trips went down.

Three steps of one position against one step of six positions

Checking is not cheaper than solving

A common reading is that checking an answer is cheaper than producing it. That is not where the speed comes from. Checking a position means computing that position in full, then comparing. The effort to check equals the effort to solve.

What changes is the order. Without guesses, the work is serial: each position waits for the one before. With guesses, the positions run in parallel. On a GPU, computing six positions takes almost the same time as computing one, because the step is dominated by reading the weights once.

The total amount of computation goes up, not down. Rejected guesses were computed for nothing. Speculative decoding covers for memory bandwidth with compute: it spends arithmetic that would sit idle to cut the number of weight reads.

Why it matters most on a DGX Spark

How much there is to gain depends on how much arithmetic sits idle in a step. That depends on the ratio of compute to memory bandwidth.

A DGX Spark has 128 GB of unified memory, enough to hold models that do not fit on a single GPU card. That memory is LPDDR5X at about 273 GB/s(*1), much slower than the memory on a data-center GPU. Its Blackwell GPU, on the other hand, has arithmetic to spare. So in every decode step the Spark spends most of its time reading weights, and it has room to compute many positions per read.

That is where speculative decoding pays the most. On two Sparks, Hy4-flash writes about 15 tokens/s without its drafter. With the drafter it writes 17 to 38 tokens/s, depending on the text:

Decode speed by prompt type with the drafter, against the speed without it

From the Hy4-flash NVFP4 model card: two DGX Sparks, DFly drafter with 5 draft tokens, one user, median of 3 runs. The rate without the drafter is given as “about 15 tok/s”.

The model, the machines and the weights are the same in every bar. Only the drafter’s hit rate changes. On JSON, code and rewrites the speed is about 2.4 to 2.6 times the rate without a drafter.

Without a drafter, a bandwidth-bound machine has one way to decode faster: faster memory. With a drafter, idle compute turns into speed.

Why the answers stay the same

At temperature 0

At temperature 0 the rule is: at every position, output the model’s top choice. With a drafter the rule does not change.

The text so far is “The weather today is”. The drafter proposes five tokens.

PositionDraftModel’s top choiceResult
1reallyreally✅ keep
2nicenice✅ keep
3.!❌ use “!”
4let’sdropped
5walkdropped

One step gives “really nice !”. Without a drafter the model takes three steps and writes the same three tokens, character for character. Positions 4 and 5 are dropped because their inputs assumed “.” where the model chose “!”.

Even a total miss is not wasted: the first position always yields the model’s own token, so every step moves forward by at least one token, the same as without a drafter.

When sampling

With temperature above 0, the model gives a probability for each candidate and the server draws one. The check then uses rejection sampling. Take a drafter that proposes its single top pick. The rule is to accept that token with the probability the model gave it.

Say the model gives the next word: really 60%, so 25%, very 10%, quite 5%. The drafter proposes “really”.

  • “really” passes 60% of the time. That matches the model.
  • 40% of the time it fails. The server then draws from the model’s other candidates in their own ratio: so 25/40, very 10/40, quite 5/40.
  • “so” comes out 0.40 × 25/40 = 25% of the time. Again the model’s own number. The same holds for the rest.

For a drafter that samples instead of picking its top choice, the general rule accepts with probability min(1, p/q), where p is the model’s probability and q the drafter’s. The output has exactly the distribution of the model alone. Two groups published this independently, three months apart: Leviathan, Kalman and Matias at Google (arXiv 2022, ICML 2023) and Chen et al. at DeepMind (2023).

One catch: the shape of the batch

Floating-point addition depends on order. With four significant digits:

  • (1000 + 0.4) + 0.4 = 1000 + 0.4 = 1000
  • 1000 + (0.4 + 0.4) = 1000 + 0.8 = 1001

Most servers pick how a kernel splits its sums by the number of rows in the batch. A drafter changes the number of rows. When two candidates are almost tied, a last-digit difference can swap the top choice, and the text goes a different way. So on most servers, turning the drafter on can change temperature-0 output. The guesses are not the cause; the row count is. The same effect makes most endpoints give different answers to the same request under different load (Thinking Machines).

Engines that fix the addition order for every row (“batch invariance”) give bit-identical temperature-0 output with or without drafting. We wrote about this in The same model answers differently depending on how it is served.

Where the guesses come from

  • A separate small model. The original papers used one. It must share the main model’s tokenizer.
  • A drafter built into the model. A few extra layers read the main model’s internal state and predict the next tokens. Examples: DeepSeek-V3’s multi-token prediction (MTP), Medusa, EAGLE, DSpark in DeepSeek-V4.1 and DFly2 in Tencent’s Hy4. Because it reads the model’s internal state, it can guess what the model is about to write.
  • Copying. Look up the last few tokens earlier in the context and propose what followed them there: n-gram or prompt lookup decoding, and OpenAI’s Predicted Outputs, where the caller supplies the expected text. This works well for edits, rewrites and code, where much of the output already appears in the input.

Whichever drafter is used, it only affects speed. The model checks every token, so a poor drafter makes the server slower, not the answers worse.

Trees and multiple drafts

A drafter can also offer several branches. The model verifies all of them in one pass and follows the branch that matched longest (SpecInfer and later EAGLE versions do this). Accepting is not a search. It walks down like a lookup in a trie: take the model’s token at this position, move to the child that matches, stop when none does.

For one user this raises the tokens kept per step. With many users the rows multiply and the step stops being free.

What gets faster, and what does not

Predictable text

The chart above shows it: the more predictable the text, the more guesses survive. JSON, code and rewrites follow patterns, so the drafter guesses most of them and the model keeps about four tokens a step. A story is full of choices only the model can make; it keeps 1.85 tokens a step and gains little over writing without a drafter.

Many users

With one user, the extra rows ride along on a weight read that happens anyway. With many users, the server is already computing many rows per step, so the arithmetic that speculative decoding borrows is already in use. Each extra draft row now costs real time. Servers can therefore draft less, or verify fewer drafts, when they are busy. Speculative decoding helps a single user the most.

Long context

With full attention, each new token compares itself with every token before it, so a long context makes every row more expensive, draft rows included. Models with sparse attention look at a fixed number of earlier entries. In DeepSeek-V4.1 that is the last 128 tokens plus 512 entries chosen by a light indexer, so the cost of a row barely grows with the context(*1).

The roots: branch prediction in CPUs

CPUs have done this for decades. A processor reaches a branch, guesses which way it goes, and keeps working before the answer is known.

CPUSpeculative decoding
Branch predictorDrafter
Speculative executionVerifying the drafts in the same pass
Flush on a wrong guessDrop the tokens after the mismatch
RetireAccept

Two differences. A CPU’s predictor is right 95 to 99% of the time; a drafter’s tokens are accepted far less often, about half the time on prose in the example below. And a step always yields at least one token, so a wrong guess costs a little drafting work and no progress.

The side effects rhyme too. Speculative execution brought Spectre. For language models, Wei et al. report that the pattern of accepted and rejected guesses can leak through per-step token counts or packet sizes (arXiv 2411.01076).

An example: our four DGX Sparks

We serve DeepSeek-V4.1-Flash-1017 on four DGX Sparks with the ds41f engine (setup). It uses the model’s own drafter, DSpark: three extra layers that read the main model’s last three layers and draft five tokens a step(*1).

In the engine author’s runs on four Sparks(*2), one user’s step took 27.4 ms on prose and kept 2.11 tokens; on code, 29.9 ms and 3.04 tokens. Of the drafts verified, 46% were accepted on prose and 65% on code. 2.11 tokens ÷ 27.4 ms is about 77 tokens/s; we measured 76.9 tokens/s for one user on our own cluster.

The same runs show that checking extra positions is nearly free. With 16 users a step verifies up to 96 rows instead of 6, and it took 51.6 ms against 27.4 ms: up to sixteen times the rows for about twice the time.

(*1) ds41f docs/fundamentals.md: “GB10 numbers that matter”, “DSpark and decode rows” and the sparse attention section.
(*2) spark-ds41f release 1107, four Sparks through a switch, 2026-11-07, 256 output tokens (benchmark file). Our cluster is a ring without a switch. Our 76.9 tokens/s was measured on 2026-11-15 with a later test build, GPU clock capped at 2,000 MHz.

Takeaways

  • Speculative decoding covers for memory bandwidth with spare compute. On a bandwidth-bound machine like the DGX Spark it is most of the decode speed: about 15 tokens/s without a drafter, up to 38 with one, in the example above.
  • Speculative decoding does not make checking cheaper than solving. It turns serial steps into one parallel step, and a GPU computes several positions in about the time of one.
  • At temperature 0 the output is the model’s own, token for token. When sampling, the distribution is the model’s own. The drafter only decides the speed.
  • The gain is largest for one user and for predictable text such as code and JSON, and smallest for creative writing on a busy server.