Learn Before
Using Beam Search to Generate Multiple Outputs
A practical example of sampling from the hypothesis space involves using the beam search decoding algorithm. Instead of selecting only the top-scoring hypothesis, multiple outputs can be generated by collecting all the complete hypotheses that are maintained within the beam during the search process.
0
1
Tags
Ch.3 Prompting - Foundations of Large Language Models
Foundations of Large Language Models
Computing Sciences
Foundations of Large Language Models Course
Related
Using Beam Search to Generate Multiple Outputs
Modifying Search Algorithms for Enhanced Sampling
Adjusting Temperature for Output Diversity
A developer is using a text-generation model to brainstorm a list of potential taglines for a new product. They provide a single, well-crafted prompt but find that the model consistently produces the same tagline. To generate a variety of different, high-quality taglines from this one prompt, which approach directly leverages the model's ability to consider multiple potential outcomes?
Optimizing a Content Generation System
Generating Creative Variations
Example of Generating Multiple Responses via LLM Sampling
Learn After
An engineer is using a text generation model with a beam search decoding strategy where the beam width is set to 3. The goal is to generate a list of possible sentence completions. At a certain step, the algorithm has produced the following partial sentences (hypotheses) with their associated scores (higher is better):
- "The cat sat on the mat" (Score: -0.8) [This is a complete sentence]
- "The cat sat on the rug" (Score: -1.2)
- "The cat sat on the chair" (Score: -1.5)
- "The cat sat on the table" (Score: -1.9)
Given that the first hypothesis is a complete sentence, how does the algorithm proceed to generate a final list of multiple, distinct outputs?
Generating Multiple Outputs from a Decoding Algorithm
A text generation algorithm is configured to produce multiple, distinct sentences by exploring several possibilities at once. At each step, it maintains a set of the most likely partial sentences. Arrange the following actions in the correct order to describe a single cycle of this process, which is repeated until the desired number of complete sentences is found.