Courseiva

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

A developer uses Azure OpenAI Service to generate product reviews for an e-commerce site. The developer notices that the model often repeats the same phrases within the same review, making the output sound unnatural. Which parameter should the developer adjust to reduce this repetition?

⚠ Common exam trap

A common mix-up: candidates confuse frequency_penalty with temperature or top_p, assuming any parameter that affects output diversity will solve repetition, but only frequency_penalty directly penalizes repeated tokens.

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

Frequency_penalty

The frequency_penalty parameter reduces the likelihood of the model repeating the same phrases by penalizing tokens that have already appeared in the generated text. A higher frequency_penalty value (e.g., 0.5 to 1.0) discourages the model from reusing the same words or phrases, making the output more diverse and natural. This directly addresses the issue of repetitive phrasing in product reviews.

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 scales the logits before softmax by dividing them by the set value (0-2), controlling the sharpness of the probability distribution. Lower temperatures make sampling more deterministic and greedy, while higher temperatures increase randomness and diversity. It does not track token frequencies or apply any penalty for repeated tokens, so adjusting it may change overall fluency or creativity but will not directly fix a specific repetition problem.

    When this WOULD be correct

    A developer wants to make generated product reviews more creative and varied. Which parameter should be increased to increase randomness? Answer: Temperature.

  • Top_p

    Why it's wrong here

    Top_p (nucleus sampling) dynamically selects the smallest set of tokens whose cumulative probability mass reaches the threshold p, then redistributes probability only among that set. This parameter limits the pool of candidate tokens at each step, but it does not track or discount tokens that have appeared earlier in the sequence. Consequently, it can affect local variability but cannot penalize recurrence of a specific token, leaving repetition unaddressed.

    When this WOULD be correct

    A developer wants to generate more creative and varied text, but the model is producing overly generic or safe outputs. Adjusting Top_p to a lower value (e.g., 0.9) would narrow the set of possible tokens, making the output more focused and less random, which is ideal for tasks requiring coherent and predictable text.

  • Max_tokens

    Why it's wrong here

    Max_tokens caps the total number of tokens generated in the completion, effectively bounding the length of the output. If a model is already stuck in a repeating loop, raising or lowering this limit merely changes where the text is cut off; it does not alter the underlying token selection distribution. This parameter has no mechanism to modify the probability of a token based on its previous occurrences, so it cannot mitigate repetition within the generated product description.

    When this WOULD be correct

    A developer needs to generate a product description that must not exceed 50 words. Adjusting max_tokens to 50 ensures the output is cut off at the word limit, preventing overly long responses.

  • Frequency_penalty

    Why this is correct

    In Azure OpenAI Service, frequency_penalty is a sampling parameter in the range -2.0 to 2.0 that subtracts a penalty proportional to the number of times a token has already appeared in the generated sequence. Each time a token is selected, its cumulative count raises the penalty applied to its logit score, thereby suppressing the probability of generating the same token repeatedly. This directly targets the symptom of repetitive loops, making it the appropriate tuning for product descriptions that keep repeating phrases.

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.

Frequency_penaltyCorrect answer

Why this is correct

In Azure OpenAI Service, frequency_penalty is a sampling parameter in the range -2.0 to 2.0 that subtracts a penalty proportional to the number of times a token has already appeared in the generated sequence. Each time a token is selected, its cumulative count raises the penalty applied to its logit score, thereby suppressing the probability of generating the same token repeatedly. This directly targets the symptom of repetitive loops, making it the appropriate tuning for product descriptions that keep repeating phrases.

TemperatureWrong answer — click to see why

Why this is wrong here

Temperature controls randomness of token selection, not repetition of phrases; reducing temperature makes output more deterministic but doesn't penalize repeated tokens.

★ When this WOULD be the correct answer

A developer wants to make generated product reviews more creative and varied. Which parameter should be increased to increase randomness? Answer: Temperature.

Why candidates choose this

Candidates may confuse temperature with frequency penalty, thinking lower temperature reduces repetition, but temperature affects overall randomness, not repetition specifically.

Top_pWrong answer — click to see why

Why this is wrong here

Top_p (nucleus sampling) controls the diversity of word choices by limiting the cumulative probability of token selection, but it does not specifically penalize repeated phrases. Repetition is best addressed by frequency_penalty, which directly reduces the likelihood of tokens that have already appeared.

★ When this WOULD be the correct answer

A developer wants to generate more creative and varied text, but the model is producing overly generic or safe outputs. Adjusting Top_p to a lower value (e.g., 0.9) would narrow the set of possible tokens, making the output more focused and less random, which is ideal for tasks requiring coherent and predictable text.

Why candidates choose this

Candidates may confuse Top_p with a mechanism to reduce repetition because both parameters influence output diversity, but Top_p affects the pool of candidate tokens rather than penalizing frequency of occurrence.

Max_tokensWrong answer — click to see why

Why this is wrong here

Max_tokens controls the total length of the generated text, not the likelihood of phrase repetition. Adjusting it would truncate or extend the review but not reduce repetitive phrasing.

★ When this WOULD be the correct answer

A developer needs to generate a product description that must not exceed 50 words. Adjusting max_tokens to 50 ensures the output is cut off at the word limit, preventing overly long responses.

Why candidates choose this

Candidates may mistakenly think that limiting the number of tokens will prevent the model from having enough space to repeat phrases, but repetition is a sampling behavior, not a length constraint.

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.