Decoding & sampling

Step 7 of 13 in Generative AI · Build · Easy

Greedy, beam search, temperature, top-k and top-p decide which token comes next. They trade accuracy for diversity.

Build it

  1. Sampler

    Implement temperature, top-k and top-p; generate with GPT-2 at 3 settings.

    Done when: Outputs shown; top-p keeps the smallest set reaching p.

Resources

Earn this star

On the map, you log what you built. Finish the step and its star lights.

Open this step on the map