AIF-C01 Applications of Foundation Models Practice Question
A developer is using Amazon Bedrock with the Cohere Command model to generate summaries of technical documents. They need to control the length of the summaries and ensure they do not exceed a certain number of tokens. Which parameter should they use in the InvokeModel API call?
⚠ Common exam trap
A common mix-up: candidates confuse stop_sequences with a length control mechanism; stop_sequences can end output early but do not enforce a specific token count.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
max_tokens
The max_tokens parameter directly controls the maximum number of tokens in the model's response. Setting it ensures the summary does not exceed the desired length. Other parameters like temperature, top_p, and stop_sequences influence creativity, diversity, or stopping conditions, but do not provide a precise token limit.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
top_p
Why it's wrong here
Top_p, or nucleus sampling, controls the diversity of the output by limiting the token selection to a cumulative probability mass. It affects which tokens are chosen but not the total number of tokens generated. It does not enforce a maximum length.
- ✓
max_tokens
Why this is correct
The max_tokens parameter specifies the maximum number of tokens to generate in the response. By setting this parameter, the developer can control the length of the summary and ensure it does not exceed the desired token limit. It is a standard parameter supported by Cohere Command on Amazon Bedrock.
- ✗
stop_sequences
Why it's wrong here
Stop_sequences are strings that, when generated, cause the model to stop generating further tokens. While they can indirectly limit length by triggering an early stop, they are not designed to enforce a specific token count. They are used to end output at a natural boundary, not to set a hard limit.
- ✗
temperature
Why it's wrong here
Temperature controls the randomness of the output, not its length. A higher temperature makes the output more varied, while a lower temperature makes it more deterministic. It does not limit the number of tokens generated, so it cannot be used to control summary length.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AIF-C01 question from scratch — 862 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
This AIF-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AIF-C01 exam.