AI harness
An AI harness is the software layer around a language model that turns it into a working agent. It manages the loop, tools, context, permiss...
Read definitionFew-shot prompting means showing a language model a few worked examples before asking the real question. Instead of explaining every rule, you demonstrate the pattern, format, tone, or classification you want the model to continue.
Few-shot prompting means putting a few worked examples in the prompt before the real task. Each example shows an input and the answer you want. The model picks up the pattern and continues it for the new input.
The word shot means example. Zero-shot means no examples, only instructions. One-shot means one example. Few-shot means a small set of examples, usually enough to show the format, tone, labels, or reasoning pattern.
Researchers call the underlying behaviour in-context learning. The model is not permanently trained. It does not change its weights. It simply follows the pattern that appears in the current prompt.
Think of onboarding a new colleague. You can write a long policy explaining how a customer reply should sound, or you can show three approved replies and say: this is our style. For language models, that second route is often faster and more reliable.
Suppose you want to classify incoming customer emails into three labels: billing, technical, or sales.
Zero-shot
You write: Classify this email as billing, technical, or sales. This may work, but the answer format can vary. One response may be technical. Another may be This is a technical issue because.... Humans understand both, but a workflow that expects one label may fail.
One-shot
You add one example: an email about a duplicate invoice gets the label billing. The model now sees that it should return just the label.
Few-shot
You add one example per label. One duplicate invoice email becomes billing. One app-crash email becomes technical. One integration enquiry becomes sales. The model now sees both the category boundaries and the exact output shape.
That is where few-shot prompting shines: structured output, classification, tone matching, rewriting style, extraction formats, and small decision rules.
A language model predicts a plausible continuation of the text it has seen. If the prompt contains several examples with the same pattern, the next plausible continuation is another answer in that pattern.
Instructions describe what you want. Examples show it. For style and format, showing is often clearer.
Write briefly and professionally leaves room for interpretation. Three short professional answers show the target length, vocabulary, structure, and level of warmth. Google, OpenAI, and Anthropic all describe few-shot examples as a practical way to steer format and behaviour.
Examples are especially useful when the rule is easier to recognise than to explain: which support tickets count as urgent, how your company phrases apologies, what a valid JSON object looks like, or how strict a classification label should be.
Representative
The examples should look like real input. If the real emails contain typos, mixed languages, vague requests, or missing context, include some of that mess.
Diverse
Cover the main categories and at least one edge case. If every example is easy, the model learns the easy pattern and still fails on the real cases.
Consistent
Use the same output format every time. If one example has a sentence and another has a label, the model may copy either.
Correct
A wrong example is worse than no example. The model may copy the mistake with great confidence.
Clearly separated
Mark examples so the model does not confuse them with the real task. Anthropic recommends using clear delimiters or XML-style tags around examples. The exact marker matters less than the clarity.
Use a ladder.
Start zero-shot
Try a clear instruction first. Many modern models handle simple tasks without examples.
Add few-shot examples
Use examples when the output format varies, style matters, labels are subtle, or the task is easier to demonstrate than explain.
Move to fine-tuning when examples become too heavy
Few-shot examples travel with every request. They cost tokens and take room in the context window. If you need dozens of examples on every call, or if you need the same style across very high volume, fine-tuning may be cleaner.
Few-shot prompting is cheap to try and easy to change. Fine-tuning takes more setup, data, testing, and maintenance, but it can reduce prompt length and improve consistency for repeated tasks.
For reasoning tasks, examples can include the method, not just the answer. A few-shot chain-of-thought prompt shows a question, the reasoning pattern, and the final answer. The model then imitates the checklist or calculation route.
Use this sparingly. For simple classification or extraction, worked reasoning may waste tokens and make the output harder to parse. It helps when the model must follow a known decision process: check VAT, check discount, calculate total, then decide the label.
For customer-facing answers, prefer a short rationale or checklist over a long internal reasoning trace.
Examples bias the output
If two out of three examples are billing cases, the model may over-predict billing. Balance the set or test the effect deliberately.
Order can matter
The last example can colour the next answer. Shuffle examples during testing to see whether the result changes too much.
Examples cost tokens
Five long examples may be fine for a manual chat, but expensive at production volume. Keep examples tight.
Do not hide business rules only in examples
If a rule is critical, state it as an instruction as well. Examples are strong, but they are not a governance document.
Test with real data
Few-shot prompting can look excellent on the examples themselves. The real question is whether it generalises to fresh inputs.
An AI harness is the software layer around a language model that turns it into a working agent. It manages the loop, tools, context, permiss...
Read definitionAI literacy is the knowledge and judgement people need to use AI responsibly: understanding what a model can do, checking its output, protec...
Read definitionChain-of-thought prompting asks a language model to work through intermediate reasoning steps before answering. It can improve arithmetic, l...
Read definitionA chatbot is software that has a conversation with a user through text or speech. Simple bots follow fixed rules and menus; modern bots ofte...
Read definitionChunking is the step where documents are split into smaller pieces before they are embedded and indexed for retrieval. Good chunks help a RA...
Read definition
Collect&Go and Telenet Business are testing an autonomous electric delivery cart in Leuven, steered over 5G. What it means for logistics and...
Discover how Microsoft Copilot in Power BI leverages generative AI to simplify report creation, enhance data insights, and empower teams. Le...