The correct answer is to change the stop sequence to [".", "!", "?"]. This works because a stop sequence tells the model exactly when to halt text generation, and for sentence endings, you need to target the punctuation that naturally terminates a sentence—periods, exclamation marks, and question marks. The original configuration using "\n" only stops at newline characters, which is a line break, not a grammatical boundary, so the model would continue generating past sentence endings until it hits a newline. On the Microsoft Azure AI Engineer Associate AI-102 exam, this concept tests your understanding of controlling generative AI output parameters, often appearing in scenario-based questions about configuring inference in Azure OpenAI. A common trap is confusing line breaks with sentence boundaries; remember that newlines are structural, not linguistic. For a quick memory tip, think of the three sentence stoppers as "Punctuation Power Trio"—period, exclamation, question—and if you see a stop sequence with only "\n", swap it out for this trio to ensure complete sentences.
AI-102 Implement generative AI solutions Practice Question
This AI-102 practice question tests your understanding of implement generative ai solutions. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
You are deploying a generative AI application. You have the JSON configuration above. You need to ensure that the model stops generating output at the end of each sentence. The current configuration uses a stop sequence of "\n". What should you do?
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Change the stop sequence to [".", "!" , "?"]
Option A is correct because the goal is to stop generation at the end of each sentence. A sentence can end with a period (.), exclamation mark (!), or question mark (?). The current stop sequence of "\n" only stops at newline characters, which does not guarantee sentence boundaries. By changing the stop sequence to an array containing [".", "!", "?"], the model will halt output whenever it generates any of these punctuation marks, ensuring each sentence is complete.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✓
Change the stop sequence to [".", "!" , "?"]
Why this is correct
These are sentence-ending punctuation marks.
Related concept
Read the scenario before looking for a memorised answer.
✗
Reduce the maxTokens to 500.
Why it's wrong here
maxTokens limits total length, not sentence completion.
✗
Set the topP to 0.5.
Why it's wrong here
topP controls nucleus sampling, not stopping.
✗
Set the temperature to 0.
Why it's wrong here
Temperature affects randomness, not stopping behavior.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often confuse parameters that control output randomness (temperature, topP) or length (maxTokens) with parameters that define explicit stopping conditions, leading them to select options that do not actually enforce sentence boundaries.
Detailed technical explanation
How to think about this question
Stop sequences in generative AI models like GPT are token-level triggers that cause generation to halt immediately when any specified token appears in the output. The stop sequence is matched against the raw token IDs, so punctuation marks like '.' must be included as separate strings in the array. In practice, using multiple stop tokens can interact with tokenization—for example, a period followed by a space might be tokenized as a single token in some models, so testing with actual tokenizer output is recommended to ensure reliable sentence termination.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Implement generative AI solutions — This question tests Implement generative AI solutions — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Change the stop sequence to [".", "!" , "?"] — Option A is correct because the goal is to stop generation at the end of each sentence. A sentence can end with a period (.), exclamation mark (!), or question mark (?). The current stop sequence of "\n" only stops at newline characters, which does not guarantee sentence boundaries. By changing the stop sequence to an array containing [".", "!", "?"], the model will halt output whenever it generates any of these punctuation marks, ensuring each sentence is complete.
What should I do if I get this AI-102 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.