Activity (Process)

Selection and Sampling Stage in Top-k Sampling

This stage, labeled as step ③, follows the ranking and pruning phase in Top-k sampling. It involves two key actions on the selected top-k candidates. First, the probabilities of these candidates are rescaled, or 'renormalized,' so that they sum to 1. For example, the initial probabilities of 'cute' (0.34), 'on' (0.32), and 'sick' (0.21) are adjusted to new values of 0.39, 0.36, and 0.25, respectively. Second, a single token is chosen by randomly sampling from this new, smaller probability distribution. In the example, the token 'on' is selected through this sampling process.

Image 0

0

1

Updated 2025-10-10

Contributors are:

Who are from:

Tags

Ch.5 Inference - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences