Speculative Decoding is a great example of how good systems understanding can lead to performance increases; in some case around 2-3x decode throughput.1 It is kind of a perfect study since it involves knowing the entire inference stack from batch scheduling, hardware limitations to the model internals to make it work well.

Starting with the Constraints#

Lets dive into how you could have also come up Speculative Decoding. Whenever you think of optimization, you might imagine various axes of freedom the problem has e.g. to get a specific result you might be able to add more compute, this is a variable you could change; although the relation might not be linear, but the idea is there is a relation. Start with the boundary conditions for our problem; first, you might know that autoregressive decoding is

  1. Memory-bound, you can’t just add more compute and expect better results2 and

  2. you have to generate the nn-th token before you can generate the n+1n+1-th token, or that decode is inherently sequential.

Note that boundary conditions are just arbitrary here, they are soft conditions to simplify the systems model3. Here is what I think our axes might be.

  1. You could find a way to reduce what is loaded from memory, you would stop being memory limited and get closer to the memory/compute roofline. This is where ideas around various attention variants (MQA, GQA etc.), KV compression techniques, Paged / Radix attention lie.4

  2. Use more of the compute available, since anyways the model needs to be loaded from memory, might as well do more compute for that load.

  3. Batch scheduling; when serving a model to a lot of users, you can schedule a number of these decode requests together to a) amortize the cost of loading the full model across all the requests5 and b) more efficiently use more of the available compute.

In some techniques, the axes might be coupled e.g. with quantization you get a better FLOPs/bytes both due to higher FLOPS being possible on low bit data types and reduced memory movement due to small size.

Not Every Token is Equal#

Another observation about natural language; which I think almost everybody would know; is that it has a lot of redundancies and easy repeatable patterns around grammar, repeated phrases and writing conventions.6 And you are spending full model’s worth compute and memory to predict something that might locally be very easy to predict, lets take a side quest first to understand this more.

At each decode step, the model has a next token distribution pp sample from

Yi+1p(ci),ci=(yi,x)Y_{i+1} \sim p( \cdot \mid c_i), c_i = (y_{\le i}, x)

Here Information Theory gives a way to quantify how predictable this next token is. For the realized token yi+1y_{i+1}, define its information content, under the model as

hp(yi+1ci)=log2p(yi+1ci)h_p (y_{i+1} \mid c_i) = - \log_2 p(y_{i+1} \mid c_i)

Higher the probability, lesser the new information the token carries and vice versa. Here is a heatmap visualization of how the information content varies with as the sentence becomes syntactically richer.

Three increasingly elaborate variations of a sentence about pouring coffee, with each GPT-2 token shaded from low to high surprisal.

Observed-token information content across three variations of the same scene, measured locally with GPT-2 Large (774M parameters). Brighter red means the observed token received less probability from the model. Blocks follow the model’s tokenization, so a word can span several blocks.

But the amount of information is know only after a token is sampled from the distribution. To gauge the a sense of the next token information without selecting a token, you would think about aggregate metrics like what would be the expected information value under pp. This is the conditional entropy of the token

Hp(Yi+1ci)=yVp(yci)log2p(yci)H_p (Y_{i+1} \mid c_i) = - \displaystyle\sum_{y \in V} {p (y \mid c_i) \log_2 p (y \mid c_i)}

Entropy therefore measures how uncertian is the model about its own outcomes. An entropy of HH bits corresponds very loosely to a choice among 2H2^H equally likely choices. Although the full vocabulary may have a lot many tokens, at many positions grammar, repitition, formatting and semantic context reduces a lot choices.

Guessing is Enough?#

This observation suggests another systems opportunity. If a lot of next-token distributions have low entropy, perhaps you don’t need the full large model to predict every token. Remember that decode is memory-bound and has some unused compute capacity.

