Formula

Construction of Top-K Candidate Sequences in Beam Search

After identifying the K most probable next tokens at step i, the set of top-K 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 K tokens (where kk ranges from 1 to K), 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 K new, longer hypotheses to be considered in the next step of the beam search.

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