CCAO-F Prompting and Context Engineering Practice Question
An analytics team asks Claude to extract structured fields from messy invoice text. They provide three input/output examples inside <examples> tags, then the real invoice inside <invoice> tags. Accuracy is high on invoices that resemble the examples but drops sharply on unusual layouts. Which adjustment most directly improves generalization to the unusual layouts?
⚠ Common exam trap
The trap here is reaching for a sampling parameter such as temperature when the failure pattern clearly points to non-representative few-shot examples.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Add more examples that cover diverse invoice layouts, including edge cases, inside the examples block.
Few-shot learning generalizes in proportion to how representative the demonstrations are. When Claude performs well on inputs that resemble the examples and poorly on inputs that do not, the examples are too homogeneous. Expanding the demonstration set to include diverse and edge-case layouts teaches the task itself instead of a single pattern, which is the most direct fix for the observed failure on unusual invoices.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Raise the temperature so Claude explores more varied interpretations of each invoice.
Why it's wrong here
Higher temperature increases sampling randomness, which for a structured extraction task typically increases errors and inconsistent field formatting. It does not add knowledge about unusual layouts; it just makes outputs less predictable. The problem is coverage in the examples, not determinism, so loosening sampling will likely worsen accuracy on edge cases rather than fix it.
- ✓
Add more examples that cover diverse invoice layouts, including edge cases, inside the examples block.
Why this is correct
Few-shot performance depends on how well the examples span the input distribution. When accuracy collapses on unusual layouts, the examples are too narrow, so the model overfits to the demonstrated pattern. Broadening the examples to include atypical layouts, missing fields, and edge cases teaches Claude the underlying extraction task rather than a single template, which is precisely what improves generalization here.
- ✗
Move the examples block after the invoice so Claude reads the real input first.
Why it's wrong here
Reordering examples after the input does not expand the model's understanding of layout diversity; it only changes reading order. With the same narrow examples, Claude still has no signal about edge cases. Placement can matter for attention, but it cannot substitute for representative examples when the failure is generalization to unseen formats.
- ✗
Shorten each example to only the input and the final JSON, removing any intermediate reasoning text.
Why it's wrong here
Trimming examples reduces the signal Claude can learn from, especially if intermediate steps clarified how fields were located. It also does nothing to address the missing coverage of unusual layouts, which is the actual cause of the accuracy drop. Removing detail from already-narrow examples makes generalization harder, not easier, for this scenario.
About these practice questions
One of 259 original CCAO-F practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCAO-F practice question is part of Courseiva's free Anthropic 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 CCAO-F exam.