Formula

Formula for Constructing Top-K Candidate Sequences

In the beam search algorithm, the top KK candidate sequences for step ii are generated by extending the previous step's prefixes with the newly selected tokens. Each new sequence is formed by appending a top token: ytopk=y1...yi1yitopk\mathbf{y}^{\mathrm{top}k} = y_1...y_{i-1} y_i^{\mathrm{top}k}. The final candidate set, denoted YiY_i, is then formally defined as Yi={ytop1,...,ytopK}Y_i = \{\mathbf{y}^{\mathrm{top}1},...,\mathbf{y}^{\mathrm{top}K}\}, where KK represents the beam width.

Image 0

0

1

Updated 2026-05-03

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

Related