What is few-shot prompting?
- Exam domain
- Generative AI and large language models
- Difficulty
- Medium
- In this mock
- 5 questions on this domainPractise this domain
Why B is the answer
Putting a few input and output examples in the prompt
Few-shot prompting shows the model a handful of worked examples inside the prompt, so it copies the pattern for the new input. The model's weights do not change.
Remember: Few-shot: examples in the prompt.
In detail
- Examples live in the prompt.
- No training and no weight changes.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Retrieving a few documents from a vector storeWrong
Retrieval adds facts, not worked examples of the task.
B. Putting a few input and output examples in the promptRight
Few-shot: examples in the prompt.
C. Fine-tuning the model on a few thousand labelled examplesWrong
Fine-tuning changes the weights; few-shot prompting does not.
D. Lowering the temperature to a few tenthsWrong
Temperature controls randomness, not examples.
Use case
An illustrative scenario, not a real incident.
Illustrative: a support team adds three example ticket summaries to the prompt, and every new summary follows the same layout.
See it in different ways
flowchart TD
Q{"What needs to change?"}
Q -->|"Instructions or format"| A0["Prompt engineering"]
Q -->|"Facts that change"| A1["Retrieval RAG"]
Q -->|"Consistent style or task behaviour"| A2["Fine-tuning"]How to read this chart
- At "What needs to change?": if "Instructions or format", go to "Prompt engineering"; if "Facts that change", go to "Retrieval RAG"; if "Consistent style or task behaviour", go to "Fine-tuning".
flowchart LR S0["Instruction"] --> S1["Example 1"] --> S2["Example 2"] --> S3["New input"] --> S4["Model answer"]
How to read this chart
- Read it in order: Instruction, then Example 1, then Example 2, then New input, then Model answer.