Glossary

What is Speculative decoding?

In Turkish: Spekülatif kod çözme · Topic: Models and training

A technique in which a small, fast model guesses several upcoming tokens and the large model verifies them in a single pass, speeding up text generation without changing the quality of the output.

How does it work?

Normally a large model produces tokens one after another. Here, a small “draft” model first proposes several tokens in a row. The large model checks all of them at once, accepts the part that matches what it would have chosen, and at the first mismatch stops and writes the correct token. Because checking can be done in parallel, several tokens can cost about as much as one step when the guesses are good. With a proper acceptance rule, the result follows the same distribution the large model would produce alone.

Why does it matter?

Response latency is one of the main problems for large models, affecting both user experience and server costs. This technique aims to add speed without shrinking the model or sacrificing quality. How much it helps depends on how often the draft model's guesses are accepted.

Example

In code completion, a draft model can easily guess boilerplate such as a function header, and the large model approves it in one step.

FAQ

Does speculative decoding reduce answer quality?

Not when implemented correctly, because the large model always has the final say. Wrong guesses from the draft model are rejected.

Why doesn't it speed things up every time?

If the draft model's guesses are rejected often, the gain shrinks. The extra computation can even cancel out the benefit.

All terms