Learn Before
Activity (Process)

Top-K Sampling Process

Top-k sampling is a text generation strategy that balances creativity and coherence. The process involves several stages: first, an 'Expansion' stage generates all possible next tokens; second, a 'Ranking' stage filters this list to only the top 'k' most probable tokens; third, a 'Selection and Sampling' stage renormalizes the probabilities of these k tokens and samples one; and finally, an 'Output' stage finalizes the sampled token as the next word in the sequence.

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