# How should I select and test few-shot examples for an ambiguous Claude task?

Exam: CCAR-F — Claude Certified Architect - Foundations (CCAR-F)
Knowledge domain: Prompt Engineering & Structured Output
Updated: 2026-12-04T01:16:39.32702+00:00
HTML: https://learningpathx.com/faq/CCAR-F/ccarf-few-shot-example-set.html

## Also asked as

- Which examples help Claude learn a decision boundary without copying unrelated facts?
- How do I check whether a Claude few-shot example set generalizes to new inputs?

Select verified input/output pairs that demonstrate the task's decision rules, including a plausible alternative that should receive a different answer and an appropriate missing-information outcome. Keep every example consistent with the current policy and output contract, then evaluate new inputs that were not demonstrations.

For a reviewer allowed to flag null dereferences, contrast a function that receives permitted null and fails with one whose actual caller excludes null. The same string-method syntax can be valid in the second case. Show the relevant caller premise and expected finding or no-finding result rather than teaching a syntax-based alarm. For extraction, vary layout and wording while preserving units, approximation and missing values.

Separate instructions, demonstrations and the target input. Examples can teach tone or structure; their names, prices, dates or contact details must not become facts about the new target. Use complete outputs with the fields the consumer actually expects.

When a static set becomes unwieldy, retrieve examples from a verified collection. Check task, policy and schema compatibility, remove near-duplicates, and handle an empty or conflicting selection explicitly. Similar wording alone does not make a demonstration suitable.

Compare the baseline and revised prompt on the same held-out cases. Check decisions, required fields, unsupported values and uncertainty handling, including unfamiliar layouts. Evaluate example retrieval as well as generation. Expand the set to address observed gaps; an example count alone cannot establish adequate coverage.

[Claude prompting guidance on examples](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#use-examples-effectively) · [Evaluation design](https://platform.claude.com/docs/en/test-and-evaluate/develop-tests)

Source: [Apply few-shot prompting to improve output consistency and quality](https://learningpathx.com/material/CCAR-F/apply-few-shot-prompting-to-improve-output-consistency-and-quality.html)
