AITraining2U

Programs

Resources

Case Studies

Quick Links

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

Replace prefill and legacy sampling parameters

Update habits that current models reject or ignore.

Two once-standard techniques no longer apply the way older material teaches them: assistant prefill, and hand-tuning temperature alongside top_p or top_k. Build the modern equivalents so you answer from current behaviour rather than old blog posts.

What to build

  1. Take a prompt that historically used assistant prefill to force a format.
  2. Reimplement the format guarantee with a schema instead.
  3. Reimplement any tone or persona steering in the system prompt.
  4. Attempt a request that sets temperature together with top_p and record the API's response.
  5. Rewrite it to use only the parameters current models accept.
  6. Note which of your existing prompts would break on a current model.

Done when

  • No prompt in your set relies on prefill for structure.
  • You have seen the actual error from an unsupported parameter combination, not a description of it.
  • Determinism needs are met structurally rather than by lowering temperature.
  • You can explain what replaced each deprecated technique.

The trap this exercise teaches

Carrying over sampling advice from older documentation. On current models, combining these parameters is rejected rather than quietly ignored.

Before you start

The theory behind this build is covered in Prefill removal and its replacements. If any step below is unfamiliar, read that first — the exercise assumes it. Primary source: Claude Docs — Messages API.

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.