Courseiva

AI-900 Practice Question: Describe features of generative AI workloads on Azure

A developer uses Azure OpenAI Service to generate creative marketing copy. The API costs are based on the total number of tokens processed (input + output). To minimize costs, the developer wants to ensure that the generated text is as brief as possible while still being effective. Which parameter should the developer adjust in the API request?

⚠ Common exam trap

It's easy for candidates to confuse parameters that affect output style (temperature, top_p, frequency_penalty) with the one that directly controls output length (max_tokens), leading them to pick a parameter that changes how the model writes rather than how much it writes.

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 this parameter directly controls the maximum number of tokens the model can generate in a single response. By setting a lower max_tokens value, the developer caps the length of the output, which reduces the total tokens processed (input + output) and thus lowers API costs. Other parameters influence the style or diversity of the output but do not directly limit the length of the generated text.

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 rescales the logit probabilities before sampling, with lower values sharpening the distribution and making the output more deterministic and repetitive. It changes the likelihood of individual tokens being selected, thereby influencing creativity and variability, but it has no effect on the length of the generated sequence. A low temperature could still produce a long, detailed answer if max_tokens is high, and a high temperature could produce a short one, so temperature is unrelated to output size.

    When this WOULD be correct

    When the goal is to control creativity or variability of responses, such as generating diverse story ideas or ensuring more deterministic answers in a Q&A bot, temperature is the correct parameter to adjust.

  • top_p

    Why it's wrong here

    top_p uses nucleus sampling, where the model only considers tokens whose cumulative probability mass reaches the threshold p, so it filters the candidate set during decoding. This parameter controls how focused or diverse the generated output is, but it does not impose any constraint on the total number of tokens emitted. The generation continues until an end-of-sequence token is produced or the separate max_tokens limit is reached, so top_p alone cannot shorten a response.

    When this WOULD be correct

    A question asks: 'To reduce repetitive or predictable text in generated responses, which parameter should be adjusted?' In that context, lowering top_p (e.g., to 0.1) makes the model choose from a smaller set of high-probability tokens, reducing randomness and repetition.

  • max_tokens

    Why this is correct

    max_tokens is the correct parameter because it directly sets a hard upper limit on the number of tokens the model may generate in a completion. In Azure OpenAI, this value caps the output sequence length, so lowering it reduces the amount of text produced and, since billing is per token, proportionally lowers the cost. However, if set too low, the response can be truncated mid-thought, cutting off a coherent answer.

  • frequency_penalty

    Why it's wrong here

    frequency_penalty applies a subtractive bias to tokens based on how often they have already appeared in the text, lowering their scores to discourage immediate repetition. This is a sampling-time adjustment that shapes the lexical diversity and verbosity of the content, but it does not define an upper bound on generation length. The model will keep generating tokens until the stop condition or the max_tokens cap is encountered, making frequency_penalty ineffective for controlling total output size.

    When this WOULD be correct

    A developer wants to generate diverse product descriptions without repetitive phrases. Adjusting frequency_penalty would penalize tokens that have already appeared, promoting variety in the output.

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 correct parameter because it directly sets a hard upper limit on the number of tokens the model may generate in a completion. In Azure OpenAI, this value caps the output sequence length, so lowering it reduces the amount of text produced and, since billing is per token, proportionally lowers the cost. However, if set too low, the response can be truncated mid-thought, cutting off a coherent answer.

temperatureWrong answer — click to see why

Why this is wrong here

Temperature controls randomness of output, not length. Adjusting it does not directly limit the number of tokens generated, so it won't minimize costs by reducing text length.

★ When this WOULD be the correct answer

When the goal is to control creativity or variability of responses, such as generating diverse story ideas or ensuring more deterministic answers in a Q&A bot, temperature is the correct parameter to adjust.

Why candidates choose this

Candidates may confuse temperature with controlling output length because both affect the 'shape' of the response, or they might think lower temperature produces shorter text by being more conservative.

top_pWrong answer — click to see why

Why this is wrong here

top_p controls nucleus sampling, affecting the diversity of word choices, not the length of the output. Adjusting top_p does not directly limit the number of tokens generated, so it cannot minimize costs by ensuring brevity.

★ When this WOULD be the correct answer

A question asks: 'To reduce repetitive or predictable text in generated responses, which parameter should be adjusted?' In that context, lowering top_p (e.g., to 0.1) makes the model choose from a smaller set of high-probability tokens, reducing randomness and repetition.

Why candidates choose this

Candidates may confuse top_p with a length control parameter because both influence output characteristics, and they might think adjusting probability mass can indirectly shorten responses by limiting token choices.

frequency_penaltyWrong answer — click to see why

Why this is wrong here

Frequency penalty reduces repetition of token sequences but does not directly limit output length; it can even increase token count by encouraging diverse phrasing.

★ When this WOULD be the correct answer

A developer wants to generate diverse product descriptions without repetitive phrases. Adjusting frequency_penalty would penalize tokens that have already appeared, promoting variety in the output.

Why candidates choose this

Candidates may confuse 'penalty' with 'limit' and think frequency_penalty reduces overall output length, or they may assume it controls verbosity by penalizing common words.

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?”

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 →

How Courseiva writes practice questions · Editorial policy

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.