Unit 5 / 12

Few-Shot Sampling: Teaching by Example

Gains:

  • Can distinguish between zero-shot and few-shot approaches and knows when to choose which
  • Can apply rules for selecting representative samples that reflect desired form, tone and quality
  • Can reliably control the format and tone of output with samples

Sometimes it is much more effective to show something rather than describe it. Instead of saying "Write in a polite but clear language like this," showing an example of exactly what you want will convey your intention to the model much faster. That's exactly what "few-shot sampling" is all about: teaching the model the pattern you want by showing it a few examples. In this unit, we will learn this powerful technique and the rules of using it effectively, with scenarios from your own business.

What are Zero-Shot and Few-Shot?

There are two basic approaches:

  • Zero-shot: Directly describing the task without giving any examples to the model. "Classify this review as positive, negative or neutral." The model implements the instruction with its own knowledge.
  • Few-shot: Showing a few example input-output pairs to the model as well as describing the task. "Here are 3 examples: comment → tag. Now tag comment 4." The pattern mimics the pattern you show.

The "shot" here refers to the number of samples you give: if you give two samples, it's a "two-shot", if you give five samples, it's a "five-shot". The rule is simple: the more subjective, formalistic or unusual the task, the more valuable it is to demonstrate.

When Does Few-Shot Pay?

Demonstrating is superior to describing, especially in the following cases:

  1. If you want a specific format: If you want your product descriptions to always have the same structure, showing two examples is clearer than a ten-sentence description.
  2. If you want a specific tone: It's hard to describe your brand voice in words; Two sample texts instantly convey the tone.
  3. If you are doing classification: Showing with an example which input goes to which label is safer than writing the rule.
  4. If it's an unusual task: If you want a special transformation that the pattern doesn't see often, the example teaches the pattern.

Rules for Choosing an Effective Example

The model imitates the samples; so the quality of your samples directly becomes the quality of the output. Five rules:

  1. Let it be representative. Let the examples reflect typical situations of your real work; not extreme and rare cases.
  2. Be consistent. Let all examples follow the same form, the same tone, the same length. Contradictory examples confuse the model.
  3. Let it be quality. If your sample is defective, the output will be defective as well. "A bad example is a bad teacher."
  4. Include diversity. Give at least one example of each label in the classification; Otherwise, the model will stick to the label it sees.
  5. Let it be little but enough. Usually 2-5 samples will do the trick. Dozens of examples create unnecessary length and can give undue weight to a rare example.

Zero-Shot / Few-Shot Comparison

criterion

Zero-shot

few shots

Installation effort

low

Medium (need to prepare sample)

Format consistency

Variable

high

tone control

hard

easy

unusual task

weak

strong

prompt length

short

longer

Four Copiable Templates

1) Classification (few-shot):

Task: Label the customer review as Positive / Negative / Neutral. Examples:Comment: "The shipping was very fast, I loved it." -> PositiveComment: "The product was not as in the description." -> NegativeComment: "The box was a little crushed, but the product works." -> NeutralTag now:Comment: "[new comment]" ->

2) Tone transfer (few-shot):

The following two examples show our brand's writing tone. Write a 2-sentence description for a new product with the same tone. Example 1: "[brand tone sentence]"Example 2: "[brand tone sentence]"New product: [name + feature]

3) Few-shot:

Convert the raw note to the structure in the example below.Sample input: "Ali called and asked for a price, he wants 3 licenses"Sample output:- Person: Ali- Request: 3 licenses- Action: Send a quote Convert now:Input: "[raw note]"

4) Head production (few-shot):

Create 5 headlines that are similar in tone to the examples of good headlines below. Examples:- "3 habits that reduce accounting to 10 minutes"- "Hidden tax advantage for SMEs" Topic: [your topic]

Weak Prompt / Strong Prompt

Weak:

Separate these comments into positive or negative comments.[comments]

Strong:

Tag each comment with a single word (Positive / Negative / Neutral) as in the examples below. Writing a description.Ali: "Great product." -> PositiveAyşe: "He came late." -> NegativeCan: "It's okay." -> NeutralComments:[comments]

The second prompt both fixes the tag set with the example and reduces the output to a single word with the "do not write description" constraint; The result can be processed directly into a table.

Three Mini Cases

Case 1 — Support team, 200 comments. An e-commerce support team was manually tagging 200 customer reviews; It took about 2 hours per person. With a 4-shot few-shot prompt, the model tagged comments in seconds; By manually reviewing only those marked “Neutral” (about 30), the team reduced the work from 2 hours to 15 minutes.

Case 2 — Brand voice. A content team was complaining that new writers weren't hitting the brand tone. Created a template using 3 approved paragraphs as a few-shot example; Editorial rounds of new content were reduced from two to one because the tone was established the first time.

Case 3 — Sales CRM. A sales team was writing call notes in free text and it was cumbersome to process into CRM (customer relationship management software). A two-instance “convert note to structure” prompt converted scattered notes into the “Contact/Request/Next step” format; data entry is standardized.

Tip: Choose your examples from your past real and good deeds. The three outputs you like best are actually your most valuable few-shot examples; keep them.
Attention: If there is a conflict between your samples (one short and one very long, one formal and one intimate), the model will not know which one to imitate and will give inconsistent output. Before publishing examples, make sure they are consistent among themselves.

Common mistakes

  • Contradictory examples. Mixing samples of different shapes and tones.
  • Biased example of single label. Giving only "positive" examples in classification and drawing the model there.
  • Poor quality example. Copying a defective sample and producing the same defect.
  • Extreme example. Putting 30 examples unnecessarily and making the prompt bloated.
  • Confusing task with example. Not distinguishing which is an example and which is the actual request.

In summary

  • Zero-shot is describing the task without giving examples, while few-shot is describing the task by showing a few sample input-output pairs.
  • The model imitates the samples; The quality of the samples is directly the quality of the output.
  • Good sample representation should be consistent, high-quality, diverse, and little-but-enough.
  • Few-shot excels at description, especially in form, tone, classification, and unfamiliar tasks.
  • Your best past work is your most valuable few-shot examples; save them in the library.

Application task

Choose a sorting or formatting task that you do regularly (such as comment tagging, note editing, heading generation, etc.). Choose 3 good examples from your past work, set up a consistent few-shot prompt, and test it on 5 new inputs. Measure how much of the output you can use without correction, and try improving the result by changing the samples.

checklist

  • [ ] I can explain the difference between zero-shot and few-shot.
  • [ ] I know when showing is better than describing.
  • [ ] I can choose representative, consistent and high-quality examples.
  • [ ] I give examples of each label in the classification.
  • [ ] I keep my best outputs as examples for the future.