# Few-Shot Classification Prompt

> A compact few-shot prompt for labeling text with balanced examples, an explicit label set, and an escape label.

Category: Prompt & Agent Patterns  
Tags: few-shot, classification, examples  
Setup time (estimate): 30 minutes  
Estimated cost: Examples add input tokens to every call; keep the example set small.  
Last verified: not yet independently verified

## Guidelines

- Give 2-3 examples per label, balanced across labels, covering edge cases.
- Always include an `other`/`unclear` label so the model is not forced into a wrong category.
- Use `temperature: 0` and constrain output to the label only.

## Prompt

```text
Classify the support message into exactly one label:
billing | bug | feature_request | account_access | other

Message: "I was charged twice this month."
Label: billing

Message: "The export button does nothing on Safari."
Label: bug

Message: "Could you add dark mode?"
Label: feature_request

Message: "I can't log in after resetting my password."
Label: account_access

Message: "Do you have an office in Berlin?"
Label: other

Message: "{{message}}"
Label:
```

Evaluate against a labeled set of at least ~100 real messages and inspect the confusion matrix before deploying.

## Failure modes

- Unbalanced examples bias the model toward the most common label.
- No 'other' label forces wrong categories on unusual inputs.
- Label definitions drift from examples over time; keep them in sync.