A cheap proposal mechanism7 could predict the easy patterns in natural language and manufacture a provisional block of kk future tokens, y^i+1,y^i+2,...,y^i+k\hat{y}_{i+1}, \hat{y}_{i+2}, ..., \hat{y}_{i+k}. It could be a smaller autoregressive model, a parallel prediction model, an n-gram lookup, or a continuation copied from the existing context. Its purpose is to provide the future tokens needed to expose parallel work for the large model. For example, say “The cat” is cic_i and the proposed next tokens are “sat on a mat” (y^\hat{y}s).

Now these proposals might be totally wrong. How do you verify them cheaply? First, simply run a causally masked forward pass on the y^\hat{y} sequence and get distributions from the large model conditioned on the preceding draft prefix. These are calculated at a better arithmetic intensity than vanilla decode. Assuming you are using greedy decoding8, you would get

yi+1=arg maxyp(ci)yi+2=arg maxyp(ci,y^i+1)yi+3=arg maxyp(ci,y^i+1,y^i+2)yi+k+1=arg maxyp(ci,y^i+1,y^i+2,,y^i+k)\begin{aligned} y_{i+1} &= \operatorname*{arg\,max}_y p(\,\cdot \mid c_i) \\ y_{i+2} &= \operatorname*{arg\,max}_y p(\,\cdot \mid c_i, \hat{y}_{i+1}) \\ y_{i+3} &= \operatorname*{arg\,max}_y p(\,\cdot \mid c_i, \hat{y}_{i+1}, \hat{y}_{i+2}) \\ &\vdots \\ y_{i+k+1} &= \operatorname*{arg\,max}_y p(\,\cdot \mid c_i, \hat{y}_{i+1}, \hat{y}_{i+2}, \dots, \hat{y}_{i+k}) \end{aligned}

What do you do with these? Notice how you can verify the entire sequence using this forward pass by comparing yys and y^\hat{y}s. If they match the draft prediction, keep the token; at the first mismatch, emit the large model’s token and drop the remaining draft tokens. The expectation is that more often than not a good chunk of the draft sequence will match. In the example above, say verification gives “sat”, “on”, “the” while the draft proposed “sat on a mat”. The first two tokens match and are kept, “the” is emitted from the large model, and “a mat” is dropped because it was conditioned on a token that was not accepted.

If all kk proposals are accepted, the final distribution computed by the same forward pass,

p(ci,y^i+1,,y^i+k),p(\cdot \mid c_i, \hat y_{i+1}, \ldots, \hat y_{i+k}),

provides one additional target token. A successful round can therefore produce k+1k+1 tokens even though the proposer supplied only kk. This greedy construction is closely related to earlier work on blockwise parallel decoding.9

Preservation of Target Distributon#

But greedy decoding is just a special case. It removes diversity from the output and can produce repetitive, degenerate continuations. Real deployments use temperature, top-k, or top-p sampling10. If speculative decoding is only a systems-level optimization, it should not change the target model’s sampling distribution.

Suppose the proposer samples a token y^\hat{y} from a distribution qq, while pp is the target model’s distribution. Here pp and qq mean the final distributions after applying temperature and any top-k or top-p transformation, not necessarily the raw softmax distributions. Instead of comparing single tokens, ask how you can retain the proposed token from qq without changing its frequency under pp. Imagine running the sampling step many times, where the proposer outputs yy with probability q(y)q(y) and the target model wants it to appear with probability p(y)p(y). If q(y)p(y)q(y) \le p(y), every proposal of yy can be accepted since the draft does not propose yy more frequently than the target permits. If q(y)>p(y)q(y) > p(y), accepting every proposal would overindex it. Retain only the fraction p(y)q(y)\frac{p(y)}{q(y)} of these proposals11. Combining these cases, draft tokens are accepted with probability

a(y^)=min(1,p(y^)q(y^))a(\hat y) = \min\left(1,\frac{p(\hat y)}{q(\hat y)}\right)

To turn this acceptance probability into a yes/no decision, sample uU(0,1)u\sim U(0,1) and accept when

ua(y^).u \le a(\hat y).

This works because, for any a[0,1]a\in[0,1], the fraction of the unit interval below aa is exactly aa:

PruU(0,1)(ua)=a.\Pr_{u\sim U(0,1)}(u\le a)=a.

The uniform draw therefore gives us a Bernoulli event with exactly the acceptance probability required above. This accepts as much of the draft distribution as possible without assigning any token more probability than the target model does. The accepted tokens have the probability mass

q(y)a(y)=min(q(y),p(y))q(y)a(y) = \min\left(q(y), p(y)\right)

This is not yet all of pp. The target probability still missing for token yy is

p(y)min(p(y),q(y))=max(0,p(y)q(y))p(y) - \min\left(p(y), q(y)\right) = \max\left(0, p(y) - q(y)\right)

This implies that when a proposal is rejected, a replacement can be sampled from the remaining normalized mass.

pres(y)=max(0,p(y)q(y))zmax(0,p(z)q(z))p_{\text{res}}(y) = \frac{\max(0, p(y) - q(y))}{\sum_z \max(0, p(z) - q(z))}

With this, the final token has the same distribution as a token sampled directly from the large model. To know how often this succeeds, take the expected acceptance

β=Eyq[a(y^)]=yq(y)a(y)=yq(y)min(1,p(y)q(y))=ymin(p(y),q(y)).\begin{aligned} \beta &= \mathbb{E}_{y \sim q} [a(\hat{y})] \\ &= \sum_y q(y)a(y) \\ &= \sum_y q(y)\min\left(1,\frac{p(y)}{q(y)}\right) \\ &=\sum_y\min(p(y),q(y)). \end{aligned}

Since min(p(y),q(y))=p(y)+q(y)p(y)q(y)2\min(p(y),q(y))=\frac{p(y)+q(y)-|p(y)-q(y)|}{2}

β=112yp(y)q(y)=1TV(p,q),\begin{aligned} \beta &=1-\frac12\sum_y|p(y)-q(y)|\\ &=1-\operatorname{TV}(p,q), \end{aligned}

Here TV(p,q)=12yp(y)q(y)\operatorname{TV}(p,q)=\frac12\sum_y|p(y)-q(y)| is the total variation distance12 between the draft and target distributions. This has a very meaningful implication. The shared probability mass is accepted, while the non-overlapping mass is rejected and corrected. So

Pr(accept)=1TV(p,q),Pr(reject)=TV(p,q).\Pr(\text{accept})=1-\operatorname{TV}(p,q), \qquad \Pr(\text{reject})=\operatorname{TV}(p,q).

Note that greedy decoding is a special case for this where pp collapses to

For g=arg maxyp(yc)p(y)={1if y=g0otherwise\text{For } g = \operatorname*{arg\,max}_y p(y \mid c) \\ p'(y) = \begin{cases} 1 & \text{if } y = g \\ 0 & \text{otherwise} \end{cases}

A matching draft token is accepted with probability one, while every other token is rejected. Low target entropy created the opportunity for cheap prediction; total variation tells us whether the proposer actually captured it.

When is it Actually Faster?#

Lets refocus on performance. Every speculative decoding round produces at least one token, either a correction at first rejection or an additional target token when every proposal is accepted. Say AjA_j is the event that the first jj draft tokens are accepted, and let ZZ be the number of tokens produced by the round. Then

G=E[Z]=1+j=1kPr(Aj).G = \mathbb{E}[Z] = 1 + \sum_{j=1}^{k}\Pr(A_j).

The initial 11 is the token that the target pass always produces. Each additional term is another draft token that survives verification. As a simplification, assume independent events with average probability β\beta; then Pr(Aj)=βj\Pr(A_j)=\beta^j. This gives

G=E[Z]=1+β+β2++βk=1βk+11β.\begin{aligned} G = \mathbb{E}[Z] &= 1 + \beta + \beta^2 + \cdots + \beta^k \\ &= \frac{1-\beta^{k+1}}{1-\beta}. \end{aligned}

Do a sanity check: β=0\beta=0 implies just one token and speculation gives us nothing, while as β1\beta\to1 the round produces close to k+1k+1 tokens. Increasing kk also has diminishing effect on GG: as kk\to\infty, GG approaches 1/(1β)1/(1-\beta). For β=0.7\beta=0.7, this means a round produces at most 3.333.33 tokens on average under this approximation. For example, with k=4k=4, W=5W=5, and β=0.7\beta=0.7,

G=1+0.7+0.72+0.73+0.742.77.G = 1 + 0.7 + 0.7^2 + 0.7^3 + 0.7^4 \approx 2.77.
Expected useful tokens per speculative round as a function of the assumed independent acceptance probability for several draft lengths.

Expected output under the independent, constant-acceptance approximation. The exact expression is G=1+j=1kPr(Aj)G=1+\sum_{j=1}^k \Pr(A_j) because acceptance varies across positions and contexts.

Roofline Analysis and Critical Batch Sizes#

Number of tokens per pass itself is not the speedup. Lets do a roofline analysis. Lets define some terms

BBBatch Size
NN# of target model parameters
ssNumber of bytes per weight
FFPeak FLOP/s of the accelerator
MMMemory Bandwidth of the accelerator
WWTarget-equivalent positions evaluated during verification (approximately k+1k+1)
LLContext length
κ(L)\kappa(L)Existing KV-cache bytes read per sequence per decode step
c(L)c(L)Compute FLOPs per token
Tp(B,L)T_p(B, L)Latency of one target decode step
Tv(B,W,L)T_v(B, W, L)Latency for target verification over k proposals
Td(B,W,L)T_d(B, W, L)Latency of producing the draft

Now lets build out the TpT_p and TvT_v values

Tp(B,L)=max(Tpmem,Tpcompute)=max(sN+Bκ(L)M,Bc(L)F)T_p(B, L) = \max\left(T_p^{mem}, T_p^{compute}\right) = \max\left( \frac{sN + B\kappa(L)}{M}, \frac{Bc(L)}{F} \right)

The critical batch size where decode becomes compute bound BpB_p^* is when

Bpc(L)F=sN+Bpκ(L)M    Bp=FsNMc(L)Fκ(L)\frac{B_p^* c(L)}{F} = \frac{sN + B_p^* \kappa(L)}{M} \implies B_p^* = \frac{FsN}{Mc(L) - F\kappa(L)}

F/MF/M is a constant and substituing ρ=F/M\rho = F/M

Bp=ρsNc(L)ρκ(L)B_p^* = \frac{\rho sN}{c(L) - \rho\kappa(L)}

Similarly for TvT_v, same amount of memory is transferred but WW times more compute is done to verify the drafts

Tv(B,W,L)=max(sN+Bκ(L)M,WBc(L)F)T_v(B, W, L) = \max\left( \frac{sN + B\kappa(L)}{M}, \frac{WBc(L)}{F} \right)

and consequently its easy to derive that the critical batch BvB_v^* is

Bv=ρsNWc(L)ρκ(L)B_v^* = \frac{\rho sN}{Wc(L) - \rho\kappa(L)}

For short context the KV cache traffic κ(L)0\kappa(L) \to 0 which means.

BpBv=Wc(L)ρκ(L)c(L)ρκ(L)BpBvW\begin{aligned} \frac{B_p^*}{B_v^*} &= \frac{Wc(L) - \rho\kappa(L)}{c(L) - \rho\kappa(L)} \\[1em] \frac{B_p^*}{B_v^*} &\approx W \end{aligned}

This means verification becomes compute-bound much earlier than ordinary decoding, confirming that block verification has higher arithmetic intensity. For longer contexts, where κ(L)>0\kappa(L) > 0, the ratio Bp/BvB_p^*/B_v^* grows as LL grows. Under our assumption that verification reuses the existing KV cache across the draft block, this makes verification relatively more attractive.

But BvB_v^* is only where verification becomes compute-bound; this is not the break-even point where speculative decoding becomes helpful. Using G=E[Z]G=\mathbb{E}[Z] from above, speedup for short contexts can be defined as

S=GTpTd+Tv=Gmax(Tmem,2BN/F)Td+max(Tmem,2BNW/F)extracting Tmem=Gmax(1,B/Bp)δ+max(1,B/Bv)where δ=Td/Tmem\begin{aligned} S &= \frac{G \cdot T_p}{T_d + T_v} \\ &= \frac{G \cdot \max(T_{mem}, 2BN / F)}{T_d + \max(T_{mem}, 2BNW/F)} \qquad \text{extracting } T_{mem} \\ &= \frac{G \cdot \max(1, B / B_p^*)}{\delta + \max(1, B / B_v^*)} \qquad \text{where } \delta = T_d / T_{mem} \end{aligned}

Here TdT_d and therefore δ\delta can generally depend on batch size. To keep the roofline model piecewise and closed-form, assume fixed WW and LL, and that δ\delta is approximately constant over the batch range being analyzed. If the drafter has its own memory-to-compute transition, the same speedup equation still applies, but the break-even point must be solved using the measured Td(B,W,L)T_d(B,W,L).

Under this approximation, you might see three regimes coming out of this.

RegimeBatchDecodeVerificationSpeedup
IB<BvB < B_v^*Memory-BoundMemory-BoundG1+δ\frac{G}{1 + \delta} (constant)
IIBvB<BpB_v^* \le B < B_p^*Memory-BoundCompute-BoundGB/Bv+δ\frac{G}{B/B_v^* + \delta} (monotonic \downarrow)
IIIBBpB \ge B_p^*Compute-BoundCompute-BoundG/W\to G/W
Idealized speculative decoding speedup versus batch size, showing verification, break-even, and ordinary decode ridges.

Idealized short-context roofline for W=5W=5, β=0.7\beta=0.7, G=2.77G=2.77, and total normalized draft latency δ=0.15\delta=0.15. These are analytical ridges, not calibrated hardware measurements.

Under the same constant-δ\delta approximation, a break even batch size can also be calculated in regime II.

BSD=(Gδ)Bv=GδWBp.\boxed{B_{\mathrm{SD}}^* = (G-\delta)B_v^* = \frac{G-\delta}{W}B_p^*}.

Above BSDB_{\mathrm{SD}}^* speculation is slower even though target-model decoding might still be memory-bound. Above BpB_p^* both paths are compute-bound and the speedup approaches G/W1G/W \le 1.13

Long-Context effects#

The result above assumed κ(L)0\kappa(L) \to 0, if you don’t assume this, the general speedup is

S=Gmax(sN+Bκ(L)M,Bc(L)F)Td+max(sN+Bκ(L)M,WBc(L)F)S = \frac{G \cdot \max\left(\frac{sN+B\kappa(L)}{M}, \frac{Bc(L)}{F}\right)} {T_d + \max\left(\frac{sN+B\kappa(L)}{M}, \frac{WBc(L)}{F}\right)}

Again in regime II, set S=1S = 1.

BSD(L)=GρsNρMTdWc(L)Gρκ(L)B_{\mathrm{SD}}^*(L) = \frac{G\rho sN-\rho M T_d} {Wc(L)-G\rho\kappa(L)}

If draft latency is written as Td=δ(sN/M)T_d=\delta \cdot (sN / M), this becomes

BSD(L)=(Gδ)ρsNWc(L)Gρκ(L).\boxed{ B_{\mathrm{SD}}^*(L) = \frac{(G-\delta)\rho sN} {Wc(L)-G\rho\kappa(L)} }.

When KV traffic grows faster than the comparatively small attention contribution to c(L)c(L), this break-even batch moves outward: ordinary decoding pays more KV bandwidth per generated token, while verification amortizes the same cache read across several speculative positions. Long context can therefore make speculative decoding useful over a wider range of batch sizes.14

This conclusion depends on KV reuse. More generally, verification reads κW(L)\kappa_W(L) bytes per sequence, where

κ(L)κW(L)Wκ(L).\kappa(L) \lesssim \kappa_W(L) \lesssim W\kappa(L).

The lower end represents effective block-level reuse; the upper end represents reading nearly the same cache traffic for every speculative position. If κW(L)\kappa_W(L) approaches Wκ(L)W\kappa(L), much of the long-context advantage disappears. The actual break-even point and speedup must be measured for the specific attention kernel, KV layout, and serving configuration in use.

Analytical decode, verification, and speculative break-even batch ridges as normalized KV-cache pressure increases.

Long context can move the useful batch range outward when block verification reuses the existing KV cache. This analytical curve assumes one effective KV-cache read per block; it is not generic to every attention implementation.

Choosing drafting width#

Another interesting question to ask is: What is the optimal WW? A wider draft exposes more parallel target work, but later proposals are useful only when every proposal before them survives. At the same time, both drafting and verification generally become more expensive. Intuition would say that small width is bad since you are not doing enough work, while large WW is also bad since GG saturates very quickly. There should be a middle ground. Simply, the optimal WW^* would be

W=arg maxWS=arg maxWG(W)Td(W)+Tv(W)Tp doesn’t depend on W.\begin{aligned} W^* &= \operatorname*{arg\,max}_W S \\ &= \operatorname*{arg\,max}_W \frac{G(W)}{T_d(W) + T_v(W)} \qquad T_p \text{ doesn't depend on } W. \end{aligned}

Let T(W)=Td(W)+Tv(W)T(W)=T_d(W)+T_v(W). Adding one more speculative position is useful while

ΔG(W)G(W)>ΔT(W)T(W).\frac{\Delta G(W)}{G(W)} > \frac{\Delta T(W)}{T(W)}.

At the crossover the two sides are equal. This isn’t easy to solve analytically, but there are insights that can be extracted from it. Since W=k+1W=k+1,

G(W)=1+β+β2++βW1,G(W) = 1 + \beta + \beta^2 + \cdots + \beta^{W-1},

and therefore

G(W+1)G(W)=ΔG(W)=βW.G(W+1)-G(W)=\Delta G(W)=\beta^W.

This means the benefit of adding new tokens drops exponentially (β1\beta\le1). On the other hand, TT is expected to increase as WW grows, with TvT_v eventually growing linearly once verification becomes compute-bound and TdT_d depending on the proposal mechanism. The optimal width is controlled by both an algorithmic limit, where prefix-survival probability becomes too small, and a hardware limit, where verification consumes the remaining compute capacity. In practice the algorithmic limit usually arrives first, which is why useful draft widths remain in the single digits even when an ideal roofline suggests capacity for hundreds of positions15. This also suggests that WW should not necessarily be fixed. A serving system can draft farther when the proposer is confident and stop early when the estimated survival probability of the next token no longer repays its marginal cost.16

Idealized speculative decoding speedup and useful-work efficiency as verification width increases for several acceptance rates.

Idealized optimal width with memory-bound verification, independent acceptance, and per-proposal draft cost d=0.05d=0.05. The practical optimum depends on measured draft and verification latency.

Optimization Design Space#

Lets sum up the design space that follows directly from the speedup equation:

  • G\uparrow G: better drafts.
  • Td\downarrow T_d: faster proposal mechanisms, n-grams, prompt lookups, retrieval, etc.
  • G/Tv\uparrow G/T_v: adaptive WW, trees, and dynamic speculation that increase useful output per unit of verification time.17
  • Tv\downarrow T_v at fixed GG: better block kernels and KV reuse.
  • Specialize the drafting and verification stages: disaggregated drafting.

Trees and wider candidate sets can increase both GG and TvT_v, so G/TvG/T_v is the relevant verifier-efficiency ratio rather than TvT_v alone. End to end, the objective is still G/(Td+Tv)G/(T_d+T_v).

The last axis can even become a hardware topology. NVIDIA describes an external-drafter configuration where Groq 3 LPX runs the draft model and Vera Rubin NVL72 verifies and commits tokens.18 Each side maintains its own KV cache, while only proposed tokens and rejected positions cross the link. This is the same algorithmic decomposition expressed physically: one system manufactures future tokens and another verifies them.

I think this should be enough of an introduction to speculative decoding to convince you that it is not just some weird trick that came out of non-obvious concepts. It is a systems technique for converting predictable future work into concurrency while preserving the original decoder distribution.

Footnotes#

  1. The two foundational works are Leviathan, Kalman, and Matias, Fast Inference from Transformers via Speculative Decoding and Chen et al., Accelerating Large Language Model Decoding with Speculative Sampling. They independently report roughly 223times3\\times latency improvements while preserving the target distribution.

  2. At low token batches, autoregressive decoding is commonly dominated by parameter and KV-cache movement rather than arithmetic. See Pope et al., Efficiently Scaling Transformer Inference and Chen et al., Accelerating Large Language Model Decoding with Speculative Sampling.

  3. You can actually say that you would change the model architecture to do parallel decode, in turn increasing the arithmetic intensity of the decode operation.

  4. See Shazeer, Fast Transformer Decoding: One Write-Head is All You Need for multi-query attention, vLLM for PagedAttention, and SGLang for RadixAttention.

  5. You might still be bound by KV-cache bytes per token since they must be loaded separately for each request in the batch.

  6. Shannon’s Prediction and Entropy of Printed English is the classic information-theoretic study of redundancy and predictability in natural language.

  7. The proposer need not be a smaller Transformer. Examples include additional prediction heads such as Medusa, EAGLE, and EAGLE-2; aligned draft models such as DistillSpec; reference-based copying such as LLMA; and retrieval-based proposals such as REST.

  8. For this first intuition, both the proposer and target use greedy decoding.

  9. Stern, Shazeer, and Uszkoreit, Blockwise Parallel Decoding for Deep Autoregressive Models developed this idea for greedy decoding before lossless speculative sampling generalized it to stochastic decoding.

  10. Temperature, top-k, and top-p can all be viewed as transformations that produce the final distribution from which a token is sampled. Speculative sampling must preserve this transformed target distribution.

  11. This resembles rejection sampling, but standard rejection sampling uses a global envelope MM and repeatedly samples from qq, accepting with probability p(y)/(Mq(y))p(y)/(Mq(y)). Speculative sampling instead accepts the maximal shared mass min(p,q)\min(p,q) and, on rejection, samples once from the residual target mass max(0,pq)\max(0,p-q). This is why Chen et al. call it modified rejection sampling.

  12. This is the acceptance-rate identity in Leviathan et al., Theorem 3.5.

  13. The interaction with batch size is studied theoretically and empirically in The Synergy of Speculative Decoding and Batching, the IBM production study Accelerating Production LLMs with Combined Token/Embedding Speculators, and the production-grade vLLM evaluation Speculative Decoding: Performance or Illusion?.

  14. MagicDec analyzes and measures this long-context regime, showing that KV-cache bandwidth can make speculative decoding useful again at large batches when verification and decode share a similar KV-loading budget. TriForce similarly uses hierarchical speculation and compressed KV caches for long-sequence generation.

  15. At B=1B=1, an ideal H100 BF16 roofline gives ρ=F/M295\rho=F/M\approx295 FLOP/byte and, for short context with c(L)2Nc(L)\approx2N and s=2s=2, Wridgeρs/2295W_{\mathrm{ridge}}\approx\rho s/2\approx295. This is a theoretical hardware ridge, not a useful draft width.

  16. Dynamic Speculation Lookahead Accelerates Speculative Decoding of Large Language Models shows that a fixed lookahead is generally suboptimal and reports improvements from selecting it dynamically.

  17. Tree verification explores several candidate futures instead of one chain. See SpecInfer and Sequoia.

  18. NVIDIA, How NVIDIA Groq 3 LPX Unlocks Ultrafast Interactivity at Long Context on NVIDIA Vera Rubin. NVIDIA calls this configuration external-drafter speculative decoding.