AIF-C01 Fundamentals of Generative AI Practice Question
A developer is prompting a foundation model to classify customer feedback into categories. The model sometimes returns extra commentary along with the category label, breaking downstream parsing. The developer wants more deterministic, tightly formatted output without retraining the model. Which technique best addresses this?
⚠ Common exam trap
The trap here is reaching for sampling knobs like top-p or token limits, which affect variety and length rather than enforcing a strict, deterministic output structure.
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
✓
Set the temperature to zero and constrain the output using a structured format specification.
Setting temperature to zero makes generation greedy and deterministic, while a structured output specification constrains the response to an exact schema. This combination eliminates extraneous commentary and guarantees a parseable label, achieving the desired formatting control without any model retraining. It directly targets both the randomness and the format-enforcement gaps causing the parsing failures.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Set the temperature to zero and constrain the output using a structured format specification.
Why this is correct
Lowering temperature to zero makes token selection greedy and far more deterministic, while constraining output with a structured format such as a JSON schema enforces the exact shape of the response. Together these yield tightly formatted labels that downstream systems can parse reliably, without any retraining, directly solving the developer's problem.
- ✗
Add more few-shot examples that include verbose explanations of each category.
Why it's wrong here
Few-shot examples can guide behavior, but examples containing verbose explanations may encourage the model to mimic that verbosity, worsening the stray-commentary issue. This approach does not enforce a strict output shape and leaves formatting to chance, so it is unlikely to reliably produce the clean, parseable labels the developer needs.
- ✗
Increase the maximum output token count to give the model more room to respond.
Why it's wrong here
Allowing more output tokens gives the model additional space, which can actually invite more commentary rather than suppress it. Token limits govern length, not structure or determinism, so this change does nothing to enforce a clean label format and may make parsing harder by permitting longer, less predictable responses.
- ✗
Increase the top-p sampling value to broaden the token selection pool.
Why it's wrong here
Raising top-p widens the set of tokens considered at each step, producing more varied and creative text. That increases, not decreases, the chance of extra commentary appearing alongside the label. For a classification task needing strict formatting, broader sampling works against determinism and would likely worsen the parsing problem.
Go deeper
Related to this question
About these practice questions
This AIF-C01 question is part of Courseiva's 862-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.