AI-102 Implement generative AI solutions Practice Question
A developer wants to use Azure OpenAI to generate text from a prompt. Which parameter controls the diversity of the generated output?
⚠ Common exam trap
Candidates often confuse frequency_penalty or presence_penalty with controlling diversity, but those parameters address repetition and topic novelty, not the fundamental randomness of token selection, which is exclusively governed by temperature.
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
Temperature is the parameter that directly controls the randomness or diversity of the generated output by scaling the logits before applying the softmax function. A higher temperature (e.g., 1.0) increases the probability of less likely tokens, producing more creative and varied responses, while a lower temperature (e.g., 0.1) makes the output more deterministic and focused.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
presence_penalty
Why it's wrong here
Presence penalty encourages new topics.
- ✗
frequency_penalty
Why it's wrong here
Frequency penalty reduces repetition.
- ✓
temperature
Why this is correct
Temperature controls randomness and diversity.
- ✗
max_tokens
Why it's wrong here
max_tokens controls output length, not diversity.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AI-102 question from scratch — 945 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 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.