Prompting and Everyday Use

Giving a Chatbot Examples: How Showing Beats Describing

How to use one or a few examples to teach a chatbot your style or format, and how to stop it from copying them too closely.

Key takeaways

  • An example shows format, tone and detail level together, which is hard to capture in description.
  • Say what the example is meant to teach and what the assistant should not copy from it.
  • Several varied examples help the assistant find the shared pattern instead of imitating one sample.
  • For sorting or labeling tasks, include the tricky borderline cases, not only the easy ones.
  • Never paste private or confidential text just because it makes a good sample.

When you want output in a particular style or pattern, paste an example of it. One good sample often communicates more than a paragraph of adjectives, because the assistant can pick up sentence length, tone, layout and level of detail all at once. This technique is often called few-shot prompting, where a "shot" is an example included in the prompt.

Examples carry a risk as well. The assistant may copy things you did not mean to teach, such as a particular opening phrase or topic. The rest of this guide shows how to get the benefit and limit the side effects.

Why showing works

Try to describe your own email style precisely. You might say "brief and friendly." That covers a two-line note with no greeting and a cheerful five-paragraph update. Your reader would know the difference instantly, but the words do not carry it.

A language model works by continuing the text in front of it in a fitting way. When that text contains a sample, the sample strongly shapes what "fitting" means. The model does not retrain itself or permanently learn your style. The effect lasts as long as the example stays in the conversation it can read.

This is why a pasted sample can settle many small decisions: whether you use headings, how you sign off, whether numbers appear as digits and how formal your verbs are.

One example, a few, or none

A prompt with no examples is sometimes called zero-shot. It is fine for common tasks with an obvious shape, such as explaining a term or fixing grammar.

Situation Examples to give Watch for
Common task, flexible style None Generic phrasing
A specific format to match One Copied wording or topic
A style with natural variety Two to four, different from each other Blending that flattens the differences
Sorting or labeling items A few per category, including hard ones Bias toward the most frequent label

The counts are starting points, not rules. Add an example when the output keeps missing in the same way. Remove one if the assistant seems stuck imitating it.

Label what the example is for

An unexplained sample leaves the assistant to guess which features matter. Tell it.

Here is a product description I wrote that I like.
Copy: the length, the plain tone, and the habit of opening
with what the item is used for.
Do not copy: any facts, the product name, or the closing joke.
Now write one for the item below, using only the details listed.

The "do not copy" line matters. Without it, a sample about a waterproof jacket can leak the word "waterproof" into a description of a cotton shirt. After generating, scan the new text for facts that came from the example and not from your details.

Setting the sample apart with a clear marker also helps, so that nothing inside it is mistaken for an instruction. A line saying "Example starts" and "Example ends" is enough.

Describing a style versus showing it
Description only Words like friendly or concise leave wide room Layout and length are often guessed Quick to write, no sample needed Good for common, flexible tasks With an example Tone, length and layout arrive together Risk of copying phrases or facts Needs a sample you are allowed to share Good for house styles and fixed formats VS Description only Words like friendly or concise leave wide room Layout and length are often guessed Quick to write, no sample needed Good for common, flexible tasks With an example Tone, length and layout arrive together Risk of copying phrases or facts Needs a sample you are allowed to share Good for house styles and fixed formats

Use varied examples to teach a pattern

If you give one example, the assistant cannot tell which of its features are essential. If you give three that differ in topic and wording but share a structure, the shared structure stands out.

Say you want meeting notes turned into action items. You might show three short pairs: a note about a budget, one about a schedule change and one about a complaint. Each pair shows the raw note and then the action item with an owner, a verb and a due date. When one note has no due date, show your preferred handling, such as "Due: not set."

That last detail is where examples earn their keep. They answer questions you might never think to write as rules: what happens when information is missing, when two tasks hide in one sentence or when there is nothing to report.

Examples for sorting and labeling

Suppose you want customer messages sorted into "billing," "technical" and "other." Easy cases teach little, since the assistant would get them anyway. Give it the cases you argue about with colleagues.

  • A message saying the payment page crashed: technical or billing? Show your answer and a half-sentence of why.
  • A message that thanks you and also asks for a refund: which label wins?
  • A message too vague to classify: show that "other" or "needs a human" is acceptable.

Keep the examples reasonably balanced across labels and mix up their order. If most samples carry one label, replies can lean toward it. Before trusting the sorting on a large batch, run a handful of items whose answers you already know and count the disagreements. The method in testing whether a prompt change helped works well here.

Showing what you do not want

A bad example can help when a specific fault keeps returning. Label it unmistakably: "This is the kind of opening I do not want," then give the sentence and say what is wrong with it. Follow it with a version you do want.

Be sparing. Text you quote is still present in the conversation, and the assistant may echo it despite the label. A positive example paired with a short instruction is usually the safer choice.

A before-and-after from everyday work

Say you run the sign-up list for a community garden and send reminders about work days. You ask, "Write a reminder for Saturday." The result is likely to be cheerful and long, with phrases you would never use.

Now you include a past reminder you liked:

Hi all. Work morning this Saturday, 9 to noon.
We're mulching the paths. Bring gloves; we have rakes.
Can't make it? No problem, just water your own plot.

You add: "Match this length and plainness. This week we are repairing the north fence, and the date and time are the same. Don't reuse the line about watering unless it fits."

The assistant now has the rhythm of your messages: a short greeting, the time, the job, what to bring and an easy way out. Check the draft for leftovers such as rakes or mulch, which belong to the old week. Then check what the new job requires. The assistant cannot know whether you have fence tools, so supply that fact or leave a blank.

If the draft matches too closely, ask for two versions that keep the length and order but change the wording. You want the habits to carry over and the sentences to be new.

Where examples go wrong

Over-imitation. Every output starts with the same phrase as your sample. Fix it by adding varied examples or by saying "vary the openings."

Hidden errors. If your sample contains a mistake or an awkward habit, expect to see it again. Proofread examples before using them.

Invented details in the right style. A reply that matches your voice perfectly can still contain made-up facts, and the familiar tone makes them easy to miss. Check claims separately.

Examples that crowd the window. Very long samples use space and may bury your instructions. Trim to the part that demonstrates the pattern.

Whose text can you use?

Your own writing is the simplest source. Text from colleagues may contain private details, so strip names and anything confidential first. Published writing by others raises questions about copyright and about imitating a living author's voice. Asking for a general quality, such as short declarative sentences, avoids much of that, and your workplace may have rules of its own.

If a workplace tool or public chatbot stores conversations, remember that your examples are stored too. Check the current data policy before pasting client material.

Keep the examples that work

Once a set of examples produces good results, save it with the instructions that go with it. Next month you will not remember which sample did the trick. A simple notes file is enough to start, and the idea grows naturally into a personal prompt library.

Revisit saved examples now and then. Your style changes, facts age and a model update can alter how closely samples are followed. If outputs drift, test with a fresh example and compare. Examples are a strong lever for the shape of an answer; for the substance, you still need to supply the background the assistant cannot guess and check what comes back. If you also want a fixed layout, combine your sample with a plain statement of the format and length you expect.

Written for 4ArtificialIntelligence with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 55 articles in Prompting and Everyday Use →

Latest news on this topic