AI-900 Practice Question: Describe features of generative AI workloads on Azure
A developer uses Azure OpenAI Service to generate code snippets. They need the model to produce the most likely completion each time, with no randomness or creativity. Which parameter should they set?
⚠ Common exam trap
Microsoft often tests the misconception that temperature = 1 is 'neutral' or 'default' and therefore deterministic, but in reality temperature = 1 is the default for creative tasks and introduces full randomness, while temperature = 0 is the only setting that guarantees the most likely completion every time.
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 = 0
Setting temperature = 0 forces the model to always select the token with the highest probability at each step, eliminating randomness and ensuring deterministic, most-likely completions. This is ideal for tasks like code generation where consistency and predictability are required, as it disables the sampling randomness that higher temperature values introduce.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
temperature = 0
Why this is correct
Setting temperature to 0 configures the model to use greedy decoding, where at every decoding step it selects the token with the highest probability rather than sampling from the probability distribution. This makes the output deterministic for a fixed prompt and parameter set, so the same code-generation request returns the same snippet. For Azure OpenAI code completion tasks, this is the correct choice because the developer wants reproducible, predictable code output, not creative variation.
- ✗
temperature = 1
Why it's wrong here
A temperature value of 1 leaves the sampling distribution unmodified and allows the model to randomly draw tokens according to their raw probabilities. Running the same prompt multiple times can therefore produce different code, variable names, or logic even when all other parameters match. This randomness is useful for creative writing or brainstorming, but it is the opposite of the consistent, deterministic code generation this developer needs.
When this WOULD be correct
When the question asks for a setting that encourages creative or diverse responses, such as 'generate multiple alternative code snippets' or 'produce varied outputs for brainstorming'.
- ✗
top_p = 0.5
Why it's wrong here
top_p = 0.5 enables nucleus sampling with a cumulative probability threshold of 0.5, meaning the model samples only from the smallest set of likely tokens whose summed probabilities reach 0.5. Within that set, tokens are still chosen probabilistically, so the resulting code can vary run-to-run. Although top_p narrows the candidate pool, it does not force a single highest-probability token, so it fails to guarantee deterministic output.
When this WOULD be correct
When the question asks for controlling diversity by limiting the cumulative probability mass of token choices (nucleus sampling), e.g., 'Which parameter restricts the model to consider only tokens with top cumulative probability of 0.5?'
- ✗
frequency_penalty = 0.5
Why it's wrong here
frequency_penalty = 0.5 applies a per-token penalty to logits based on how often a token has already appeared, which suppresses repetition in the generated text. This parameter modifies the score distribution but does not remove stochastic sampling: the model still draws from a probability distribution, and no fixed token path is enforced. Because it only discourages repeats rather than selecting the most probable sequence, it cannot guarantee the same code snippet every time.
When this WOULD be correct
A question asks: 'You want to reduce repetitive patterns in generated text while allowing some creativity. Which parameter should you set?' Then frequency_penalty = 0.5 would be correct.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AI-900 exam frequently reuses these exact scenarios with slightly different constraints.
✓temperature = 0Correct answer▾
Why this is correct
Setting temperature to 0 configures the model to use greedy decoding, where at every decoding step it selects the token with the highest probability rather than sampling from the probability distribution. This makes the output deterministic for a fixed prompt and parameter set, so the same code-generation request returns the same snippet. For Azure OpenAI code completion tasks, this is the correct choice because the developer wants reproducible, predictable code output, not creative variation.
✗temperature = 1Wrong answer — click to see why▾
Why this is wrong here
Setting temperature=1 maximizes randomness, which is the opposite of the requirement for deterministic, most likely completions.
★ When this WOULD be the correct answer
When the question asks for a setting that encourages creative or diverse responses, such as 'generate multiple alternative code snippets' or 'produce varied outputs for brainstorming'.
Why candidates choose this
Candidates may mistakenly think temperature=1 is a neutral or default setting, not realizing it introduces high randomness.
✗top_p = 0.5Wrong answer — click to see why▾
Why this is wrong here
Setting top_p=0.5 still allows sampling from a subset of tokens, introducing randomness; it does not guarantee deterministic output like temperature=0 does.
★ When this WOULD be the correct answer
When the question asks for controlling diversity by limiting the cumulative probability mass of token choices (nucleus sampling), e.g., 'Which parameter restricts the model to consider only tokens with top cumulative probability of 0.5?'
Why candidates choose this
Candidates may confuse top_p with temperature, thinking that reducing top_p eliminates randomness, but top_p still permits probabilistic sampling from a truncated distribution.
✗frequency_penalty = 0.5Wrong answer — click to see why▾
Why this is wrong here
Frequency_penalty reduces repetition of tokens based on their frequency, not randomness. Setting it to 0.5 would penalize repeated tokens but still allow variability, not ensuring deterministic output.
★ When this WOULD be the correct answer
A question asks: 'You want to reduce repetitive patterns in generated text while allowing some creativity. Which parameter should you set?' Then frequency_penalty = 0.5 would be correct.
Why candidates choose this
Candidates may confuse frequency_penalty with controlling randomness, thinking penalizing frequent tokens makes output more predictable, but it actually reduces repetition, not randomness.
Analysis generated from the official AI-900blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Azure Machine Learning Studio
Key term
Azure OpenAI Service
Azure OpenAI Service is a cloud platform from Microsoft that lets developers use powerful artificial intelligence models, like GPT-4, to build applications that can understand and generate human-like text, code, images, and more.
Key term
Token
A token is a digital or physical object that represents a set of permissions or access rights, used to verify identity or grant access in computer systems.
About these practice questions
One of 985 original AI-900 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-900 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-900 exam.