Prompting Technique Selection: Worked Example — Claude Models, Prompting, and Context Engineering (Claude Certified Architect - Professional)
Prompting Technique Selection — Worked Example In the Claude Certified Architect - Professional exam, one critical skill is selecting the appropriate...
Prompting Technique Selection — Worked Example
In the Claude Certified Architect - Professional exam, one critical skill is selecting the appropriate prompting technique to address observed failures in AI output while balancing token cost and system constraints. This worked example demonstrates a step-by-step approach to choosing the best prompting technique for a realistic scenario using Anthropic's Claude platform features.
Scenario Description
An enterprise AI assistant built on Claude is tasked with summarizing lengthy technical documents into concise bullet points. The current zero-shot prompt yields inconsistent summaries: some are too verbose, others omit critical details. The client wants improved consistency and relevance without significantly increasing token usage or latency.
Step 1: Diagnose the Failure
The zero-shot prompt's underspecification allows the model to vary output length and detail level. This leads to inconsistent summaries because the model is not explicitly guided on format or content scope.
Step 2: Evaluate Prompting Technique Options
- Zero-shot prompting: Current approach, inconsistent results.
- Few-shot prompting: Provide examples of ideal summaries to guide output.
- Prompted reasoning: Use step-by-step instructions to encourage structured summarization.
- Native extended thinking: Leverage Claude's extended context capabilities to process longer documents in one call.
- Structured output: Request output in a strict JSON or bullet-point format to constrain variation.
Step 3: Consider Token Cost and Latency Constraints
Few-shot prompting increases token usage due to example inclusion. Prompted reasoning may increase latency because of multi-step instructions. Native extended thinking requires a higher-tier Claude model with larger context windows, which may increase cost. Structured output constraints add minimal token overhead but require careful prompt design.
Step 4: Select the Prompting Technique
Given the need for consistent, relevant summaries with controlled token cost, the architect chooses a few-shot prompting approach combined with structured output. This balances improved output quality and format control while limiting token increase by using concise examples and a clear output schema.
Step 5: Design the Revised Prompt
The revised prompt includes:
- Two concise example summaries illustrating desired brevity and detail.
- A clear instruction to output bullet points only.
- A system prompt that constrains scope and format without over-constraining legitimate variation.
Step 6: Test and Iterate
Run evaluation calls using the Claude API with the revised prompt. Monitor output consistency, token usage, and latency. Adjust example length or number if token cost is too high, or refine instructions if output variation persists.
Worked Example Summary
Problem: Inconsistent summaries from zero-shot prompting.
Analysis: Underspecified prompt causes output variation.
Options considered: Zero-shot, few-shot, prompted reasoning, native extended thinking, structured output.
Decision: Few-shot prompting with structured output to improve consistency and relevance within token and latency constraints.
Implementation: Include two concise examples and clear bullet-point instructions in the system prompt.
Outcome: More consistent, relevant summaries with controlled token cost.
Conclusion
This example illustrates how a Claude Certified Architect - Professional candidate should systematically evaluate prompting techniques against workload constraints and observed failures. By reasoning from prompt underspecification and token economics, the architect selects a solution that balances quality, cost, and latency using Anthropic Claude platform capabilities.
More in this topic
Preparing for the Claude Certified Architect Professional exam?
Start free with 5 practice quizzes a day and track your progress.
Practise Claude Certified Architect Professional questions free →