Prompt Engineering for ChatGPT

How to apply prompt engineering to effectively work with large language models, like ChatGPT.

What you’ll learn

  1. How to apply prompt engineering to effectively work with large language models, like ChatGPT
  2. How to use prompt patterns to tap into powerful capabilities within large language models
  3. How to create complex prompt-based applications for your life, business, or education


Course Introduction

  1. Motivating Example: Building a Meal Plan with a Fusion of Food from Ethiopia and Uzbekistan that is Keto
  2. Overview of the Course
  3. Motivating Example: Act as a Speech Pathologist
  4. Setting Up an Account and Using ChatGPT
  5. What are Large Language Models?
  6. Randomness in Output

Introduction to Prompts

  1. What is a Prompt?
  2. Intuition Behind Prompts
  3. Everyone Can Program with Prompts
  4. Prompt Patterns
  5. The Persona Pattern
  6. Introducing New Information to the Large Language Model
  7. Prompt Size Limitations
  8. Prompts are a Tool for Repeated Use
  9. Root Prompts
  10. Reading a Prompt Pattern
  11. Format of the Persona Pattern
  12. Learn More About Prompt Patterns

Prompt Patterns I

  1. Question Refinement Pattern
  2. Cognitive Verifier Pattern
  3. Audience Persona Pattern
  4. Flipped Interaction Pattern
  5. Format of the Question Refinement Pattern
  6. Format of the Cognitive Verifier Pattern
  7. Format of the Audience Persona Pattern
  8. Format of the Flipped Interaction Pattern

Few-Shot Examples

  1. Few-shot Examples
  2. Few-shot Examples for Actions
  3. Few-Shot Examples with Intermediate Steps
  4. Writing Effective Few-Shot Examples
  5. Chain of Thought Prompting
  6. React Prompting
  7. Using Large Language Models to Grade Each Other
  8. Learn More About Chain of Thought Prompting
  9. Learn More About React

Prompt Patterns II

  1. Game Play Pattern
  2. Template Pattern
  3. Meta Language Creation Pattern
  4. Recipe Pattern
  5. Alternative Approaches Pattern
  6. Format of the Game Play Pattern
  7. Format of the Template Pattern
  8. Format of the Meta Language Creation Pattern
  9. Format of the Recipe Pattern
  10. Format of the Alternative Approaches Pattern

Prompt Patterns III

  1. Ask for Input Pattern
  2. Combining Patterns
  3. Outline Expansion Pattern
  4. Menu Actions Pattern
  5. Fact Check List Pattern
  6. Tail Generation Pattern
  7. Semantic Filter Pattern
  8. Course Conclusion & Thank You
  9. Format of the Ask for Input Pattern
  10. Format of the Outline Expansion Pattern
  11. Format of the Menu Actions Pattern
  12. Format of the Fact Check List Pattern
  13. Tail Generation Pattern
  14. Format of the Semantic Filter Pattern
  15. Continue Learning About Prompt Engineering

Large Language Models (LLMs) like ChatGPT, Claude, and Gemini have revolutionized natural language processing. These models are trained to predict the next word in a sequence based on previous words, which means they recognize and respond to patterns in language. By understanding and utilizing these patterns, you can significantly enhance the quality of your interactions with LLMs.

Prompt patterns are structured strategies designed to evoke specific behaviors from these models. By employing the right prompt pattern, you can guide the LLM to produce more accurate, relevant, and useful outputs. These patterns tap into the language structures and contexts that the models have been trained on, allowing you to communicate more effectively with the AI.

This course provides an overview of various prompt patterns and their key elements, serving as a quick reference for those working with LLMs. Each pattern is designed to elicit a particular type of response or behavior from the model, helping you to achieve your desired outcomes more efficiently.

For those interested in delving deeper into this subject, Vanderbilt University’s Professor Jules White offers a comprehensive, free, self-paced course on prompt engineering. This course provides a more thorough exploration of prompt patterns and their applications in AI interactions.

By mastering these prompt patterns, you can create more effective and productive interactions with generative AI, unlocking the full potential of these powerful language models.

Prompt Patterns for AI Interaction
Pattern Name Core Structure Purpose Example
Persona Act as Persona X
Perform task Y
Elicit responses from a specific perspective Act as a gourmet chef. I am going to tell you what I am eating, and you will tell me about my eating choices.
Question Refinement Whenever I ask a question, suggest a better version Improve question quality From now on, whenever I ask a question, suggest a better version and ask me if I would like to use it instead.
Cognitive Verifier Generate additional questions about X
Combine answers to produce Y
Ensure comprehensive and accurate responses When you are asked to create a recipe, generate additional questions about my ingredients and equipment. Combine answers to produce a recipe I can make.
Audience Persona Explain X to me
Assume that I am Persona Y
Tailor explanations to specific audience Explain large language models to me. Assume that I am a bird.
Flipped Interaction Ask me questions to achieve X
Ask until condition Y is met
Gather necessary information through questioning I would like you to ask me questions to help me create variations of my marketing materials. Ask questions until you have sufficient information about my current draft messages, audience, and goals.
Game Play Create a game around X
Provide game rules
Engage users in interactive learning experiences Create a cave exploration game for me to discover a lost language. Describe where I am in the cave and what I can do.
Template Provide a template for output
X is placeholder for content
Structure responses in a specific format Create a random strength workout using this template: NAME, REPS @ SETS, MUSCLE GROUPS WORKED, DIFFICULTY SCALE 1-5, FORM NOTES
Meta Language Creation When I say X, I mean Y Create custom shorthand or commands When I say “variations (something)”, I mean give me ten different variations of
Recipe Achieve X
Perform steps A, B, C
Provide complete sequence
Break down complex tasks into steps 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.
Alternative Approaches List alternative ways to accomplish task X
(Optional) Compare pros/cons
Explore multiple solutions For every prompt I give you, if there are alternative ways to word it, list the best alternate wordings. Compare/contrast the pros and cons of each wording.
Ask for Input Ask me for input X Prompt user for specific information From now on, I am going to cut/paste email chains into our conversation. You will summarize what each person’s points are. Ask me for the first email chain.
Menu Actions When I type X, you will do Y
Ask for next action
Create custom command sets Whenever I type: “add FOOD”, you will add FOOD to my grocery list and update my estimated grocery bill. At the end, you will ask me for the next action.
Fact Check List Generate facts contained in output
Insert at POSITION
Enhance accuracy and verifiability Whenever you output text, generate a set of facts contained in the output. Insert at the end of the output.
Tail Generation At the end, repeat Y and/or ask me for X Maintain context and guide user actions Act as an outline expander. At the end, ask me for what bullet point to expand next.
Semantic Filter Filter this information to remove X Focus on specific content Filter this information to remove everything but the first sentence of each paragraph.
Price Free
Language English
Duration 18 Hours
Certificate No
Course Pace Self Paced
Course Level Advanced
Course Instructor Vanderbilt University
Machine LearningPrompt EngineeringPrompt Engineering for ChatGPT