Where Does the Broken Example Go in Your Prompt? Build a Few-Shot Block That Has Seen Bad Input

A support bot I was testing got this message: “hi i want a refund for order 44812 the box came open.” It cheerfully processed the refund. The catch? Our order numbers have six digits. That one had five. Every example in the prompt was spotless, so the model had never met a messy input and assumed the world was tidy.

That’s roughly the story behind a post I found on r/PromptEngineering, where the author realized all their few-shot examples were picked because they looked good. Which means the prompt had never once seen a broken input. Let’s fix that the right way, because there’s one very tempting wrong way.

Why it matters 🧩

Few-shot examples don’t just show the model what good input looks like. They show it what to do. Whatever output sits next to an input is the thing the model learns to produce for inputs like it.

Here’s the trap. You add a malformed input, but you pair it with a clean, normal-looking answer. Congratulations, you just taught the model that broken input deserves a business-as-usual reply. The opposite of what you wanted.

So the fix is not “add a bad example.” The fix is “add a bad example and pair it with a repair.”

How-To Steps 🛠️

Here’s the four-part block from the post, built around a refund-request bot.

  1. Write a typical example.
  2. Add a second typical example with a different shape.
  3. Add one broken but realistic input, and pair it with a repair.
  4. Close with a rule that carries a number.

EXAMPLE 1 – typical
in: refund request, order number present, no order date
out: ask for the order date. nothing else.

EXAMPLE 2 – typical, different shape
in: refund request, order number present, box arrived damaged, photo attached
out: confirm the damage, then ask for the order date.

EXAMPLE 3 – broken, realistic
in: “hi i want a refund for order 44812 the box came open”
broken: the order number has five digits where ours have six, and there is no order date
out: name both problems, then stop. do not guess the order number.

See what happened there? The output isn’t an answer. It’s a flag plus a stop. The model learns that when something looks off, it says so instead of improvising.

RULE
every reply is three sentences or fewer. no greeting, no sign off, no apology.

“Be concise” reads like it should work and doesn’t. “Three sentences or fewer” is something the model can actually count. Same goes for “no closing summary,” which is specific enough to obey.

Tips & Tricks ✨

Put the clean examples first. The author’s reasoning is that a messy example up front tends to set the tone for everything after. Let the typical cases establish the shape, then show the exception.

Make the broken input realistic. Not gibberish. A five-digit order number is the kind of thing real customers actually type. Test against the mistakes you’ve really seen.

Describe the break in a label. That “broken:” line tells the model exactly what’s wrong, so it learns to spot the pattern instead of just memorizing one sentence.

Be honest about what you haven’t tested. The author says they haven’t run this across 20 different inputs, and they suspect one of the four slots is dead weight. Examples 2 and 3 are both refunds, so one might be redundant. Good habit: when you build a block like this, run it on a batch and cut whatever doesn’t change the output.

Third or last? Test it. The comments split on this. One commenter argued the broken example should go last, since the real test is whether the model handles the outlier. Another pointed out that in the post’s own layout, the broken example is already the last example, with the rule after it. Both are fair. My take: try both orders on the same 20 inputs and keep the one that fails less. That beats arguing about it.

Prompt of the day: Take your current favorite prompt, find the input you’ve always been scared of, and write a realistic broken version of it. Pair it with a repair, not an answer. Then run it.

Call to Action 🚀

Go open one of your prompts right now and look at the examples. If every single one is clean, your model is living in a fantasy land. Add one broken, realistic input with a repair next to it, and see what changes. Then come tell me which slot you’d cut. I’m curious whether anyone sides with the “last” camp!

Frequently Asked Questions

Q: Should the broken example go last or in the middle?

Commenters split on this. One camp says put it last, since that tests whether the model can handle an outlier instead of learning to expect every input to look tidy. The author keeps it in the middle so the clean examples set the shape first. Neither side has tested it yet, so run both orders on the same unseen inputs and see which holds up.

Q: Should the six-digit order number rule be written out on its own?

Yes. Right now the rule only shows up inside the broken example, so the model has to infer it from one case. Stating it as an explicit validation rule, such as ‘order numbers are six digits’, makes the requirement clear and easy to test.

Q: What should the reply to a broken input actually contain?

Name the output you want, because ‘name both problems, then stop’ leaves open whether the model should also ask for the correct order number and the missing date. Those are two different behaviors. Pick one and write it into the rule so the model isn’t left to guess.

Q: Which example should you cut first?

A good first test is removing example 2, since examples 1 and 2 both teach the model to ask for the order date. Example 2 also introduces damaged packaging, which may be doing a separate job. Remove one example at a time and compare results on the same inputs before deciding.

tear this apart: three clean examples and one that is already broken
by u/Inevitable-Good219 in PromptEngineering

Scroll to Top