AI-900 Practice Question: Describe features of generative AI workloads on Azure
A developer uses the Azure OpenAI Service to generate product descriptions for an e-commerce catalog. The developer notices that the generated text is often too long, exceeding the desired word count. Which parameter should the developer set in the API request to strictly limit the length of the generated output?
⚠ Common exam trap
Watch out — candidates often confuse parameters that affect output style (temperature, top_p, frequency_penalty) with the one that strictly caps output length, assuming any 'control' parameter can limit length, but only max_tokens provides a hard token boundary.
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
✓
Max_tokens
(max_tokens) is correct because it directly controls the maximum number of tokens (words or subwords) the model can generate in a single response. By setting this parameter to a specific value, the developer enforces a hard limit on output length, preventing the generated product descriptions from exceeding the desired word count.
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
Why it's wrong here
Temperature changes the softmax logits by dividing them by a temperature scalar, so a higher value flattens the probability distribution and produces more varied or creative text, while a lower value sharpens it toward the most likely token. This affects the style and coherence of a product description, but it is a sampling attribute, not a length control; even at the lowest temperature, the model continues emitting tokens until a stop condition such as max_tokens is reached.
When this WOULD be correct
A question asks: 'Which parameter should be adjusted to make generated text more deterministic and less random?' In that case, setting temperature to 0 would be correct.
- ✗
Top_p
Why it's wrong here
Top_p, also called nucleus sampling, selects only the smallest set of highest-probability tokens whose combined probability reaches p (for example 0.9) and then samples from that subset. It shapes which tokens are candidates at each step, increasing or decreasing diversity, but it imposes no upper bound on sequence length; a model using top_p can generate a very long or even endless product description if no other limit is set.
When this WOULD be correct
A question asks: 'Which parameter should be adjusted to reduce the randomness of generated text while still allowing diverse output?' In that case, setting Top_p to a lower value (e.g., 0.1) would make the model choose from only the most probable tokens, reducing randomness.
- ✗
Frequency_penalty
Why it's wrong here
Frequency_penalty applies a subtractive penalty to a token's score that grows with how often that token has already appeared in the generated text, thereby curbing repetitions and encouraging paraphrase. However, it only modifies the relative ranking of tokens at each step; it provides no mechanism to end the generation, so a completion could still run far beyond the desired product-description length.
When this WOULD be correct
A developer notices that the generated product descriptions contain repetitive phrases or words. Which parameter should be increased to reduce this repetition? In this scenario, frequency_penalty would be correct.
- ✓
Max_tokens
Why this is correct
Max_tokens is the only parameter that acts as a hard output budget: it tells Azure OpenAI how many tokens the model is allowed to emit in the completion, and generation stops as soon as that limit is reached. This makes it the correct choice when the developer wants to enforce a maximum length for a generated product description, because none of the other options directly sets a stopping point.
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.
✓Max_tokensCorrect answer▾
Why this is correct
Max_tokens is the only parameter that acts as a hard output budget: it tells Azure OpenAI how many tokens the model is allowed to emit in the completion, and generation stops as soon as that limit is reached. This makes it the correct choice when the developer wants to enforce a maximum length for a generated product description, because none of the other options directly sets a stopping point.
✗TemperatureWrong answer — click to see why▾
Why this is wrong here
Temperature controls randomness of token selection, not output length. It does not enforce a strict word or token limit.
★ When this WOULD be the correct answer
A question asks: 'Which parameter should be adjusted to make generated text more deterministic and less random?' In that case, setting temperature to 0 would be correct.
Why candidates choose this
Candidates may confuse 'controlling output' with 'controlling length', assuming temperature affects verbosity because higher temperature can lead to more varied and sometimes longer text.
✗Top_pWrong answer — click to see why▾
Why this is wrong here
Top_p controls nucleus sampling, which limits the cumulative probability of token choices, not the absolute length of the output. It does not enforce a strict word or token count.
★ When this WOULD be the correct answer
A question asks: 'Which parameter should be adjusted to reduce the randomness of generated text while still allowing diverse output?' In that case, setting Top_p to a lower value (e.g., 0.1) would make the model choose from only the most probable tokens, reducing randomness.
Why candidates choose this
Candidates may confuse Top_p with a length limiter because both parameters influence the output's structure, but Top_p actually controls the diversity of token selection, not the number of tokens.
✗Frequency_penaltyWrong answer — click to see why▾
Why this is wrong here
Frequency_penalty reduces repetition by penalizing tokens that have appeared frequently, but it does not directly limit the total length of the generated output. The question asks for a parameter to strictly limit length, which is controlled by max_tokens.
★ When this WOULD be the correct answer
A developer notices that the generated product descriptions contain repetitive phrases or words. Which parameter should be increased to reduce this repetition? In this scenario, frequency_penalty would be correct.
Why candidates choose this
Candidates may confuse frequency_penalty with a mechanism that limits output length, or they might think that penalizing frequent tokens indirectly shortens the text.
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
Service
A service is a software component or system that performs a specific function and is available to be used by other programs or users over a network.
About these practice questions
Courseiva writes every AI-900 question from scratch — 985 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-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.