Skip to content
TokIQ

Examples

Few-shot prompting: teaching a model by example

Few-shot prompting means including a handful of worked examples (input and the output you want) in the prompt so the model copies the pattern. It is the fastest way to pin down a format or a labeling style. The catch is that models copy everything, including quirks you did not intend, so the choice and balance of examples matters as much as the instruction.

Coming soon onApp StoreComing soon onGoogle Play

Sample question · Examples

Your 3 examples for a sentiment classifier are all labeled “positive”. What is the most likely side effect?

  1. ANone, the labels do not matter
  2. BThe model leans toward answering “positive”
  3. CThe model refuses to classify
  4. DThe model ignores the examples
Show the answer and why

B. The model leans toward answering “positive” Models pick up the distribution of labels in the examples. Unbalanced examples bias the output, so mix labels and include a borderline case.

What the questions test

  • Zero-shot vs. few-shot: when examples are worth it
  • Picking diverse, representative examples
  • Label balance and example order
  • Formatting examples so they don’t blur into the input

What you’ll learn

  • When an instruction is enough and when an example is needed
  • How many examples to use and how to choose them
  • How examples leak bias, length and style into the output
  • How to separate examples from real input

How to practice it in TokIQ

  1. 1. Open Examples. Pick it from the topic list on the Quiz tab. It is included in the free plan.
  2. 2. Answer one question at a time. You see right away whether you were correct.
  3. 3. Tap Why? Read the short explanation and answer three follow-up questions on the same idea.
  4. 4. Watch your accuracy. The Progress tab shows how Examples compares with your other topics.

Examples: common questions

What is the difference between zero-shot and few-shot prompting?

Zero-shot gives only an instruction. Few-shot adds a few input-output examples of the task. Examples help most when the format or judgment is hard to describe in words.

How many examples should a few-shot prompt have?

Usually two to five well-chosen, varied examples. More examples cost tokens and can make the model over-copy surface details.

Further reading

More topics

Practice examples a few questions a day.

Short quizzes on real prompting decisions, with an explanation for every answer. Free to start on iPhone and Android.

Coming soon onApp StoreComing soon onGoogle Play