Hey Everyone! I am taking a beginners class on Prompt Engineering.
I made some notes on different prompt patterns that you can use with LLM's (Large Language Models) such as chat GPT.
Some of them are quite useful and I had fun playing around with them! I thought I'd share my notes in case someone may find it helpful :)
Prompt Patterns:
Question refinement pattern
- Ensures the LLM always suggests potentially better or more refined questions the user could ask instead of their original question. “From now on, whenever I ask a question, suggest a better question and ask me if I would like to use it instead.” Use this as a prompt at the beginning of your conversations
Cognitive Verifier Patters:
- LLM’s can reason better if a question is subdivided into additional questions that provide answers combined into the overall answer to the original question “When you are asked a question, follow these rules:
“ Generate a number of additional questions that would help more accurately answer the question.
Combine the answers to the individual questions to produce the final answer to the overall question.”
The Persona Pattern:
- Allows you to go to a specific professional/specialist to ask for a more precise answer
- Refers to the ability of the model to generate text that mimics the style, tone, or characteristics of a specific persona or personality.
- Example: Act as a skeptic that is well-versed in ____. Whatever I tell you provide a skeptical and detailed response.
- To use this pattern, your prompt should make the following fundamental contextual statements: Act as Persona X Perform task Y
- Does not have to be a human, can be an innate object or idea “act as a Python terminal window”.
Audience Persona Pattern:
- Telling the large language model who the audience is which tells it how to word its answers.
- “Describe X to me. Assume that I am persona Y”.
Flipped Interaction Pattern:
- Pattern used to train the LLM to ask you questions instead of you asking it questions.
- Helpful when you don’t have all the information needed to get to your desired answer or you want to be quizzed on a topic
- “Ask me questions about X until you have enough information about Y” (to make a suggestion or provide information). “Ask me the first question” - keep it simple by asking only one question at a time.
- Additional format: “I would like you to ask me questions to achieve X” “You should ask me questions until Y is met or ‘desired goal’ is achieved” “Ask me the questions one at a time, two at a time, ask me the first question, etc.”
Happy learning!
Jamie