Top-k
A sampling limit that keeps only the k most likely next words and throws the rest away before choosing.
Think of it like
Only letting the top 40 seeds into the tournament, no matter how the field looks.
Example
Top-k 40 means the model picks from its 40 best guesses and ignores everything else.
How it actually works
Top-k is blunt: it always keeps exactly k candidates, even when the model is very sure (so k is too many) or very unsure (so k is too few). That rigidity is why top-p often wins — it adjusts the cutoff to the model’s confidence instead of using a fixed number.
For product teams
An older, blunter variety limit; most teams prefer top-p now.
For engineers
Truncate the distribution to the k highest-probability tokens before sampling.
Related
Read anything AI without the jargon
Look up any term in plain English, or save terms as you read with the free Chrome extension.
Open DecoderAdd to Chrome