Definition
At each step the model outputs a distribution over the vocabulary; sampling picks the token.
| Strategy | Rule |
|---|---|
| Greedy | |
| Temperature | logits / before softmax |
| Top-k | keep the most likely tokens |
| Top-p | smallest set with cumulative probability |
| Min-p | keep |
Safety
Decoding parameters alone moved a misalignment rate from 0% to 95%+ (Huang et al., ICLR 2024), 30× cheaper than GCG.
Appears in
- Lecture 2, unembedding and sampling
- Lecture 2, sampling and safety
- Lecture 3, Best-of-N: sampling many augmented prompts
- Lecture 5, Embedding the Watermark: the watermark changes the sampling distribution