Microsoft AI-102 (Designing and Implementing a Microsoft Azure AI Solution) Practice Test 18

Question 170

An instruction-following chat assistant must bound the number of generated output tokens from a model request. Reviewers will accept the implementation when responses stop within the configured completion-token budget. Which approach best fulfills that requirement?

  1. Set an output token limit
  2. Adjust the temperature parameter
  3. Request a supported structured response format
  4. Add a few-shot example to the prompt

Explanation

Correct Answer

A:

The generation limit caps permitted completion tokens and can control output length and resource use. For this instruction-following chat assistant, the intended evidence is that responses stop within the configured completion-token budget. It does not determine the number of documents returned by Azure AI Search.

Incorrect Answers

B:

Temperature controls token-sampling randomness for supported generation models and endpoints; it may be used to reduce random variation across repeated generations when the deployed API supports it in a instruction-following chat assistant, but the current requirement is instead to bound the number of generated output tokens from a model request. That separate capability does not prove that responses stop within the configured completion-token budget; It does not control request authentication or force unsupported model output formats, so selecting that alternative would not meet the stated acceptance check.

C:

Structured-output features constrain compatible model responses to a specified schema when available; it may be used to obtain machine-parseable JSON that conforms to a declared response schema in a instruction-following chat assistant, but the current requirement is instead to bound the number of generated output tokens from a model request. That separate capability does not prove that responses stop within the configured completion-token budget; Merely lowering temperature does not enforce object properties or valid JSON syntax, so selecting that alternative would not meet the stated acceptance check.

D:

Few-shot prompting demonstrates desired transformations through examples in the model's context; it may be used to show the model representative input-output examples for an unfamiliar formatting task in a instruction-following chat assistant, but the current requirement is instead to bound the number of generated output tokens from a model request. That separate capability does not prove that responses stop within the configured completion-token budget; It does not update model weights or store examples permanently after the context is discarded, so selecting that alternative would not meet the stated acceptance check.

Question 171

An agent occasionally consumes excessive tokens while expanding verbose answers. What request-side guard is appropriate?

  1. Repeat evaluations across a representative dataset and track output variability
  2. Set an output-token cap appropriate to the workflow and handle truncation safely
  3. Include representative normal cases and relevant edge cases without contaminating evaluation data
  4. Use a supported schema-constrained output mechanism rather than prose-only formatting requests

Explanation

Correct Answer

B:

Output limits bound generated length and cost exposure but should be paired with safe handling of incomplete responses. In the instruction-following chat assistant, confirm the fix by retesting the affected behavior after setting an output-token cap appropriate to the workflow and handle truncation safely.

Incorrect Answers

A:

Although useful elsewhere in the instruction-following chat assistant, sampling controls cannot replace empirical robustness testing, especially when infrastructure and model versions evolve; the present case is different and calls for the team to set an output-token cap appropriate to the workflow and handle truncation safely.

C:

That change addresses another failure mode: diverse examples clarify intended behavior across boundaries, not just the easiest input pattern; it does not address this case, for which the relevant intervention is to set an output-token cap appropriate to the workflow and handle truncation safely.

D:

Prompt wording can encourage JSON but cannot enforce the same guarantees as supported structured outputs in its own workflow, but that is a different correction from the present requirement to set an output-token cap appropriate to the workflow and handle truncation safely. The reported issue would remain.

Question 172

The solution brief for an instruction-following chat assistant requires the system to establish high-priority rules for a model's role, behavior, and response boundaries. A successful test confirms that expected output consistently follows application-level response rules. What should the team use?

  1. Add a few-shot example to the prompt
  2. Use a system or developer instruction
  3. Adjust the temperature parameter
  4. Request a supported structured response format

Explanation

Correct Answer

B:

Higher-priority instructions steer model behavior across user turns subject to the API's instruction hierarchy. For this instruction-following chat assistant, the intended evidence is that expected output consistently follows application-level response rules. They do not grant the model permissions to private APIs or guarantee compliance against every attack.

Incorrect Answers

A:

Few-shot prompting demonstrates desired transformations through examples in the model's context; it may be used to show the model representative input-output examples for an unfamiliar formatting task in a instruction-following chat assistant, but the current requirement is instead to establish high-priority rules for a model's role, behavior, and response boundaries. That separate capability does not prove that expected output consistently follows application-level response rules; It does not update model weights or store examples permanently after the context is discarded, so selecting that alternative would not meet the stated acceptance check.

C:

