Prompt Patterns

The following content is inspired by insights I gained during my certification class in prompt engineering from Vanderbilt University via Coursera taught by Professor Jules White as well as from my own experience using and studying LLMs and their capabilities.

Scroll ↓

Introduction to Prompt Patterns

This section is about prompt patterns, tools that not only enhance the clarity and relevance of conversations with ChatGPT but also unlock creative and innovative responses. Whether you're crafting prompts for complex problem-solving or simple inquiries, understanding these patterns will elevate your ability to communicate effectively with AI.

How to Use

To use this pattern, your prompt should make the following fundamental contextual statements:

  • Act as Persona X

  • Perform task Y

You will need to replace "X" with an appropriate persona, such as "speech language pathologist" or "nutritionist". You will then need to specify a task for the persona to perform.

  1. Persona Pattern

The Persona Pattern is a prompt engineering technique where ChatGPT is guided to adopt a specific character or professional role. It not only tailors ChatGPT's tone and style but also aligns its responses with the expertise and perspective of the persona.


Example(s)

  • Act as a speech language pathologist. Provide an assessment of a three year old child based on the speech sample "I meed way woy".

  • Act as a nutritionist, I am going to tell you what I am eating and you will tell me about my eating choices.

  • Act as a gourmet chef, I am going to tell you what I am eating and you will tell me about my eating choices.

How to Use

To use this pattern, your prompt should make the following fundamental contextual statements:

  • From now on, whenever I ask a question, suggest a better version of the question to use instead

  • (Optional) Prompt me if I would like to use the better version instead. 

2. Question Refinement Pattern

The Question Refinement Pattern focuses on iteratively refining and clarifying a question to elicit more precise and relevant answers from ChatGPT. This pattern is especially valuable when initial responses are too broad or miss the mark. By narrowing down the scope or adding context to the question, users can guide ChatGPT to provide the information that more accurately meets their needs.


Example(s)

  • Whenever I ask a question about dieting, suggest a better version of the question that emphasizes healthy eating habits and sound nutrition.

  • Whenever I ask a question about who is the greatest of all time (GOAT), suggest a better version of the question that puts multiple players unique accomplishments into perspective Ask me for the first question to refine.

How to Use

To use the Cognitive Verifier Pattern, your prompt should make the following fundamental contextual statements:

  • 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

3. Cognitive Verifier Pattern

The Cognitive Verifier Pattern is a prompt engineering strategy designed to enhance the reliability of ChatGPT's responses. It involves asking ChatGPT to assess the likelihood or confidence of its answers or to provide reasoning, evidence, or sources that support its responses. This pattern encourages a deeper level of processing and critical thinking, prompting ChatGPT to 'double-check' its output, thereby potentially increasing the accuracy and trustworthiness of the information provided.


Example(s)

  • When you are asked to plan a trip, follow these rules. Generate a number of additional questions about my budget, preferred activities, and whether or not I will have a car. Combine the answers to these questions to better plan my itinerary.

How to Use

To use this pattern, your prompt should make the following fundamental contextual statements:

  • I would like you to ask me questions to achieve X

  • You should ask questions until condition Y is met or to achieve this goal (alternatively, forever)

4. Flipped Interaction Pattern

The Flipped Interaction Pattern inverts the typical user-AI dynamic, with ChatGPT taking the initiative to ask questions, guide the conversation, or propose topics. This pattern is particularly useful for exploratory dialogues, interactive learning scenarios, or situations where user input is limited or needs to be elicited in a structured manner. By flipping the interaction, ChatGPT can engage users more actively, gather specific information, or tailor the conversation to the user's needs or interests more effectively.


Example(s)

  • I would like you to ask me questions to help me create variations of my marketing materials. You should ask questions until you have sufficient information about my current draft messages, audience, and goals. Ask me the first question.

  • I would like you to ask me questions to help me create a personalized lesson plan for my student. You should ask questions until we have a full 2 hour lesson plan.

How to Use

To use this pattern, your prompt should make the following fundamental contextual statements:

  • I am going to provide a template for your output

  • X is my placeholder for content

  • Try to fit the output into one or more of the placeholders that I list

  • Please preserve the formatting and overall template that I provide

  • This is the template: PATTERN with PLACEHOLDERS

You will need to replace "X" with an appropriate placeholder, such as "CAPITALIZED WORDS" or "<PLACEHOLDER>". You will then need to specify a pattern to fill in, such as "Dear <FULL NAME>" or "NAME, TITLE, COMPANY".

5. Template Pattern

The Template Pattern involves structuring the prompt to follow a specific format that ChatGPT fills in with information, akin to completing a template. This pattern is especially useful for generating content that adheres to a predefined structure, such as reports, articles, emails, or stories. By providing a clear framework for the response, users can guide ChatGPT to produce outputs that meet specific formatting or content requirements, ensuring consistency and coherence.


