Prompt Design Strategies
Few-Shot Examples
Explore zero-shot vs few-shot prompting, and how to use examples to teach the model desired output patterns and styles.
You can guide the model by including examples in your prompt that demonstrate the ideal response. The model learns from these examples by recognizing patterns and structures, then applies that understanding to generate its own output. Prompts with a few examples are known as few-shot prompts, while those with none are called zero-shot prompts. Few-shot prompts are particularly useful for shaping the tone, format, scope, and overall structure of the model’s replies. Using clear, diverse examples helps the model stay focused and deliver more accurate results.
It’s generally best to include a few examples in your prompt. Without them, the model’s responses may be less precise. In fact, if your examples are well-chosen and illustrative, you may not even need additional instructions at all.
Response:
If your goal is to get brief responses from the model, you can add examples in your prompt that highlight concise answers.
In the next prompt, two sample explanations are given, showing a clear preference for shorter responses. As a result, the model is influenced by these examples and selects the more concise explanation (Explanation 2), unlike the earlier case where it chose the longer one (Explanation 1).
Example Prompt:
Response:
✅ Positive pattern: