Why Is Speculative Decoding Fast?
Recorded: Oct. 20, 2026, 10:09 a.m.
| Original | Summarized |
Why is Speculative Decoding Fast? — Joe Barrow Joe Barrow about Why is Speculative Decoding Fast? By Joe Barrow2026-10-08 But speculative decoding allows you to look at many tokens at once, and accept the ones that would have been generated by the big model: Types of Work When LLM decoding is memory bound, you’re wasting compute. Alternatively, we can use speculative decoding to run 5 tokens in one sequence, achieving high “depth” for that sequence: In both cases, the GPU is doing roughly the same amount of work. Especially if our acceptance rate isn’t 100%, every rejected token is extra wasted work. This is the core intuition behind ideas like dSpark! joe barrow · research scientist |
In an insightful article by Joe Barrow, the prevalent misunderstanding that speculative decoding achieves speed primarily by executing fewer floating-point operations per token is rigorously refuted. Barrow emphasizes that the acceleration of speculative decoding arises from a fundamental transformation of the type of work the GPU is performing, rather than from a reduction in total computational load. Although speculative decoding may involve more floating-point operations for the same sequence, its effectiveness stems from shifting the workload from memory-intensive, compute-inefficient tasks to compute-intensive, efficiently utilized tasks, thereby unlocking the GPU's capacity to generate tokens faster. This perspective challenges the intuitive assumption that the primary advantage lies in doing less work, instead highlighting that the speed is a consequence of optimizing the nature of the computational task. Speculative decoding is a sophisticated method where a lightweight draft model, typically smaller in scale, proposes a plausible sequence of tokens. This draft sequence is then validated by the primary, large-scale model in a single, parallel forward pass, which efficiently verifies the draft without re-generating tokens from scratch. In stark contrast, traditional LLM decoding operates sequentially, processing one token at a time. This one-token-per-step approach is inherently memory-bound, as the GPU must repeatedly transfer all model parameters from global memory to local memory and back for each individual token. This repeated memory traffic, while necessary, results in the GPU being idle during critical compute phases, as it is constrained by memory access rather than tensor operations. The incremental decoding paradigm thus creates a bottleneck where the GPU could be performing more work but is limited by the need to load data. From the perspective of the roofline model, a GPU's performance is determined by a trade-off between memory bandwidth and compute capability. When a GPU is waiting to fetch data for an operation, it is memory-bound, and when it is waiting for computations to complete, it is compute-bound. Barrow illustrates that traditional single-token decoding is highly memory-bound, leading to wasted compute because the GPU could execute more operations but is bottlenecked by memory loading. Conversely, when an LLM performs batched decoding—processing thousands of tokens in a single step—it becomes compute-bound, as the GPU is actively performing extensive tensor operations while data loading may be parallelized or less critical. Speculative decoding effectively mitigates this memory-bound inefficiency by allowing the GPU to process a larger number of tokens in a single forward pass, transitioning the system from a memory-bound to a compute-bound state. This shift enables the GPU to utilize otherwise idle compute resources, which is particularly beneficial at low batch sizes where the workload would otherwise remain memory-bound and idle. To concretely illustrate the mechanics, Barrow posits an optimal forward pass that processes exactly five tokens. If fewer than five tokens are processed, the operation remains memory-bound; if more than five, it becomes compute-bound. The two primary strategies for decoding are: first, to maintain a batch size of five sequences, each decoding a single token sequentially—this maximizes breadth across multiple sequences but keeps each sequence's progress minimal. Second, to employ speculative decoding to generate five tokens within a single sequence in one pass, achieving high depth for that sequence. Both strategies involve approximately the same total floating-point work. In the breadth approach, all five sequences advance by a small amount, while in the depth approach, a single sequence advances significantly. If additional sequences are introduced while keeping the speculative depth constant, the system becomes compute-bound, and all sequences slow down due to the increased total work. This demonstrates that speculative decoding is not simply about doing more work; it is about doing that work more efficiently, by concentrating depth on individual sequences to achieve substantial progress in a single step, thereby converting idle compute into productive throughput. The practical importance of this distinction becomes clear when considering real-world serving scenarios. If the system is configured to process a fixed batch size of five sequences with speculative decoding enabled, the system may be operating in a compute-bound state, wasting computational resources that could be used for memory movement. At higher batch sizes, this inefficiency is exacerbated. Moreover, if the draft model's acceptance rate is not 100%, every rejected token represents additional wasted work, as it must be reprocessed or discarded, further detracting from throughput. For this reason, systems like vLLM provide a configurable parameter, `--speculative-disable-by-batch-size`, which allows users to disable speculative decoding when the current batch size leads to suboptimal performance, thereby avoiding the associated inefficiency. This flexibility underscores the need for a nuanced understanding of when speculative decoding is beneficial versus detrimental, and highlights the importance of matching the decoding strategy to the system's computational constraints. This analysis leads to a critical reflection on the uniform application of speculative decoding. Barrow suggests that it would be more efficient to dynamically adjust the speculation depth based on the system's compute availability. Specifically, when there is abundant compute—such as at small batch sizes where the system is not memory-bound—it should speculate deeply to fully utilize the available compute. Conversely, when compute is more constrained—such as at larger batch sizes where the system is compute-bound—speculation should be shallower or dynamically adapted to avoid unnecessary compute waste. This core intuition is foundational to concepts like dSpark, which aim to dynamically optimize the speculation depth in real-time, aligning the decoding strategy with the evolving workload profile. Such adaptive approaches seek to ensure that speculative decoding always operates in the most efficient regime, maximizing speed without unnecessary computational overhead, and thus addressing the limitations of a static, depth-constant approach. In conclusion, Joe Barrow's article provides a comprehensive and counterintuitive explanation of why speculative decoding is fast. By reframing the speed not as a result of reduced work, but as a deliberate shift in the nature of GPU workload from memory-bound to compute-bound operations, he clarifies the underlying mechanism of this decoding technique. This understanding is essential for comprehending the practical efficiency, limitations, and evolving methodologies of speculative decoding, as well as for appreciating the importance of tailoring decoding strategies to the system's computational characteristics, ultimately demonstrating that the speed of speculative decoding is rooted in the strategic transformation of the GPU's workload type rather than the reduction of total computational effort. |