Zero-shot and Few-shot Prompting
Prompting techniques - zero-shot gives the task without examples, few-shot includes sample inputs and outputs for better results.
What is zero-shot and few-shot prompting?
These terms describe how many example samples you include in a prompt to help the model understand what you want.
Zero-shot prompting
You give the model a task with no examples and rely on its pre-trained capabilities. Works well for general tasks the model knows well.
Example: "Translate the following text into English: [text]"
Few-shot prompting
You include 2–5 sample input-output pairs in the prompt. The model learns the required pattern from them and applies it to new input. Significantly improves results for specific or non-standard formats.
Example: You show the model 3 examples of how to extract data from an email, then let it process a new email.
One-shot prompting
A variant of few-shot with a single example - suitable when you have limited space in the context window.