Speculative sampling is a method that speeds up text generation with a large model by having a small, fast "draft model" write several tokens ahead, checking them all at once with the large "target model" in a single computation, and deciding which to accept with a special accept/reject rule. Because the acceptance rule is carefully designed, the probability distribution of the generated text is exactly the same (up to numerical error) as when the large model alone generates one token at a time. The name was coined by Chen et al. (2023) at DeepMind, who made generation with the 70-billion-parameter Chinchilla 2–2.5 times faster.
Generation with large language models is slow because every token requires reading all of the model's weights from memory, so time is bound by memory bandwidth rather than computation. On the other hand, computing the probabilities at each position of a few existing continuation tokens in parallel, all at once, takes about as long as generating a single token. Speculative sampling exploits this gap.
This article focuses on the probabilistic rule of which tokens to accept and what to resample on rejection (the decoding part). Around the same time, Leviathan et al. (2023) at Google independently published the same idea as "speculative decoding," and the analysis of the speedup and implementation techniques are covered in the speculative decoding article. Chen et al. also state that the core idea is the same.

