Formula

Construction of Top-K Candidate Sequences in Beam Search

After identifying the KK most probable next tokens at step ii, the set of top-KK candidate sequences is formed by appending each of these tokens to the parent sequence, y1...yi1y_1...y_{i-1}. For each token yitop ky_i^{\text{top k}} in the set of top KK tokens (where kk ranges from 1 to KK), a new candidate sequence ytop k\mathbf{y}^{\text{top k}} is constructed as follows: ytop k=y1...yi1yitop k\mathbf{y}^{\text{top k}} = y_1...y_{i-1}y_i^{\text{top k}} This process expands a single parent hypothesis into KK new, longer hypotheses to be considered in the next step of the beam search.

0

1

Updated 2026-06-27

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