AI-102 Implement generative AI solutions Practice Question
You are developing a generative AI solution that uses Azure OpenAI Service. You need to control the creativity of the generated responses. Which parameter should you adjust?
⚠ Common exam trap
Azure often tests the distinction between temperature (creativity/randomness) and top_p (nucleus sampling diversity), leading candidates to confuse top_p as the creativity control when it actually controls the cumulative probability cutoff for token selection.
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
✓
temperature
The temperature parameter directly controls the randomness of token selection in the model's output. Lower values (e.g., 0.2) make the model more deterministic and focused, while higher values (e.g., 0.8) increase creativity and variability. This is the primary parameter for adjusting creativity in Azure OpenAI Service.
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 narrows sampling to the smallest set of tokens whose cumulative probability reaches the threshold, so lowering it restricts rather than raises creativity, and it is an alternative to temperature rather than the parameter named for creativity. It is tempting because it shapes randomness, but it is the correct choice when you want nucleus sampling control.
- ✗
max_tokens
Why it's wrong here
max_tokens caps the length of the completion and truncates output once reached; it has no effect on how randomly tokens are sampled. It is tempting because longer answers can appear richer, but it is the correct parameter when you must bound response size or cost, not creativity.
- ✓
temperature
Why this is correct
Temperature directly scales the randomness of token sampling in Azure OpenAI Service, so lowering it narrows probability distribution toward likely tokens and raising it broadens creativity. This satisfies the stem's requirement to control response creativity, unlike max_tokens or top_p, which govern length or nucleus sampling respectively.
- ✗
frequency_penalty
Why it's wrong here
frequency_penalty reduces repetition by penalising tokens already present in the generated text; it does not alter the sampling distribution's randomness. It is tempting because it changes output variety, but it is the correct control when responses loop or overuse phrases, not when you need to tune creativity.
Go deeper
Related to this question
About these practice questions
One of 761 original AI-102 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 AI-102 practice question is part of Courseiva's free Microsoft 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 AI-102 exam.