AI Grimoire

Inference / decoding

Decoding

Every generated token is a choice made from a distribution, and the sampling rule shapes output quality as much as the model does. Beyond the choice itself, the entries here cover the trick of letting a smaller model guess ahead and verifying its guesses in parallel.

2 entries.

Entries

04.02.1
Sampling Strategiesstandard
Temperature, top-k, nucleus and min-p as successive truncations of the tail.
O(V log V)
04.02.2
Speculative Decodingstandard
Draft model proposes tokens; target model verifies in one pass.
O(γ·n)