hardMultiple Choice
AIF-C01 Practice Question: A practitioner is using Amazon Bedrock to invoke…
A practitioner is using Amazon Bedrock to invoke Anthropic Claude for a text generation task. They need the model to output a JSON object with specific keys, and they have observed that the model occasionally produces malformed JSON. Which parameter adjustment is MOST likely to improve JSON formatting consistency?
⚠ Common exam trap
AWS often tests the misconception that increasing randomness parameters (top_k, temperature) improves output quality, when in fact reducing randomness is the key to enforcing strict formatting rules like JSON syntax.
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
✓
Decrease the temperature parameter
Decreasing the temperature parameter reduces the randomness of the model's output, making it more deterministic and less likely to deviate from the expected JSON structure. Lower temperature values (e.g., 0.1–0.3) encourage the model to choose higher-probability tokens, which improves formatting consistency for structured outputs like JSON.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the top_k parameter
Why it's wrong here
top_k influences vocabulary sampling but does not directly address formatting.
- ✓
Decrease the temperature parameter
Why this is correct
Lowering temperature sharpens the probability distribution over tokens, so Claude samples higher-confidence continuations instead of exploring unlikely ones. That reduces the random drift producing malformed JSON, directly addressing the stem's inconsistent formatting. It does not guarantee schema compliance, but it is the parameter adjustment most likely to improve consistency without prompt changes.
- ✗
Increase the max_tokens parameter
Why it's wrong here
Raising max_tokens only extends the output ceiling; it cannot constrain the model to emit valid JSON or enforce key names, so malformed output persists. It is tempting because truncated responses do cause parse failures, making max_tokens the right fix when generation is cut off mid-object rather than structurally invalid.
- ✗
Add a stop sequence of '}'
Why it's wrong here
A '}' stop sequence halts generation at the first closing brace, which can truncate nested objects and guarantees nothing about key validity. It is tempting because stop sequences do bound output, and they are the correct choice when you must terminate generation at a known delimiter such as a custom end-of-turn token.
Go deeper
Related to this question
About these practice questions
One of 862 original AIF-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.