One good example beats a paragraph of description

You will be able to add examples to a request so the model copies the pattern you want.

Daniel runs customer service for a small online furniture shop in Singapore. Every morning there are forty or fifty new messages, and he wants each one tagged as delivery, refund, damaged item, product question or other, so his two part-timers know which ones to pick up. He asked an assistant to sort them, describing each category in a sentence. The tags came back inconsistent. A message about a scratched table was "damaged item" on Monday and "refund" on Tuesday, and on Wednesday a new tag appeared that he had never asked for, "complaint".

So he tried something different. He deleted his descriptions and pasted in three real messages with the tag he would have given each one. The next batch came back tagged almost exactly the way he would have done it himself.

Why showing works better than telling

AI fundamentals lesson 3.2, It writes by predicting the next token, again and again, explained that a language model continues text in the most likely way given everything in front of it. That makes it a strong pattern matcher. When the text in front of it contains a few pairs of input and output, the most likely continuation of a new input is an output in the same pattern.

A description has to be interpreted. "Tag it as damaged item if the product arrived broken" leaves open what to do with a message that says the table is broken and asks for a refund. An example settles it. If one of your examples shows a broken table tagged "damaged item" even though the customer mentions a refund, the model has your rule without you having to write it down, and it will usually apply it.

The same holds well beyond tagging. An example of a good meeting summary says more about the length, the headings and the level of detail you want than a paragraph describing them. A sample product description shows the voice, the structure and roughly how many words, all at once.

The name for it

Putting a few worked examples into the prompt is often called few-shot prompting. A prompt with no examples is sometimes called zero-shot, and one with a single example one-shot. You do not need the vocabulary to use the technique, but it helps when you read about prompting elsewhere or when a colleague mentions it.

The examples go in the prompt itself, every time. Nothing is being trained or saved. The model sees them, follows the pattern for this request, and has forgotten them by your next fresh chat, as AI fundamentals lesson 5.1, The context window is the model's only working memory, explained.

Examples get copied closely

The strength of examples is also their risk. A model copies them closely, including things you did not mean to teach. If your one example of a product description happens to be 40 words long, the new ones will be around 40 words. If it opens with a question, they will open with questions. If your example reply to a customer signs off with "Cheers, Daniel", every reply will too, including the ones going to a customer who is furious.

So pick examples that are typical of what you want, not your most unusual or most impressive one. If your best ever product description was for a handmade teak cabinet and ran to 200 words of craftsmanship, it is a poor example for the plastic storage boxes that make up most of the catalogue.

Check that your examples agree with your instructions, too. If you ask for "under 80 words" and paste an example of 150, the example usually wins.

Two or three, and make them different

One example teaches the pattern, but it also invites the model to copy that one example's content. Daniel found this when he gave a single example of a delivery query about a sofa: for a while, the model was more likely to tag anything mentioning a sofa as delivery.

Two or three examples that differ from each other solve most of this. When the examples cover different products, different lengths and different moods, the model can see what they have in common, which is the pattern you want, and what varies, which it should not copy. For Daniel's tagging job, that meant one short angry message about a late delivery, one long polite question about fabric care, and one message about a cracked mirror that also asked for a refund.

A clear layout helps the model tell the examples apart from the new work. Label each one, keep the input and the output visibly separate, and mark where the new input starts. Something as plain as "Message:" and "Tag:" on each example, then "Now tag these messages:" before the new batch, does the job. Lesson 2.4, Build an example set for a task you repeat, takes this further with a reusable set you test properly.

Consistency is easy to check on a sorting task like this. Run the same batch twice and see how many tags change, then compare that with a run that has no examples. That comparison is next: find ten or so real messages, emails or requests you sort by hand, with anything confidential removed, and decide on the categories before you start.

Write a prompt that sorts customer messages into categories, first with no examples and then with three, and compare how consistent the labels are.

Course

Junxiong-WFG Organisation is an authorised representative of AIA Financial Advisers Private Limited (Reg. No. 201715016G).