Lesson 5. Few-shot prompting and working with examples
If you're searching for 'what is few-shot prompting', this lesson shows when it's easier to show the model an example of the result rather than explaining rules in words, and how to avoid confusion in templates.
Topic breakdown
Few-shot prompting is when you show the model one or more examples of the desired result, then ask it to solve a new task following the same logic.
This approach is especially useful for support responses, headlines, product descriptions, emails, and any text where style, rhythm, and a repeatable standard are important.
But if the example is weak or you don't explain what exactly should be preserved, the model may copy the wrong pattern. So it's important to provide not just the example but also instructions about the example.
What you'll learn
- demonstrate style through examples
- give a new task after an example
- build a repeatable response standard
- understand the difference between a strong and weak sample
Lesson plan
The essence of few-shot prompting
The model sees examples, derives a rule from them, and applies that pattern to a new task.
What should be visible in the example
In a good example, repeatable elements are clearly visible: length, style, structure, CTA, or answer logic.
When one example is enough and when two are needed
For a simple task, one strong example may suffice. For nuanced style and more complex tasks, two are better.
Pattern vs copying
If you don't tell the model to preserve only the pattern, it may start repeating even specific phrases and facts from the example.
Weak vs strong prompt
Here's an example. Write another similar one.
Below are 2 examples of support responses. Both preserve: a short greeting, acknowledgment of the problem, a specific solution, and a next step. Based on this structure and friendly tone, write a response to a new question. Do not copy facts or phrasing from the examples.
The strong prompt doesn't just show an example — it explains which pattern to carry over to the new task. This makes the result more predictable.
Deep dive
Few-shot prompting is one of the most practically useful prompt engineering techniques for business. The idea: instead of abstractly describing 'write in such-and-such style,' you simply show the model one or two finished results and ask it to do the same. The model derives the pattern itself and applies it to the new task.
When is few-shot irreplaceable? In three situations: 1) You need to capture a specific brand style that's hard to describe in words. 2) You need standardization — for example, so all support responses start with a greeting, problem acknowledgment, and specific solution. 3) You need product descriptions or social posts with a recognizable structure.
The practical difference between zero-shot and few-shot: zero-shot relies on rules and instructions, few-shot relies on examples. When style is easy to describe in words ('formal tone', 'no cliches'), zero-shot is often sufficient. When style needs to be 'felt', few-shot is significantly more precise.
The main risk of few-shot prompting: if the example is poor, the model reproduces its weaknesses too. It's also important to explicitly state: 'preserve only the structure and style, do not copy facts and phrasing.' Without this caveat, the model may literally repeat individual phrases from the example.
Ready prompt template
Copy and adaptBelow are 2 examples. In both, the following must be preserved: a short headline, a simple explanation, and a clear CTA at the end. Based on this pattern, create new text for a new topic. Do not copy the content of the examples — preserve only the style, structure, and length. New topic: [topic].
Why it works
An example gives the model a visible standard of the result, not an abstract description of what you want.
If you explicitly state which elements to preserve, the model copies the pattern rather than the actual content.
One strong example is often more useful than a long explanation without a sample.
For complex or sensitive tasks, two quality examples help stabilize style better than one.
Practice
- Prepare 2 strong examples for one repeatable task: support or marketing text.
- Note what exactly needs to be preserved: length, tone, structure, or CTA.
- Request 3 new responses following the same pattern.
- Compare which response best matches the examples.
Mini-project
Mini-project: library of 3 references
Build a small set of quality examples for a repeatable task — for example, support responses or social posts — and use it as a few-shot foundation.
Tasks
- Select or write 2-3 good examples of the same type.
- Describe which properties need to be preserved.
- Build a few-shot prompt for a new task.
- Evaluate how well the new result matches the pattern.
Deliverables
- 2 or 3 reference examples
- 1 few-shot prompt
- 3 new AI responses and brief evaluation
Checklist
Common mistakes
- using a weak or random example
- not explaining what exactly should be preserved
- forgetting to warn against copying the actual content
- mixing examples with contradicting styles in one prompt
Lesson FAQ
Is few-shot always needed?
No. For simple tasks, role, task, and format are often enough. Few-shot is especially useful when you need to capture style or a repeatable standard.
How many examples are enough?
In many cases, one or two strong examples suffice. Too many examples overload the prompt and don't always provide more benefit.
What's the difference between few-shot and zero-shot prompting?
Zero-shot is a task without examples — the model relies only on the description. Few-shot is a task with one or two examples of the finished result. For style and standardization, few-shot is more precise; for simple tasks, zero-shot is faster.
How to choose a good example for few-shot?
Take real results that you consider the gold standard for the given task. Questionable, outdated, or hastily made examples give a weak signal — the model will reproduce their flaws too.