GCP Generative AI Leader Practice Question 58: Max Output Tokens Truncation
Google Cloud Generative AI Leader · Test 6 · question 8 of 10
A support team built a Gemini-powered assistant that writes long troubleshooting guides. Several guides now cut off mid-sentence before reaching a conclusion, even though the model clearly had more to say. A developer checks the request configuration and finds the response length is capped well below what a full guide requires.
Which generation parameter is most likely causing the guides to be cut off?
Show answer and explanation
Answer:
Max output tokens (maxOutputTokens) sets a hard ceiling on how many tokens a response can contain. Once generation reaches that limit, the response stops immediately, even mid-sentence, regardless of whether the model had more relevant content to produce. A guide that consistently cuts off before its conclusion, while the configuration shows a cap well below the guide's typical length, is a textbook symptom of this parameter being set too low; raising it lets the model finish naturally.
- A is wrong because temperature controls randomness in word choice, not how many tokens the response is allowed to contain. - B is wrong because top-p controls how much of the probability mass is considered when sampling the next token, not the total response length. - C is wrong because top-k limits the number of candidate tokens considered at each step, not the overall length ceiling on the finished response.
Reference: Content generation parameters