Course menuAIP-C01

Exams / AIP-C01 / Prompt engineering techniques (few-shot, chain-of-thought, structured output) / Question 1

AIP-C01 practice question: Prompt engineering techniques (few-shot, chain-of-thought, structured output)

Foundation Model Integration, Data Management, and Compliance A free question from our original AIP-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A third-party logistics company receives thousands of shipping emails a day from carriers. A model must read each email and return one exception code from a fixed list of 14 codes, such as DAMAGED_IN_TRANSIT or ADDRESS_NOT_FOUND, so the warehouse system can route the case.

The model's current output sometimes adds an explanation, sometimes uses a label that is not on the list, and sometimes writes the code in a different case. The warehouse system rejects every such reply.

The fix must go live the same day, with no training job, and it must keep latency low.

Which change meets these requirements?

Choose one answer.

  1. A. Ask the model to reason step by step and write a short explanation of its choice before giving the code on the last line, so that the format is more careful and the code is easier to check.
  2. B. Add three to five worked examples to the prompt, each showing a realistic email and the exact code it should produce, including one edge case and the required uppercase format.
  3. C. Raise the temperature setting so that the model considers more labels for each email, which gives it more options to match an unusual message to a code on the list.
  4. D. Fine-tune a model on 50,000 labeled emails, so that it learns the code format from the training data, and deploy the new model after the training job finishes.
Show the answer and explanation

Answer: B

  • A. Wrong: Reasoning text adds output tokens and latency, and it does not stop the model from writing a label that is not on the list. The reply would still be rejected by the warehouse system, so the format requirement is missed.
  • B. Right: Few-shot examples show the model the exact output pattern, which makes the reply format far more consistent. The change is only a prompt edit, so it goes live the same day with no added latency.
  • C. Wrong: A higher temperature adds randomness to the output, which makes format errors more likely, not less. It does nothing to enforce the fixed list of codes.
  • D. Wrong: Fine-tuning can improve format consistency, but it needs a labeled dataset and a training job that cannot finish the same day. The team also has no time to wait for a training cycle, so this misses the go-live requirement.

Explanation

Few-shot examples show the exact output pattern, including the uppercase codes and an edge case, and they change only the prompt, so the fix goes live the same day with no added latency. Step-by-step reasoning adds latency without fixing the format, higher temperature adds randomness, and fine-tuning cannot finish on this timeline.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Prompt engineering techniques (few-shot, chain-of-thought, structured output)? The 5 full-length practice sets have 5 more Prompt engineering techniques (few-shot, chain-of-thought, structured output) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets