Question 19
Domain 3A structured data extraction pipeline processes legal contracts. 15% of contracts use non-standard date formats that cause schema validation failures. The retry loop sends back "Invalid date format." How should the retry prompt be improved?
Correct answer: C
Explanation
The retry prompt should identify the specific validation issue so the model can fix it, not just say "Invalid date format." Including the exact field, the expected format "ISO 8601: YYYY-MM-DD," the returned value, and an example conversion gives actionable constraints for regeneration. This targets the schema failure and reduces repeated errors.
Why each option is right or wrong
A. Increase max_retries from 3 to 10
More retries repeat the same vague instruction and usually do not fix the root formatting issue.
B. Remove the date field from the schema and process dates separately
Removing the field weakens schema quality instead of teaching the model how to produce valid dates.
C. Include in the retry: the exact field that failed, the expected format (ISO 8601: YYYY-MM-DD), the value Claude returned, and an example conversion
The retry message needs to be specific enough to correct the exact schema violation, because a generic “Invalid date format” does not tell the model which field failed or what representation the validator requires. In this pipeline, the prompt should name the failing field, state the required ISO 8601 pattern as YYYY-MM-DD, quote the value that was produced, and show a concrete conversion example so the regeneration is constrained to the accepted contract schema.
D. Switch to a few-shot approach with date format examples in the initial prompt
Few-shot examples can help initially, but they do not target the specific failed field during retry.