Activity (Process)

Ranking and Pruning Stage in Top-k Sampling

In the second stage of the Top-k sampling process, all candidate tokens from the expansion phase are sorted in descending order based on their probabilities. A parameter 'k' defines the number of top candidates to retain. For example, with k=3, the candidates 'cute' (Pr=0.34), 'on' (Pr=0.32), and 'sick' (Pr=0.21) are kept, while lower-ranked candidates like 'are' (Pr=0.12) and '.' (Pr=0.01) are pruned, or removed from further consideration.

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