AI-900 Practice Question: Describe features of generative AI workloads on Azure
A writer uses Azure OpenAI Service to generate multiple story ideas. They find that the model often repeats the same concepts across different outputs. Which parameter should they increase to reduce repetition and encourage more novel content?
⚠ Common exam trap
Candidates often confuse frequency penalty with temperature or top_p, assuming that increasing randomness (temperature) or narrowing sampling (top_p) is the primary way to reduce repetition, when in fact frequency penalty is the parameter explicitly designed for that purpose.
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 in Azure OpenAI Service reduces the likelihood of repeating the same tokens or phrases by applying a penalty proportional to the frequency of tokens already generated. Increasing this value discourages the model from reusing common concepts, thereby promoting more novel and diverse story ideas.
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 adjusts the probability distribution over the vocabulary by scaling logits before sampling; a higher value (e.g., 1.5) increases randomness, while a lower value (e.g., 0.2) makes outputs more deterministic. However, it applies the same scaling globally to all candidate tokens at each step and does not track which tokens have already appeared in the generated sequence. Consequently, even with high temperature, the model can still fall into repetitive loops because there is no mechanism to explicitly penalize previously used tokens. Only a dedicated repetition penalty directly reduces the likelihood of generating the same token again.
- ✗
Top_p (nucleus sampling)
Why it's wrong here
Top_p (nucleus sampling) dynamically selects the smallest set of tokens whose cumulative probability mass equals or exceeds the threshold p (e.g., 0.9) and then samples only from that set. This can add variety by discarding extremely low-probability tokens and expanding the candidate pool, which might indirectly reduce some repetitive patterns in short generations. However, top_p does not incorporate any history of token usage; it chooses from the same plausible candidates regardless of whether they were already generated. Therefore, if the model assigns high probability to repeating a token due to repetition patterns in its training data, top_p will not prevent that repetition, because it never adjusts probabilities based on prior occurrences.
- ✓
Frequency penalty
Why this is correct
Frequency penalty is the correct parameter because it explicitly subtracts a value proportional to how many times a token has already appeared in the current generated text. In Azure OpenAI, the penalty is applied to the log-probability of each token as frequency_penalty * count_of_token_occurrences, so a token used twice gets twice the penalty of a token used once. This directly discourages the model from reusing the same words or phrases over and over, making the output more novel and varied. It is specifically designed for repetition control, unlike temperature or top_p which only shape the overall probability distribution without referencing generated content.
- ✗
Max tokens
Why it's wrong here
Max tokens sets the absolute upper bound on the number of tokens the Azure OpenAI service will generate, commonly used to limit response length, cost, and latency. It does not alter the token selection logic at any individual generation step, so it cannot prevent the model from choosing repeated tokens before hitting that limit. While a shorter max_tokens might truncate a repetitive sequence and make the output seem less repetitive, the repeated content already generated remains, and the model's per-step probabilities are unchanged. Thus, max tokens is a length ceiling, not a repetition-control mechanism; the writer should use frequency penalty to directly address repetitive text.
Go deeper
Related to this question
Learn chapter
Machine Learning Core Concepts
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
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.