Design Few-Shot Examples That Cover Edge Cases
Create a compact set of labelled examples for a fictional library assistant and test it on unseen cases.
Difficulty Beginner
Define the output
Use a text editor and a local or hosted assistant. The output must be exactly one of HOURS, MEMBERSHIP or REVIEW. HOURS covers opening times and closures. MEMBERSHIP covers joining or renewing. If both categories are present or the text is unclear, use REVIEW. Write the rule before choosing examples.
Choose examples with a purpose
When do you open on Saturday? → HOURS
I'd like to renew my library card. → MEMBERSHIP
Can I join when you open tomorrow? → REVIEW
I'm trying to sort something out. → REVIEW
Use one clear example for each category and sample at least one boundary. Preserve the input and output structure. A parser consuming these responses should reject unexpected labels instead of mapping them to a plausible category.
Test unseen variations
Before querying the assistant, label “Is Monday a public holiday closure?”, “My card expired” and “Please renew my card and tell me when you close”. Expect HOURS, MEMBERSHIP and REVIEW. Record the exact prompt version, expected label and received label. Add different spellings or short informal requests. Retain some examples for a final comparison rather than putting every failure into the prompt.
Troubleshooting and practice
If overlapping queries are classified as a single topic, move the overlap rule ahead of the examples and compare. If the model quotes its rationale despite the output restriction, check format compliance separately from label accuracy. Add a duplicate with irrelevant punctuation as a test for input sensitivity. Record the model and settings used. Use synthetic enquiries and review any proposed production routing with the library staff.