AIF-C01 - Prompt engineering and evaluation (16% of the exam) - Section 4.1

Choose effective prompt engineering techniques.

Apply zero-shot, few-shot, and chain-of-thought prompting, and understand how clear instructions, examples, and output formats improve results. Match a technique to a task.

Few-shot promptingChain-of-thoughtPrompt templates

Practice question for this objective

Free samplePrompt engineering and evaluationmedium

A developer needs a foundation model to label support tickets using a niche internal scheme of five status codes. A plain instruction that lists the five codes still produces free-text summaries and invented codes instead of the exact labels. No training data is available to fine-tune. Which prompt engineering technique most directly teaches the model the precise output the team wants?

  • AAdd a few worked examples to the prompt, each pairing a sample ticket with its correct status code, so the model infers the exact output format from the demonstrations. Correct
  • BRaise the temperature so the model explores a wider range of possible status codes before committing to one of the five.
  • CIncrease the maximum output token limit so the model has enough room to write out the full status code rather than truncating it.
  • DMove the model to a larger context window so the entire list of five status codes fits inside a single request alongside the ticket.
Few-shot prompting teaches a model a bespoke output format by including worked input-to-output examples directly in the prompt. Foundation models perform in-context learning: when the prompt contains demonstrations pairing inputs with their correct outputs, the model generalises the pattern and reproduces the exact label format, which a bare instruction listing the codes often fails to convey.

Why A is correct: Correct: few-shot prompting supplies in-context examples that show the model the precise input-to-label mapping, which is the most direct way to pin down a bespoke output format without fine-tuning.

Why B is wrong: Tempting because sampling settings feel like an obvious lever, but a higher temperature increases variety and would make the model more likely to invent codes, not less, so it works against the goal of exact labels.

Why C is wrong: Plausible because token limits do cause truncation, but the problem is the model choosing the wrong content, not running out of space, so raising the limit does nothing to enforce the five-code scheme.

Why D is wrong: Tempting because context window is a real selection criterion, but five short codes and one ticket already fit comfortably, so a larger window addresses a capacity problem that does not exist here.

See more AIF-C01 practice questions, answers explained.

Exam traps in Prompt engineering and evaluation

Answers that look right on this material and are not. Each one is a distractor from a different question in the AIF-C01 bank for this domain.

  • Few-shot examples can only be used when fine-tuning data is unavailable, and this application has not confirmed whether labelled data exists.

    Why it is wrong: Tempting because few-shot and fine-tuning both adapt behaviour, but few-shot does not depend on the absence of fine-tuning data; the technique is available regardless, so this is not the real constraint.

  • A chain-of-thought prompt instructing the model to reason about each field before writing the output.

    Why it is wrong: Chain-of-thought produces verbose reasoning text before the answer, which complicates downstream parsing unless the reasoning is stripped out; it does not directly enforce a parseable schema.

  • Reduce the maximum token limit so the model is forced to use simpler vocabulary.

    Why it is wrong: Capping tokens constrains length but does not steer tone; the model can produce formal, technical language in very few tokens if that remains its dominant pattern.

More in this domain

Back to all Prompt engineering and evaluation objectives, or the AIF-C01 cert hub.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.