AIF-C01 practice question: Prompt engineering (1 of 4)
Applications of Foundation Models A free question from our original AIF-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.
A hotel group wants a model to sort guest comments into room, food or staff.
The developer places three example comments, each with its correct category, in the prompt before the new comment, and does not change any model weights.
What is this technique called?
Choose one answer.
AA. Zero-shot prompting, where the model receives the task with no examples
BB. Few-shot prompting, with a small number of labeled examples in the prompt
CC. Fine-tuning, which updates the model's weights on labeled comment data
DD. Prompt caching, which reuses a repeated prompt prefix to cut cost
Show the answer and explanation
Answer: B
A. Wrong: Zero-shot prompting gives the task with no examples at all. This prompt includes three labeled examples, so it is not zero-shot.
B. Right: Correct. Few-shot prompting, also called in-context learning, includes a few example input and output pairs in the prompt. The model picks up the pattern without any change to its weights. Learn more: Prompt engineering concepts (opens in a new tab)
C. Wrong: Fine-tuning changes model weights using labeled data, which the developer explicitly did not do. The examples here are placed in the prompt instead.
D. Wrong: Prompt caching reuses an unchanging prompt prefix to save time and cost. It does not teach the model a classification pattern from examples.
Explanation
In prompt engineering, a shot is one example input paired with the desired output. Zero-shot gives no examples and few-shot gives a few. AWS's prompt engineering guidance describes few-shot prompting as also known as in-context learning, and the model's weights stay unchanged.
Want more on Prompt engineering? The 5 full-length practice sets have 20 more Prompt engineering questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →