Learn Before
Mathematical Formulation of BoN Sampling
The set of output sequences, , in Best-of- (BoN) sampling is formally defined as the top sequences that maximize the conditional probability . This selection is expressed using the operation, which returns the outputs that yield the highest values for the function:

0
1
Tags
Ch.5 Inference - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Ch.4 Alignment - Foundations of Large Language Models
Related
Mathematical Formulation of BoN Sampling
A language model is tasked with generating three different possible email subject lines for a marketing campaign. The model is provided with the full text of the email body as a single prompt. Based on this generation process, which statement correctly describes the structure of the inputs and outputs?
To generate a set of N distinct output sequences using the Best-of-N (BoN) sampling process, a language model must be provided with N separate and distinct input sequences.
Applying Sampling for Code Generation
Learn After
A language model processes an input prompt
xand considers four potential output sequences:y1,y2,y3, andy4. The model calculates the conditional probabilityPr(y|x)for each sequence as follows:Pr(y1|x) = 0.45Pr(y2|x) = 0.15Pr(y3|x) = 0.85Pr(y4|x) = 0.60
If the model employs a selection method that chooses the top 2 sequences that maximize this probability, which set of sequences will be the final output?
Interpreting the BoN Sampling Formula
In the mathematical formulation of a sampling method where the top N outputs are selected based on their likelihood given an input
x, the expressionargTopN_y [Pr(y|x)]returns the N highest conditional probability values.