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
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
- Wikipedia: Large language model Article
- Hugging Face LLM Course Course
- Karpathy: nanoGPT Article
- Stanford CS336 Course
Earn this star
On the map, you log what you built. Finish the step and its star lights.
Open this step on the map