Text Generation
Generating text: temperature, top-k, top-p, repetition penalty, beam search. The generation toolbox.
Learning path
Work through each subtopic in order. Click any file below to open its lesson. Track your progress with the checkbox at the bottom.
Subtopics
Each subtopic includes a concise explanation, code examples, and references.
Greedy Decoding
Highest-probability token selector.
Random Sampling
Probability-wheel sampler.
Temperature
Distribution slider.
Top-K
Ranked-token filter.
Top-P
Cumulative-probability selector.
Repetition Penalty
Token-probability comparison.
Beam Search
Search tree.