AITraining2U

Programs

Resources

Case Studies

Quick Links

Enquire Now
Core Domain 3 · Prompt Engineering & Structured Output ~40 min

Build a production prompt with XML structure and few-shot examples

Make a prompt legible to the model and maintainable by you.

Long production prompts fail on structure before they fail on wording. Build a classifier prompt with clearly delimited sections, then improve it by example selection rather than by adding adjectives.

What to build

  1. Write a system prompt that assigns a role and states explicit success criteria.
  2. Use XML tags to delimit instructions, examples, and the input document.
  3. Add three few-shot examples covering the boundary cases, not the obvious ones.
  4. Build a twenty-item labelled evaluation set before you start tuning.
  5. Measure baseline accuracy, then change one thing at a time and re-measure.
  6. Try moving the examples relative to the instructions and record the effect.

Done when

  • Every prompt change is scored against the same evaluation set.
  • You improved accuracy by changing examples rather than by adding emphasis.
  • The document is unambiguously delimited from the instructions.
  • Success criteria are explicit enough that you could grade outputs by them yourself.

If you want to go further

  • Add a deliberately adversarial input to the eval set and see whether structure holds.

The trap this exercise teaches

Tuning by vibes. Without a scored eval set, prompt iteration is a random walk that feels like progress.

Before you start

The theory behind this build is covered in Structuring complex prompts with XML tags. If any step below is unfamiliar, read that first — the exercise assumes it. Primary source: Claude Docs — Prompt engineering.

Check yourself against the exam

This exercise sits in Domain 3, which is 20% of the CCAR‑F exam. Once you have built it, run a domain drill in the study app and see whether the questions read differently.