Top-K
A sampling setting that limits token choice to the K most likely options.
Top-K is a token-sampling parameter that restricts the model’s next-token selection to only the K highest-probability candidates. At each step, all other tokens are excluded regardless of probability, and the model samples from that truncated set. In Amazon Bedrock, Top-K is exposed as an inference parameter alongside temperature and Top-P when invoking foundation models. Unlike Top-P, which sets a dynamic probability-mass threshold, Top-K sets a fixed count. A low K (such as 1) produces near-deterministic output, while a very high K approaches unconstrained sampling. When both are used, Top-K narrows the pool first, then Top-P filters further.
PlayPrepHQ study notes are written and reviewed against primary exam sources. How we create & review content →