Learn Before
Formula

Formal Derivation of the Top-k Selection Pool

The selection pool in top-k sampling, ViV_i, is formally derived by identifying the KK tokens with the highest conditional probabilities from the entire vocabulary at each generation step ii. This selection process is formalized using the argTopK function, which ranks the prediction probabilities of all possible next tokens and returns the top KK. The resulting selection pool is thus defined as: Vi={yitop1,,yitopk}=argTopKyiVPr(yix,y<i)V_i = \{y_i^{\text{top1}}, \dots, y_i^{\text{topk}}\} = \underset{y_i \in V}{\text{argTopK}} \, \text{Pr}(y_i|\mathbf{x}, \mathbf{y}_{<i}) where the probability is conditioned on the input x and the preceding token sequence y_{<i}.

Image 0

0

1

Updated 2026-05-02

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