Lesson 3 of 5 · 18 min
Examples and format
Showing the expected result instead of describing it.
Slide 1 of 7
Almost everything became delivery
- Mirela gives four triage examples
- The AI sorts the queue in seconds
- Billing complaints land in delivery
Mirela runs customer service at an online furniture store. She wants to sort the morning messages by subject and gives the AI four examples, the first ones in the queue. Three are about delivery, one is about assembly. The tool sorts everything in seconds, and almost everything becomes delivery. Even the customer who was charged twice. Mirela did not write a single wrong rule. Her examples taught a rule she did not notice. In this lesson you will put examples and format to work for you.
Full transcript
Almost everything became delivery
Mirela runs customer service at an online furniture store. She wants to sort the morning messages by subject and gives the AI four examples, the first ones in the queue. Three are about delivery, one is about assembly. The tool sorts everything in seconds, and almost everything becomes delivery. Even the customer who was charged twice. Mirela did not write a single wrong rule. Her examples taught a rule she did not notice. In this lesson you will put examples and format to work for you.
Showing is usually faster than describing
Try to describe the tone of your company's messages. Close, but not intimate. Direct, but kind. Now think of showing two good messages. The second option says more, in less time. An example is a pair: the input and the output you expected. The technique is called few-shot, which means with a few examples. The vendor guides recommend it to steer format, tone and structure, and one of them suggests three to five. Another gives a warning: always keep a clear instruction next to them.
The example teaches what you did not mean to
The tool looks for patterns, and does not know which ones are on purpose. In a study from twenty twenty-one, with models of that time, whatever appeared more often in the examples started to appear more often in the answers, and whatever came last weighed even more. Current models have improved, but the caution costs little. There are two other common leaks. Length: if every example has one line, the answer will have one line, even when it needs three. And content: an order number that was in the example shows up again in the result.
How to choose good examples
Choose examples with three things in mind. Relevant, similar to what will really arrive. Varied: at least one for each possible answer, in mixed order, and one borderline case, the kind a new colleague would get wrong. And the same in form: same fields, same order, same punctuation, because the form is exactly what you want to see repeated. Include an example of when there is no answer as well. Without it, the tool tends to fit everything into some category, and the odd case disappears among the others.
Format: draw the output
Format is the other way of showing. Instead of asking for a short text, ask for up to three sentences. Instead of an organized table, give the names of the columns, in the order you will use them. Instead of do not be wordy, say what to do: start with the recommendation, then two reasons. And decide what appears when information is missing: write not provided. An empty field with no rule is an invitation to invent. If the result goes into a spreadsheet, draw the first row exactly as it should look.
Test with cases you already know
Before trusting it, set aside ten to twenty cases you already know how to answer and that are not among the examples. Run them and compare. More than counting hits, look at the errors. If they all go the same way, an example is pulling. That is how Mirela found out: of nine errors, eight had become delivery. Change one thing at a time, the order, an example, a rule, and run it again. If adding examples no longer helps, stop: too many examples tie the answer to them.
What to do now
Think of a task that repeats in your week and in which you recognize a good result when you see one. Gather three of those results, replace real names and numbers with fictional data and check that they are varied. Draw the output field by field. Then test with five known cases. In the exercise you will cause the bias on purpose, with unbalanced examples, and then fix it. Whoever sees the error happen once starts to recognize it in other people's work and in their own.
A worked case: Mirela's triage
The categories are Delivery, Assembly, Defect, Billing and Other. In the first request, she pasted the instruction and four messages from the top of the queue: three Delivery and one Assembly, ending in Delivery. One of the new messages was this:
I got the table yesterday, all fine with the delivery, but the October installment came twice on my card.
The answer was "Delivery". To understand the size of the problem, Mirela set aside 20 messages from the previous week, already classified by the team, and ran the same request: 11 right. Of the 9 errors, 8 had become Delivery.
The second request, with fictional names and numbers:
Classify each message by the problem the customer wants to solve now: Delivery, Assembly, Defect, Billing or Other. A subject mentioned as solved does not count. If there are two open problems, the one that involves money prevails. Answer with: category; passage that justifies it.
Input: The wardrobe door came warped. Output: Defect; "door came warped"
Input: Do you have a store in Recife? Output: Other; "have a store in Recife"
Input: The bed arrived on time, but you charged the shipping that was free. Output: Billing; "charged the shipping"
Input: The assembler did not show up on Tuesday. Output: Assembly; "assembler did not show up"
Input: The deadline passed on Friday and nothing. Output: Delivery; "deadline passed on Friday"
The same message about the table came back like this:
Billing; "the October installment came twice"
On the 20 test messages, 18 right. The two errors were messages with defect and assembly together, and no rule said which of the two prevails. Mirela asked the team, wrote the rule and ran it again.
What changed between the two requests
| First | Second | |
|---|---|---|
| Examples | The four at the top of the queue | One per answer, mixed |
| Borderline case | None | Delivery mentioned, billing open |
| Output | Category only | Category and passage |
| Place for what does not fit | None | Other |
The justifying passage has an extra use: the reviewer reads a few words, instead of the whole message. And the score holds for those 20 messages. With another sample the number changes, so she repeats the measurement every month.
When an example is not the best way
Examples take up space and tie creativity down. If you want ten different ideas for a campaign, three ready ideas pull the other seven close to them. In that case, describe the goal and the constraints and leave the examples for when you standardize the final version.
Exercise
Cause the bias and fix it
Classify the same cases with unbalanced examples and with balanced examples, and compare the errors.
Step by step
- Choose a classification from your work with three to five possible answers: ticket type, urgency, cost center.
- Write ten short cases with fictional data and note the right answer for each one.
- In a new chat, use the starter text with four examples, three of them with the same answer, and classify the ten cases.
- In another chat, use one example per answer, in mixed order, plus one borderline case, and classify the same ten.
- Count the hits and see which way the errors went in each round.
Starter text
Classify each case into one of these categories: [list]. If none fits, use "Other". Rules: - [what defines each category, in one line] - If there are two subjects, [the tie breaking criterion] prevails. Answer format, one line per case: Number | Category | Passage that justifies it Examples: Input: [fictional case] Output: [number] | [category] | "[passage]" Cases to classify: [1 to 10]
How to tell if it's good
- Prepared cases with a known answer
- Wrote down the right answer before running and did not use test cases as examples.
- Built balanced examples with the same form
- There is one per answer, one borderline case and the same fields in all of them.
- Analyzed the direction of the errors
- Says how many errors there were in each round and which category they went to.
- Concluded honestly
- If the rounds tied, records that and says what they would test, instead of forcing a difference.
Do not use personal data or confidential information in the exercise.
Check
Four situations. Three right answers complete the lesson, and you can try again.
Take away
Instruction with examples, to classify or standardize
Ready-to-use prompt
Task: [what to do with each input, in one sentence]. Categories or fields, with a one line definition each: - [A]: [definition] - [B]: [definition] - Other: when none fits. Do not force it. Rules: 1. If in doubt between two, [criterion] prevails. 2. If information is missing, write "not provided". Do not fill in. 3. The examples show the form. Do not copy data from them. Format, one line per input: [Field 1] | [Field 2] | [Passage that justifies it] Examples (one per answer, in mixed order, and one borderline case): Input: [fictional, category B] Output: [in the exact format] Input: [fictional, borderline case] Output: [in the exact format] Input: [fictional, Other] Output: [in the exact format] Input: [fictional, category A] Output: [in the exact format] Now do it with these inputs: [paste here]