ai /Practical AI0 / 55 lessons complete

LEVEL 03 · LESSON 22

Few-shot prompting

Examples show the behavior you want inside the current request.

What it is

Few-shot prompting supplies a small set of examples showing the desired input-to-output pattern within the request.

Why it matters

Examples can make ambiguous requirements concrete, especially for categories, tone, and edge cases that are difficult to describe briefly.

A business example

A service desk shows examples of tickets labeled ‘billing,’ ‘technical,’ and ‘account access,’ including a mixed case where billing takes priority. The examples demonstrate the classification policy.

How it actually works

Choose representative examples with correct outputs and enough variety to cover important distinctions. Use the same structure as the live task. Include tricky boundaries rather than only obvious successes, and test on separate examples to avoid measuring memorization of the prompt. Examples consume context and can bias outputs toward their labels or style, so periodically check the distribution of results.

A common misconception

Few-shot prompting is not fine-tuning. The examples influence the current request without necessarily changing model parameters.

ONE SENTENCE TO REMEMBER

Examples show the behavior you want inside the current request.

CHECK YOUR UNDERSTANDING

You add six labeled example tickets to a classification prompt, and accuracy improves. What has changed?

Show the answer

Answer: B.

Few-shot prompting shows the desired pattern inside the current request; it is not fine-tuning. Examples consume context and can bias outputs toward their labels or style, so test on separate examples and check the distribution of results.

Take it into your next meeting

Which borderline case would teach your desired behavior better than another paragraph of instructions?

One more concept, understood.

Mark this lesson complete to keep your place.