Thoughts Brewing Blog

AI Quick Tips 26: Use trigger/instruction pairs in your prompts

Written by Damien Griffin | Jul 7, 2024 11:15:00 AM

One of OpenAIs recommendations to simplify complex prompts for ChatGPT is to use “trigger/instruction” pairs.


In this case, a “trigger” is a cause for something to happen, and the “instruction” contains the details of what will happen.


An example of this outside of AI tools is when you are using a mouse on a computer and right-click on the desktop, a menu appears.  The right-click is the trigger and the menu appearing is an instruction that was put in place before you clicked anything.


Adding these can break multi-step prompts into simpler instructions that are easier to follow.  It also makes it less likely that steps will be merged together unintentionally.


This is how they look -

  • Trigger: User enters a list of names
  • Instruction: Put the names in alphabetical order and return a list to the user


or

  • Trigger: User enters a CSV file 
  • Instruction: Use the information to create a table and output the table to the user


or

  • Trigger: User asks for a poem
  • Instruction: Create and return a haiku


The details of the trigger and instruction can be almost anything.  The important takeaway is the structure of the messages.  


Since ChatGPT and similar tools are machines, they work better with consistency and structure.