Top-P
A decoding rule that keeps the smallest set of next-word candidates whose probabilities add up to P, then samples from that set. The shortlist grows or shrinks depending on how confident the model is.
Think of It Like This
Keep the likeliest words until they cover 90% of the odds, then stop.
Top-p, also called nucleus sampling, is more adaptive than top-k. Instead of a fixed count, it keeps just enough of the top candidates for their probabilities to reach P — say 0.9 — then samples from that group. When the model is confident the pool is tiny; when it's unsure the pool grows to include more options, so the cutoff adjusts itself to each step.