Skip to content
mentoor

Topic 4 of 5 · 4 min read

Example copying and answer leakage

Goal: Spot an output that copied its example too closely and change the examples so the model generalises instead.

A model treats everything in an example as part of the pattern, so anything you do not want repeated, such as the topic, the wording or the length, should be made to vary. If every example shares a feature, expect the output to share it too.

Check yourself · 1 of 3

All five replies from your prompt begin with the same unusual phrase that appeared in your one example. What is the most likely cause?

Choose one answer

Why it matters

You show a sample to teach a shape. The model cannot tell which features are the lesson and which are accidents. If your one example is about a dog, the next ten outputs may mention dogs. If your sample is 40 words, most answers will be near 40 words. If all of your samples start with "Great question!", so will the answers.

The three common failures

  1. Copying. Outputs reuse the example's phrases, names, topic or structure. This is the most common one, and it shows most with a single example.
  2. Over-fitting to one pattern. All examples share a quirk, such as every answer having exactly three bullets, and the model applies it even when the input needs two or five.
  3. Answer leakage. If you test a prompt on inputs that also appear as examples, it will look perfect. The model has just seen the answer. This also happens if an example contains the answer to the real question.

How to fix them

  • Vary what should not matter. Use different topics, lengths, names and openings across examples.
  • Say what to copy. Add a line such as "These examples show the format only. Do not reuse their wording or topics."
  • Use neutral content. If your sample is about a made-up product, the model may borrow it. Pick a topic far from the real task, or use a real one the output should be about.
  • Keep test inputs separate. Never test on an input you used as an example. Keep a small set of fresh inputs.
  • Look at a batch. Run five different inputs. If the outputs look alike, the examples are leaking their style.

Before and after

Before: One example about a hotel in Rome: "Warm welcome, great location, 40 words." Every new review reply, even for a car repair shop, mentions a "warm welcome" and a "great location".

After: Two examples, one for a hotel and one for a repair shop, of different lengths, plus "Use the examples for tone and layout only."

What goes wrong

  • You think the prompt works because it passed on its own examples. Test on new inputs.
  • You fix copying by deleting the example. The format problem comes back. Vary the examples instead.
  • You paste a real customer's details into an example. Those details may appear in other answers. Use invented ones.

Examples

Spotting copying in a batch

You ask for five product blurbs from one example about a blue water bottle. Four outputs say "stay hydrated in style". That phrase came from the sample. Replace the sample with two blurbs for very different products and add "do not reuse wording from the examples".

Leakage in testing

A classifier gets 100 percent on your ten test emails, but you also used six of them as examples. The score says little. Test on emails you have not shown the model.

Key points

  • The model cannot tell which parts of an example are the lesson and which are accidents.
  • Copying shows up as reused wording, topics, names or length across outputs.
  • Vary topic, length and openings across examples so the shared pattern is only the one you want.
  • Say plainly that the examples show format, not content to reuse.
  • Test on fresh inputs, never on the inputs that appear in your examples.

Common mistakes

  • Using a single example and then being surprised that every output looks like it.
  • Giving examples that all share one length, opening or structure.
  • Testing a prompt only on the inputs used as examples.
  • Putting real private names or numbers in examples, which can then show up in other outputs.

Check yourself · 2 of 3

Which change best reduces copying from your examples?

Choose one answer

Check yourself · 3 of 3

You test a prompt on ten inputs and it scores perfectly, but six of those inputs are also your examples. What is wrong with this test?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic