Google Cloud Generative AI Leader free question 6 / 10 · Domain 3: Techniques to improve gen AI model output
A model's candidate tokens A, B and C have probabilities of 0.3, 0.2 and 0.1, and top-P is set to 0.5. Which tokens can the model choose from for the next token?
- Token C, the least probable token, to increase diversity in the output
- Tokens A, B and C, whose probabilities add up to 0.6
- Token A, the single most probable token in the list
- Tokens A and B, together reaching the top-P value of 0.5
Show the answer and explanation
Answer: D
Why this is correct
The page explains that top-P selects tokens from the most probable to the least probable until the sum of their probabilities equals the top-P value. With probabilities of 0.3, 0.2 and 0.1 and a top-P of 0.5, tokens A and B are enough to reach 0.5, so the model selects either A or B by using temperature and excludes C as a candidate.
Why the other options are wrong
"Tokens A, B and C, whose probabilities add up to 0.6" … Tokens are added from most to least probable until their probabilities equal the top-P value. A and B reach 0.5, so C is excluded.
"Token A, the single most probable token in the list" … Selecting only the most probable token describes a top-K of 1, also called greedy decoding. Top-P keeps tokens until their probabilities reach the value.
"Token C, the least probable token, to increase diversity in the output" … Top-P excludes C here. A lower top-P gives less random responses and a higher value gives more random ones.
Key points
Top-P keeps the most probable tokens until their probabilities reach the top-P value; a lower value gives less random responses.