Temperature controls token-sampling randomness for supported generation models and endpoints; it may be used to reduce random variation across repeated generations when the deployed API supports it in a instruction-following chat assistant, but the current requirement is instead to establish high-priority rules for a model's role, behavior, and response boundaries. That separate capability does not prove that expected output consistently follows application-level response rules; It does not control request authentication or force unsupported model output formats, so selecting that alternative would not meet the stated acceptance check.

D:

Structured-output features constrain compatible model responses to a specified schema when available; it may be used to obtain machine-parseable JSON that conforms to a declared response schema in a instruction-following chat assistant, but the current requirement is instead to establish high-priority rules for a model's role, behavior, and response boundaries. That separate capability does not prove that expected output consistently follows application-level response rules; Merely lowering temperature does not enforce object properties or valid JSON syntax, so selecting that alternative would not meet the stated acceptance check.

Question 173

A release for an instruction-following chat assistant is blocked until the application can obtain machine-parseable JSON that conforms to a declared response schema. The tester will verify that responses can be validated against the application's schema. What should be implemented?

  1. Use a system or developer instruction
  2. Add a few-shot example to the prompt
  3. Adjust the temperature parameter
  4. Request a supported structured response format
  5. Set an output token limit

Explanation

Correct Answer

D:

Structured-output features constrain compatible model responses to a specified schema when available. For this instruction-following chat assistant, the intended evidence is that responses can be validated against the application's schema. Merely lowering temperature does not enforce object properties or valid JSON syntax.

Incorrect Answers

A:

Higher-priority instructions steer model behavior across user turns subject to the API's instruction hierarchy; it may be used to establish high-priority rules for a model's role, behavior, and response boundaries in a instruction-following chat assistant, but the current requirement is instead to obtain machine-parseable JSON that conforms to a declared response schema. That separate capability does not prove that responses can be validated against the application's schema; They do not grant the model permissions to private APIs or guarantee compliance against every attack, so selecting that alternative would not meet the stated acceptance check.

B:

Few-shot prompting demonstrates desired transformations through examples in the model's context; it may be used to show the model representative input-output examples for an unfamiliar formatting task in a instruction-following chat assistant, but the current requirement is instead to obtain machine-parseable JSON that conforms to a declared response schema. That separate capability does not prove that responses can be validated against the application's schema; It does not update model weights or store examples permanently after the context is discarded, so selecting that alternative would not meet the stated acceptance check.

C:

Temperature controls token-sampling randomness for supported generation models and endpoints; it may be used to reduce random variation across repeated generations when the deployed API supports it in a instruction-following chat assistant, but the current requirement is instead to obtain machine-parseable JSON that conforms to a declared response schema. That separate capability does not prove that responses can be validated against the application's schema; It does not control request authentication or force unsupported model output formats, so selecting that alternative would not meet the stated acceptance check.

E:

The generation limit caps permitted completion tokens and can control output length and resource use; it may be used to bound the number of generated output tokens from a model request in a instruction-following chat assistant, but the current requirement is instead to obtain machine-parseable JSON that conforms to a declared response schema. That separate capability does not prove that responses can be validated against the application's schema; It does not determine the number of documents returned by Azure AI Search, so selecting that alternative would not meet the stated acceptance check.

Question 174

A retrieved document claims it is a new system message. How should the prompt assembly handle that text?

  1. Inspect the selected model's supported sampling parameters and omit unsupported ones
  2. Delimit retrieved content as untrusted evidence instead of promoting it to an instruction role
  3. Declare all required fields in the supported structured-output schema
  4. Separate example cases from held-out evaluation questions

Explanation

Correct Answer

B:

The role hierarchy distinguishes application instructions from third-party source material, limiting prompt injection risk. In the instruction-following chat assistant, confirm the fix by retesting the affected behavior after delimiting retrieved content as untrusted evidence instead of promoting it to an instruction role.

Incorrect Answers

A:

Although useful elsewhere in the instruction-following chat assistant, generation controls vary by model and API; a universal temperature setting is not valid for all deployments; the present case is different and calls for the team to delimit retrieved content as untrusted evidence instead of promoting it to an instruction role.

C:

That change addresses another failure mode: jSON validity alone does not ensure completeness; required properties define the application's contract; it does not address this case, for which the relevant intervention is to delimit retrieved content as untrusted evidence instead of promoting it to an instruction role.

D:

Leaking test examples into prompt demonstrations inflates measured quality and fails to test generalization in its own workflow, but that is a different correction from the present requirement to delimit retrieved content as untrusted evidence instead of promoting it to an instruction role. The reported issue would remain.

