AIF-C01 Practice Question 74: Controlling Response Length
AWS Certified AI Practitioner (AIF-C01) · Test 8 · question 4 of 10
Summaries from a Bedrock-backed tool sometimes run on for pages, and sometimes the model finishes the summary and then starts an unwanted "Further reading" section. The team wants a hard ceiling on how much the model generates, and wants generation to halt cleanly as soon as the model writes a particular marker string. Which inference parameters address this?
Show answer and explanation
Answer:
Amazon Bedrock groups inference parameters into two families. The Length family is the one that bounds output: response length is *an exact value to specify the minimum or maximum number of tokens to return in the generated response*, and stop sequences let you *specify sequences of characters that stop the model from generating further tokens*; *if the model generates a stop sequence that you specify, it will stop generating after that sequence*. A maximum length gives the hard ceiling and a stop sequence on the unwanted heading ends the response cleanly (option D).
- A is wrong because temperature and Top P both belong to the randomness and diversity family. They change how adventurous the model's word choices are, not how many words it produces. A low temperature yields a predictable rambling summary rather than a short one. - B is wrong for the same reason: Top K and Top P are two ways of sizing the candidate token pool at each step. Neither one bounds the length of the finished response. - C is wrong because it pairs a randomness parameter with a retrieval setting. The number of retrieved passages changes what goes *into* the prompt; it has no direct control over how much comes out.
Reference: Influence response generation with inference parameters