Contrastive Prompting - using contrasting examples

Contrastive Prompting

A method that uses contrasting examples to improve accuracy. The approach means giving the model both positive and negative examples, or comparing different aspects of a task, to get more precise and nuanced answers.

AdvantagesDrawbacks
Improves the model's ability to tell subtle nuances apartCan complicate the prompt structure
Helps avoid faulty generalizationsRequires careful selection of contrasting examples
Effective for classification and analysis tasksCan be overkill for simple tasks

Example of Contrastive Prompting:

Analyze the following restaurant reviews and identify their sentiment (positive or negative). Pay attention to the contrasting aspects in each review:
'The food was excellent, but the service left a lot to be desired.'
'The waiters were very attentive, yet the prices are too high for food of this quality.'
'The atmosphere in the restaurant is cozy, but the menu selection is limited.'

Now, using these examples as a guide, analyze the following review:
'The restaurant serves unique dishes you will not find anywhere else, but the portions could be bigger.'

Identify the overall sentiment of the review and explain how the different aspects (uniqueness of the dishes vs. portion size) shape the overall impression.

Try it in GPTunneL