AI-900 Practice Question: Describe features of generative AI workloads on Azure
A developer uses Azure OpenAI to generate product descriptions. The outputs often repeat the same phrases multiple times within a single description. Which parameter should the developer increase to reduce this repetition?
⚠ Common exam trap
Watch out — candidates often confuse frequency penalty with presence penalty, thinking both reduce repetition equally, but frequency penalty specifically targets how often a token appears, while presence penalty only cares if it has appeared at all.
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 repetition by penalizing tokens that have already appeared in the generated text. Increasing this value discourages the model from reusing the same phrases, making the output more diverse and less repetitive.
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 controls the probability distribution over the next token before sampling. A higher value flattens that distribution, making lower-probability tokens more likely and producing more varied or creative output, while a lower value sharpens it toward the top choices. Although changing temperature can incidentally change how often words repeat, it does not apply any penalty to tokens that have already appeared, so it is not the correct control for reducing repetition.
- ✓
Frequency penalty
Why this is correct
Increasing the frequency penalty directly lowers the logit (score) of every token already in the generated text by an amount proportional to how many times that token has occurred. This means repeated words and phrases are progressively demoted in each new sampling step, which actively breaks repetitive loops and n-gram reuse. The parameter is therefore the intended control when product descriptions begin echoing the same adjectives or clauses.
- ✗
Presence penalty
Why it's wrong here
Unlike frequency penalty, presence penalty subtracts a fixed amount from the logits of all tokens that have appeared at least once, regardless of their exact count. So a word that showed up five times receives the same demotion as a word shown once, making it better at forcing the model to discuss new ideas than at suppressing verbatim repeated phrases. For long product copy, a phrase may recur many times without accumulating extra penalty, which is why presence penalty is weaker for this repetition problem.
- ✗
Max tokens
Why it's wrong here
Max tokens is a completion-length cap: it stops generation once the model has emitted the configured number of tokens or a stop sequence is reached. It can only cut off text before further repetitions occur, not reduce the probability that the next sampled token repeats an earlier one. Thus, if the repetition starts early, a longer max tokens limit will happily generate many identical phrases, so it is not a repetition control.
Go deeper
Related to this question
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.