CCA Prep Studio
—

Task 4.2 · Domain 4: Prompt Engineering & Structured Output

Few-shot prompting

When detailed instructions still produce inconsistent output, a few well-chosen examples usually fix it. Few-shot examples lock in format, demonstrate how to handle ambiguous cases, and let the model generalize that judgment to patterns it has not seen. In extraction they also reduce hallucination on unusual inputs.

Updated 10-20-2026 · Official guide §6, Task 4.2

Key points

  • Few-shot examples are the most effective technique for consistently formatted, actionable output when instructions alone fall short.
  • Examples demonstrate ambiguous-case handling, such as tool selection for unclear requests or whether a branch counts as a coverage gap.
  • Good examples let the model generalize judgment to novel patterns rather than only matching the cases shown.
  • In extraction, examples reduce hallucination on informal measurements and varied document structures.
  • Two to four targeted examples, each with the reasoning for the chosen action, are usually enough.

Skills the exam expects

  • Create 2-4 examples for ambiguous scenarios that show why one action beat plausible alternatives.
  • Demonstrate the exact output format (location, issue, severity, suggested fix).
  • Pair acceptable code patterns with genuine issues to cut false positives while keeping generalization.
  • Show correct extraction across document layouts (inline citations vs bibliographies, methodology sections vs embedded details).
  • Use examples to fix empty or null required fields in extraction.

Common misconceptions

  • "More examples are always better." A handful of targeted, ambiguous cases beats a pile of easy ones.
  • "Telling the model not to hallucinate works as well as showing it." Demonstration teaches handling; prohibition does not.
  • "Examples only teach the exact cases shown." They are chosen so the model generalizes.

Watch for

  • A third page of instructions when two pages have already failed.
  • Examples that only cover obvious cases and leave the ambiguity unaddressed.
  • Fixing empty fields with retries when the real gap is unseen document layouts.

Practice task 4.2

56 practice items cover this task in CCA Prep Studio: flashcards, matching, scenario questions and explain-it-back exercises, each tracked toward your mastery score.

CCA Prep Studio is an independent study product. It is not made, endorsed or sponsored by Anthropic. Claude is a trademark of Anthropic, PBC, and is used here only to name the exam and the technology it covers. Content is written in our own words and cites the official exam guide; no exam questions are reproduced. © 2026 NovaLinQs AI, LLC.