Example(s)

  • Create a random strength workout for me today with complementary exercises. I am going to provide a template for your output . CAPITALIZED WORDS are my placeholders for content. Try to fit the output into one or more of the placeholders that I list. Please preserve the formatting and overall template that I provide. This is the template: NAME, REPS @ SETS, MUSCLE GROUPS WORKED, DIFFICULTY SCALE 1-5, FORM NOTES

  • Please create a grocery list for me to cook macaroni and cheese from scratch, garlic bread, and marinara sauce from scratch. I am going to provide a template for your output . <placeholder> are my placeholders for content. Try to fit the output into one or more of the placeholders that I list. Please preserve the formatting and overall template that I provide. This is the template: Aisle <name of aisle>: <item needed from aisle>, <qty> (<dish(es) used in>

How to Use

To use this pattern, your prompt should make the following fundamental contextual statements:

  • I would like to achieve X

  • I know that I need to perform steps A,B,C

  • Provide a complete sequence of steps for me

  • Fill in any missing steps

  • (Optional) Identify any unnecessary steps

You will need to replace "X" with an appropriate task. You will then need to specify the steps A, B, C that you know need to be part of the recipe / complete plan.

6. Recipe Pattern

The Recipe Pattern applies a step-by-step instructional approach to prompt crafting, similar to a cooking recipe. This pattern is ideal for scenarios requiring a sequence of actions, decisions, or thoughts leading to a specific outcome or solution. This method is particularly useful for tutorials, how-to guides, problem-solving, and procedural content.


Example(s)

  • I would like to purchase a house. I know that I need to perform steps make an offer and close on the house. Provide a complete sequence of steps for me. Fill in any missing steps.

  • I would like to drive to NYC from Nashville. I know that I want to go through Asheville, NC on the way and that I don't want to drive more than 300 miles per day. Provide a complete sequence of steps for me. Fill in any missing steps.

How to Use

To use this pattern, your prompt should make the following fundamental contextual statements:

  • Create a game for me around X OR we are going to play an X game

  • One or more fundamental rules of the game

You will need to replace "X" with an appropriate game topic, such as "math" or "cave exploration game to discover a lost language". You will then need to provide rules for the game, such as "describe what is in the cave and give me a list of actions that I can take" or "ask me questions related to fractions and increase my score every time I get one right."

7. Game Pattern

This pattern is a great tool for learning but also possesses great potential for entertainment purposes. It involves turning the LLM conversation into a game in which the user can create the parameters around how the game is played and the LLM can fill the game with content.


Example(s)

  • Create a cave exploration game for me to discover a lost language. Describe where I am in the cave and what I can do. I should discover new words and symbols for the lost civilization in each area of the cave I visit. Each area should also have part of a story that uses the language. I should have to collect all the words and symbols to be able to understand the story. Tell me about the first area and then ask me what action to take.

  • Create a learning game for me. I want to learn historical facts and figures not specific to any era or region. I want it to have a question-answer format and I want you to keep track of my score and remind me of the score every 10 questions.

How to Use

To use this pattern, your prompt should make the following fundamental contextual statements:

  • Act as an outline expander.

  • Generate a bullet point outline based on the input that I give you and then ask me for which bullet point you should expand on.

  • Create a new outline for the bullet point that I select.

  • At the end, ask me for what bullet point to expand next

8. Outline Expansion Pattern

This pattern is great for brainstorming lengthy documents. Since it can be difficult for people to keep track large amounts of information, this prompt pattern is extremely useful in starting with a single idea and branching out into all the necessary subcategories of information.


Example(s)

  • Act as an outline expander. Generate a bullet point outline based on the input that I give you and then ask me for which bullet point you should expand on. Each bullet can have at most 3-5 sub bullets. The bullets should be numbered using the pattern [A-Z].[i-v].[* through ****]. Create a new outline for the bullet point that I select. At the end, ask me for what bullet point to expand next. Ask me for what to outline.

Tips and Ethical Guidelines


Prompt Engineering Tips

Crafting effective prompts for ChatGPT goes beyond simply asking questions; it's about engaging in a creative and thoughtful dialogue where every prompt is an opportunity to guide the AI toward producing the most relevant and insightful responses. Whether you're looking to solve complex problems, generate creative content, or simply get more accurate information, these tips will help you fine-tune your approach to prompt engineering.

  • The more specific your prompt, the more targeted ChatGPT's response will be. Avoid ambiguity to get directly to the heart of what you're asking.

  • Giving ChatGPT context helps it understand the prompt better and tailor its responses to your needs.

  • Complicated or verbose prompts can confuse both the model and the user. Keep it straightforward.

  • If the first response doesn’t meet your expectations, refine your prompt and try again. Iteration can lead to better results.

  • Familiarize yourself with established prompt patterns like the ones discussed earlier to enhance your prompt's effectiveness.

  • Don’t be afraid to experiment with different types of prompts to see what works best for your particular use case.

Ethical Guidelines

Navigating the interaction with AI like ChatGPT ethically is paramount. As we explore the vast capabilities of generative AI, it's crucial to approach prompt engineering with a sense of responsibility and integrity. These guidelines aim to foster an environment where AI interactions are respectful, unbiased, and mindful of privacy and consent.

  • Be mindful not to use LLMs to process or generate content that might infringe upon individuals' privacy or share personal data without consent.

  • Ensure that interactions with LLMs avoid perpetuating biases or stereotypes. Aim to use inclusive language and consider the diversity of users and contexts.

  • Clearly disclose the use of LLMs when generating content that is shared publicly or with third parties, especially in contexts where the distinction between human and machine-generated content is relevant.

  • Ensure your prompts do not inadvertently spread or validate false information. Engage in fact-checking and critical evaluation of the content generated by LLMs.

  • Exercise caution to ensure that content generated by LLMs is not misrepresented as one's own original work without proper attribution, especially in academic, professional, and creative contexts.

  • Encourage and practice ethical development and use of LLMs, considering their societal impacts. This includes addressing potential negative consequences such as job displacement, misinformation, and privacy breaches.

Previous
Previous

What is an LLM?

Next
Next

ChatGPT Advanced Data Analysis