Question 175

Examples in the prompt include the test question's exact answer and evaluation scores look perfect. What is the flaw?

  1. Declare all required fields in the supported structured-output schema
  2. Distinguish input context-window constraints from output-token limits
  3. Separate example cases from held-out evaluation questions
  4. Inspect the selected model's supported sampling parameters and omit unsupported ones

Explanation

Correct Answer

C:

Leaking test examples into prompt demonstrations inflates measured quality and fails to test generalization. In the instruction-following chat assistant, confirm the fix by retesting the affected behavior after separating example cases from held-out evaluation questions.

Incorrect Answers

A:

Although useful elsewhere in the instruction-following chat assistant, jSON validity alone does not ensure completeness; required properties define the application's contract; the present case is different and calls for the team to separate example cases from held-out evaluation questions.

B:

Limiting generation length does not necessarily make oversized prompt input fit a model's context window in its own workflow, but that is a different correction from the present requirement to separate example cases from held-out evaluation questions. The reported issue would remain.

D:

That change addresses another failure mode: generation controls vary by model and API; a universal temperature setting is not valid for all deployments; it does not address this case, for which the relevant intervention is to separate example cases from held-out evaluation questions.

Question 176

A model returns valid JSON with missing mandatory fields. Which response contract is needed?

  1. Declare all required fields in the supported structured-output schema
  2. Inspect the selected model's supported sampling parameters and omit unsupported ones
  3. Distinguish input context-window constraints from output-token limits
  4. Separate example cases from held-out evaluation questions

Explanation

Correct Answer

A:

JSON validity alone does not ensure completeness; required properties define the application's contract. In the instruction-following chat assistant, confirm the fix by retesting the affected behavior after declaring all required fields in the supported structured-output schema.

Incorrect Answers

B:

Although useful elsewhere in the instruction-following chat assistant, generation controls vary by model and API; a universal temperature setting is not valid for all deployments; the present case is different and calls for the team to declare all required fields in the supported structured-output schema.

C:

That change addresses another failure mode: limiting generation length does not necessarily make oversized prompt input fit a model's context window; it does not address this case, for which the relevant intervention is to declare all required fields in the supported structured-output schema.

D:

Leaking test examples into prompt demonstrations inflates measured quality and fails to test generalization in its own workflow, but that is a different correction from the present requirement to declare all required fields in the supported structured-output schema. The reported issue would remain.

Question 177

A client demands exact property types but relies only on an instruction saying “reply in JSON.” What should change?

  1. Repeat evaluations across a representative dataset and track output variability
  2. Include representative normal cases and relevant edge cases without contaminating evaluation data
  3. Use a supported schema-constrained output mechanism rather than prose-only formatting requests
  4. Version and test the shared application instruction template

Explanation

Correct Answer

C:

Prompt wording can encourage JSON but cannot enforce the same guarantees as supported structured outputs. In the instruction-following chat assistant, confirm the fix by retesting the affected behavior after using a supported schema-constrained output mechanism rather than prose-only formatting requests.

Incorrect Answers

A:

Although useful elsewhere in the instruction-following chat assistant, sampling controls cannot replace empirical robustness testing, especially when infrastructure and model versions evolve; the present case is different and calls for the team to use a supported schema-constrained output mechanism rather than prose-only formatting requests.

B:

That change addresses another failure mode: diverse examples clarify intended behavior across boundaries, not just the easiest input pattern; it does not address this case, for which the relevant intervention is to use a supported schema-constrained output mechanism rather than prose-only formatting requests.

D:

Prompt rules are code-like behavior controls; versioning allows reproducible evaluations and rollbacks in its own workflow, but that is a different correction from the present requirement to use a supported schema-constrained output mechanism rather than prose-only formatting requests. The reported issue would remain.

Question 178

An Azure OpenAI integration requires a strict JSON object with a fixed set of keys and no undeclared properties. The chosen model and API support structured outputs. Which THREE implementation requirements apply? (Choose THREE.)

  1. Mark every field required under the supported structured-output schema rules
  2. Keep the behavioral constraint in a high-priority system or developer instruction
  3. Clearly delimit demonstration input and output pairs from the live user data
  4. Check the finish reason and configured maximum output-token allowance
  5. Disable extra object properties with `additionalProperties: false`
  6. Supply a supported structured-output schema through the model API

Explanation

Correct Answers

A:

Structured outputs require the schema's defined fields to appear in the required list, with nullable unions used where optional semantics are needed.

E:

Rejecting additional properties within the supported schema prevents undeclared keys from breaking downstream parsers that expect a fixed contract.

F:

Schema-constrained output is an API-level format control and offers stronger adherence than asking the model in plain prose to return valid JSON.

Incorrect Answers

B:

Application policy should not be placed solely in lower-priority user content that can contradict or replace it in its own workflow, but that is a different correction from the present requirement to supply a supported structured-output schema through the model API and mark every field required under the supported structured-output schema rules and disable extra object properties with `additionalProperties: false`. The reported issue would remain.

C:

That change addresses another failure mode: few-shot examples can be mistaken for active content unless their boundaries and role are explicit; delimiting reduces accidental exemplar leakage; it does not address this case, for which the relevant intervention is to supply a supported structured-output schema through the model API and mark every field required under the supported structured-output schema rules and disable extra object properties with `additionalProperties: false`.

D:

Although useful elsewhere in the instruction-following chat assistant, a length-related stop indicates an output budget may have truncated generation; increasing request retries alone does not resolve it; the present case is different and calls for the team to supply a supported structured-output schema through the model API and mark every field required under the supported structured-output schema rules and disable extra object properties with `additionalProperties: false`.

Question 179

In an instruction-following chat assistant, engineers must reduce random variation across repeated generations when the deployed API supports it. The expected evidence is that comparable prompts show less stochastic variation. Which implementation is the best match?

  1. Use a system or developer instruction
  2. Add a few-shot example to the prompt
  3. Request a supported structured response format
  4. Adjust the temperature parameter

Explanation

Correct Answer

D:

Temperature controls token-sampling randomness for supported generation models and endpoints. For this instruction-following chat assistant, the intended evidence is that comparable prompts show less stochastic variation. It does not control request authentication or force unsupported model output formats.

Incorrect Answers

A:

Higher-priority instructions steer model behavior across user turns subject to the API's instruction hierarchy; it may be used to establish high-priority rules for a model's role, behavior, and response boundaries in a instruction-following chat assistant, but the current requirement is instead to reduce random variation across repeated generations when the deployed API supports it. That separate capability does not prove that comparable prompts show less stochastic variation; They do not grant the model permissions to private APIs or guarantee compliance against every attack, so selecting that alternative would not meet the stated acceptance check.

B:

Few-shot prompting demonstrates desired transformations through examples in the model's context; it may be used to show the model representative input-output examples for an unfamiliar formatting task in a instruction-following chat assistant, but the current requirement is instead to reduce random variation across repeated generations when the deployed API supports it. That separate capability does not prove that comparable prompts show less stochastic variation; It does not update model weights or store examples permanently after the context is discarded, so selecting that alternative would not meet the stated acceptance check.

C:

Structured-output features constrain compatible model responses to a specified schema when available; it may be used to obtain machine-parseable JSON that conforms to a declared response schema in a instruction-following chat assistant, but the current requirement is instead to reduce random variation across repeated generations when the deployed API supports it. That separate capability does not prove that comparable prompts show less stochastic variation; Merely lowering temperature does not enforce object properties or valid JSON syntax, so selecting that alternative would not meet the stated acceptance check.

Question 180

The team reduces completion tokens but still receives context-window errors on very large prompts. Which limit was confused?

  1. Inspect the selected model's supported sampling parameters and omit unsupported ones
  2. Separate example cases from held-out evaluation questions
  3. Declare all required fields in the supported structured-output schema
  4. Distinguish input context-window constraints from output-token limits

Explanation

Correct Answer

D:

Limiting generation length does not necessarily make oversized prompt input fit a model's context window. In the instruction-following chat assistant, confirm the fix by retesting the affected behavior after distinguishing input context-window constraints from output-token limits.

Incorrect Answers

A:

Although useful elsewhere in the instruction-following chat assistant, generation controls vary by model and API; a universal temperature setting is not valid for all deployments; the present case is different and calls for the team to distinguish input context-window constraints from output-token limits.

B:

Leaking test examples into prompt demonstrations inflates measured quality and fails to test generalization in its own workflow, but that is a different correction from the present requirement to distinguish input context-window constraints from output-token limits. The reported issue would remain.

C:

That change addresses another failure mode: jSON validity alone does not ensure completeness; required properties define the application's contract; it does not address this case, for which the relevant intervention is to distinguish input context-window constraints from output-token limits.

Designing and Implementing a Microsoft Azure AI Solution (AI-102) Practice Tests