Skip to main content

AI-200 practice question · Connect to and Consume Azure Services

An application calls an Azure OpenAI chat completions deployment. The prompt tells the model to finish each answer with…

An application calls an Azure OpenAI chat completions deployment. The prompt tells the model to finish each answer with the marker "###END###", but the model sometimes keeps generating unwanted text after the marker. The developer wants generation to end at that marker, whatever the response length. Which request parameter should they set?

  • Astop
  • Bmax_completion_tokens
  • Clogit_bias
  • Dfrequency_penalty
Show the answer and explanation

Correct answer: A) stop

The chat completions 'stop' parameter takes up to 4 sequences and ends generation as soon as one is produced, without including it in the output. Token limits and sampling parameters only control length or token probabilities.

Why each option is right or wrong

  • A) Correct. The stop parameter accepts up to 4 sequences. When the model generates one of them, the API stops producing further tokens, and the returned text doesn't include the stop sequence. This ends generation at the marker based on content, not length.
  • B) Incorrect. This sets an upper limit on the number of generated tokens. It cuts the output off by count, wherever that falls, so it can't reliably stop at a specific marker.
  • C) Incorrect. logit_bias changes how likely specific token IDs are to appear. It doesn't stop generation when a given string is produced.
  • D) Incorrect. frequency_penalty lowers the likelihood of tokens that have already appeared often, to reduce repetition. It doesn't define where generation ends.
Exam domain
Connect to and Consume Azure Services · 25% of AI-200
Question type
Multiple choice (one answer)

Practise the full AI-200 exam

This question is one of a small free sample from the CertRidge AI-200 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.

Original question written from the official exam guide. Not affiliated with Microsoft; never copied from the real exam.