Contrastive Prompting
One of the most effective ways to teach an AI what you want is to also show it what you do NOT want. Contrastive prompting provides both good and bad examples, helping the model understand the boundaries of acceptable output.
Contrastive prompting = show positive examples + negative examples (with explanations of why they are bad).
Example: Email Writing
Positive example: "Dear team, thank you for your hard work. Let's meet tomorrow at 10 AM."
Negative example: "Hey team, thanks. Meeting tomorrow." (This is too short and lacks politeness.)
Now write an email cancelling a meeting.The model learns to avoid being too abrupt.Why Contrastive Works
The AI has seen many examples, but it doesn’t know your specific preferences until you show them. Contrastive examples explicitly define the boundaries, reducing ambiguity. It’s a shortcut to teaching style and quality standards.
How Many Examples?
Usually, one good and one bad example is enough. For complex tasks, you can provide multiple positive and negative pairs. Label the negative ones clearly (e.g., "BAD: … because …").
Application Areas
- Teaching tone (formal vs. informal).
- Formatting (correct JSON vs. broken JSON).
- Content quality (detailed vs. vague).
- Safety (what the model should not say).
Two Minute Drill
- Contrastive prompting gives both good and bad examples.
- It defines boundaries of acceptable output.
- Works well for tone, format, and quality.
- Explain why the negative example is bad.
Need more clarification?
Drop us an email at career@quipoinfotech.com
