AI-102 Implement generative AI solutions Practice Question
You are using Azure OpenAI Service to generate text. You need to reduce the likelihood of the model generating repetitive sequences. Which TWO parameters should you adjust?
⚠ Common exam trap
Watch out — candidates often confuse temperature and top_p with repetition control, but these parameters affect randomness and diversity of token selection, not the direct penalization of 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
Frequency penalty reduces the likelihood of the model repeating the same tokens or phrases by subtracting a fixed penalty from the log-probability of tokens that have already appeared in the generated text. This directly discourages repetitive sequences, making it one of the two correct parameters to adjust.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
frequency_penalty
Why this is correct
Frequency penalty reduces repetition by penalizing frequent tokens.
- ✗
max_tokens
Why it's wrong here
max_tokens controls output length.
- ✗
top_p
Why it's wrong here
top_p controls nucleus sampling, not repetition.
- ✗
temperature
Why it's wrong here
Temperature controls creativity, not repetition.
- ✓
presence_penalty
Why this is correct
Presence penalty reduces repetition by penalizing tokens that have appeared.
Go deeper
Related to this question
About these practice questions
This AI-102 question is part of Courseiva's 945-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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-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.