Speculative decoding is often misunderstood as a method for reducing total computation, whereas it actually increases the number of arithmetic operations by a factor of gamma plus one. The technique achieves speedups not by reducing FLOPs, but by utilizing idle compute during memory-bandwidth-bound Transformer sampling to reduce serial steps. While theoretical proofs from Leviathan et al. (2022) and Chen et al. (2023) guarantee that the target model's output distribution remains unchanged via rejection sampling, practical implementations often yield different text samples due to variations in floating-point numerics across different computation graphs. This explains why users may perceive quality shifts despite the mathematical distribution preservation. Empirical data from Chen et al. shows significant latency improvements; for a Chinchilla 70B model, time per token dropped from 14.1 ms to 7.52 ms (1.92x speedup) on XSum, and from 14.1 ms to 5.73 ms (2.46x speedup) on HumanEval. These speedups are contingent on having sufficient compute headroom and a high draft model acceptance rate. Notably, smaller draft models, such as T5-small (77M), can outperform larger models like T5-large (800M) in this context. However, these latency benefits are primarily observed at batch size 1; throughput gains at larger batch sizes may vary.

Read original