AI-102 Implement generative AI solutions Practice Question
You are developing a solution that uses Azure OpenAI to generate customer support responses. You want to prevent the model from repeating the same phrases. Which parameter should you adjust?
⚠ Common exam trap
Test-takers frequently confuse presence_penalty with frequency_penalty, but presence_penalty only penalizes tokens that have appeared at least once (regardless of count), while frequency_penalty penalizes based on the actual frequency of occurrence, making it the correct choice for preventing repeated phrases.
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 (option D) is correct because it directly 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) decreases the probability of reusing tokens, making the output more diverse and less repetitive. This is specifically designed to address repetition in generative AI responses.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
top_p
Why it's wrong here
top_p controls token sampling pool.
- ✗
presence_penalty
Why it's wrong here
Presence penalty encourages the model to talk about new topics.
- ✗
temperature
Why it's wrong here
Temperature affects randomness, not repetition directly.
- ✓
frequency_penalty
Why this is correct
Frequency penalty reduces the likelihood of repeating the same tokens.
Go deeper
Related to this question
About these practice questions
One of 945 original AI-102 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-102 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-102 exam.