Negative examples in prompts: show boundaries without teaching the wrong rule
A negative example can mean a disallowed output, an input to reject, a boundary counterexample, or an incorrect demonstration. These serve different purposes. Explain the rule and desired alternative, keep uncorrected wrong pairs out of ordinary few-shot examples, and compare variants on the same held-out evaluation cases.
A negative example can mean a disallowed output, an input to reject, a boundary counterexample, or an incorrect demonstration. These serve different purposes. Explain the rule and desired alternative, keep uncorrected wrong pairs out of ordinary few-shot examples, and compare variants on the same held-out evaluation cases.
A negative example shows behavior to avoid, but labeling it wrong does not guarantee the model learns the intended lesson. A counterexample marks where a general rule stops applying; an incorrect demonstration may teach a wrong input-label pattern. Distinguish these from prohibited outputs, rejectable inputs, and held-out evaluation cases.
Suppose a message says delivery is complete and asks when a refund will arrive. If the task classifies current intent, the expected class is refund despite the word delivery. This hypothetical pair illustrates a boundary; it is not a measured result. Write the rule explicitly, create a minimal pair changing only the decisive feature, and verify labels against policy. Hold genuinely ambiguous cases for review.
Research does not show a universal effect. Min et al. (EMNLP 2022) found randomly changed demonstration labels had little impact in the studied tasks, while label space, input distribution, and format mattered. Chen et al. (Findings of EMNLP 2023) analyzed demo interference in their settings. Neither guarantees incorrect examples are safe elsewhere.
Compare instructions only, verified positive examples, reasoned counterexamples, and, only if necessary, an explicitly corrected wrong example. Keep model, settings, and held-out cases fixed. Measure the target error, spillover, format, uncertainty handling, latency, and tokens. Remove a wrong example if the model copies it; retain negative examples only when repeated evaluation shows benefit without unacceptable regression.
Additional checks
Never put real personal or confidential values in a negative example. Use fictional placeholders and state the allowed replacement behavior.
State the main rule first and keep only a few verified boundary cases; too many exceptions can obscure the rule.
Keep evaluation counterexamples out of prompt demonstrations. If you use examples while tuning, reserve separate unseen cases for the final evaluation.
If the model copies forbidden text or improves the target error while worsening other categories, remove or revise the example and compare both target errors and regressions.
Sources
[Min et al., “Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?” (EMNLP 2022)](https://aclanthology.org/2022.emnlp-main.759/) — results scoped to their tested models and tasks.
[Chen et al., “How Many Demonstrations Do You Need for In-context Learning?” (Findings of EMNLP 2023)](https://aclanthology.org/2023.findings-emnlp.745/) — study of demo interference and correlations in specific settings.
[OpenAI API: Prompt engineering](https://developers.openai.com/api/docs/guides/prompt-engineering) — prompt composition and evaluation guidance.