A downstream service parses model replies as JSON, and about one reply in twenty breaks the parser. Which prompt change helps most?
- Exam domain
- Foundation Model Integration, Data Management, and Compliance31% of the exam
- Difficulty
- Medium
- In this mock
- 28 questions on this domainPractise this domain
Why the exam asks this
Task 1.6: Implement prompt engineering strategies and governance for FM interactions.
Objective in the exam guide: Skill 1.6.5: Enhance FM performance to refine prompts iteratively and improve response quality beyond basic prompting techniques (for example, by using structured input components, output format specifications, chain-of-thought instruction patterns).
Integrations break on one malformed reply in twenty. Reliable structured output is a daily need for developers wiring models into systems.
Why C is the answer
Specify the exact output schema with an example, and validate each reply against it
An explicit output format with an example, plus validation, makes structured output reliable.
Remember: Specify the format, show an example, validate every reply.
How it works
Models follow formats better when the prompt states the exact structure and shows an example of a correct reply.
Even then, a small share can drift, so the application validates each reply against the schema.
Invalid replies are retried or handled, instead of breaking the downstream service.
Clues in the question
The words that point to the answer, and what each one tells you.
- Parses model replies as JSON
- Strict structure is required.
- One reply in twenty breaks
- Mostly right; tighten and validate.
In detail
- Output format specifications and structured input are prompt techniques the exam guide lists.
- Validation catches the remaining failures so they can be retried.
Side by side with look-alikes
| Change | Fixes inconsistent JSON? |
|---|---|
| Schema, example and validation | Yes |
| More creativity | No, worse |
| Longer output | Only if truncation is the cause |
| No system prompt | No, worse |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Raise the maximum output lengthWrongMost tempting
Length is not the cause unless replies are cut off.
Why it tempts: Truncated JSON does break parsers, so it is a real cause in some cases. But nothing here says replies are cut off; the format itself is inconsistent.
B. Remove the system promptWrong
Removing instructions makes the format less predictable.
C. Specify the exact output schema with an example, and validate each reply against itRight
Specify the format, show an example, validate every reply.
D. Ask the model to be more creativeWrong
Creativity makes formatting less consistent.
In practice
- Log every validation failure with the reply, to refine the prompt.
- Retry once on failure, then fall back to a safe error.
Use case
An illustrative scenario, not a real incident.
A team adds a JSON schema and one sample reply to the prompt, validates each response, and retries the rare failure once.
See how it works
flowchart LR
P["Prompt with schema and example"] --> M["Model"]
M --> V{"Valid against the schema?"}
V -->|"Yes"| D["Downstream service"]
V -->|"No"| R["Retry once, then safe error"]How to read this chart
- "Prompt with schema and example" leads to "Model".
- "Model" leads to "Valid against the schema?".
- At "Valid against the schema?": if "Yes", go to "Downstream service"; if "No", go to "Retry once, then safe error".