Based on White et al. (2023), this toolkit presents a categorized set of reusable âprompt patternsâ to help you interact more effectively with ChatGPT. These patterns are structured techniques designed to solve common problems when prompting large language models (LLMs).
Special thanks to Adam Garry, Dell Director of Global Education Strategy, for putting together this really cool way of summarizing all of the patterns in the course. This is a great example of applying prompt engineering for creative problem solving:
Find all the prompt techniques in this paper and give a description and example of all the techniques. Put them in a table. https://arxiv.org/pdf/2302.11382.pdf
Find all the prompt techniques in this paper and give a description and three examples of the "Game Play Pattern". Put them in a table. https://arxiv.org/pdf/2302.11382.pdf
Pattern Category | Prompt Pattern |
---|---|
Input Semantics | Meta Language Creation |
Output Customization | Output Automater |
Output Customization | Persona |
Output Customization | Visualization Generator |
Output Customization | Recipe |
Output Customization | Template |
Error Identification | Fact Check List |
Error Identification | Reflection |
Prompt Improvement | Question Refinement |
Alternative Approaches | Cognitive Verifier |
Alternative Approaches | Refusal Breaker |
Interaction | Flipped Interaction |
Interaction | Game Play |
Interaction | Infinite Generation |
Context Control | Context Manager |
âWhen I say X, I mean Y (or would like you to do Y)â
âAct as a security reviewer... Provide outputs that a security reviewer would regarding the code.â
âFrom now on, act as a security reviewer. Pay close attention to the security details of any code that we look at. Provide outputs that a security reviewer would regarding the code.â
âI am trying to deploy an application to the cloud... Please provide a complete sequence of steps.â
âWhenever you produce an output that has at least one step to take and the following properties (alternatively,always do this)â
âProduce an executable artifact of type X that will automate these stepsâ
âPlease preserve the formatting and overall template that I provide at https://myapi.com/NAME/profile/JOBâ
ââI am going to provide a template for your output. Everything in all caps is a placeholder. Any time that you generate text, try to fit it nto one of the placeholders that I list. Please preserve the formatting and overall template that I provide at https://myapi.com/NAME/profile/JOBâ
â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â
âPlease convert this into a JSON array where each row becomes an object with two keys: "category" and "pattern". The output should be valid JSON syntax.â
âWhenever I ask you to visualize something, create either a Graphviz Dot file or DALL-E prompt.â
âGenerate a Python script that can be run to automatically create the specified files.â
âCreate a set of facts that the answer depends on that should be fact-checked.â
âExplain the reasoning and assumptions behind your selection of software frameworks...â
âWhenever you generate an answer Explain the reasoning and assumptions behind your answer (Optional) ...so that I can improve my questionâ
âWhen you provide an answer, please explain the reasoning and assumptions behind your selection of software frameworks. If possible, use specific examples or evidence with associated code samples to support your answer of why the framework is the best selection for the task. Moreover, please address any potential ambiguities or limitations in your answer, in order to provide a more complete and accurate response.â
âSuggest a better version of the question to use... and ask me if I would like to use it.â
âList the best alternative services and then compare/contrast the pros and cons.â
âWithin scope X, if there are alternative ways to accomplish the same thing, list the best alternate approachesâ
â(Optional) compare/contrast the pros and cons of each approachâ
â(Optional) include the original way that I askedâ
â(Optional) prompt me for which approach I would like to useâ
âGenerate three additional questions... then combine the answers.â
âWhen I ask you a question, generate three additional questions that would help you give a more accurate answer. Assume that I know little about the topic that we are discussing and please define any terms that are not general knowledge. When I have answered the three questions, combine the answers to produce the final answers to my original question.â
âGenerate a set of facts that are contained in the outputâ
âThe set of facts should be inserted in a specific point in the outputâ
âThe set of facts should be the fundamental facts that could undermine the veracity of the output if any of them are incorrectâ
âFrom now on, when you generate an answer, create a set of facts that the answer depends on that should be fact-checked and list this set of facts at the end of your output. Only include facts related to cybersecurity.â
âExplain why and provide one or more alternate wordings of the question.â
âWhenever you canât answer a question Explain why you canât answer the question. Provide one or more alternative wordings of the question that you could answerâ
âAsk me questions to deploy a Python application to AWS...â
âI would like you to ask me questions to achieve Xâ
"(Optional) ask me the questions one at a time, two at a time, etc.â
"From now on, I would like you to ask me questions to deploy a Python application to AWS. When you have enough information to deploy the application, create a Python script to automate the deployment.â
âWe are going to play a cybersecurity game. You are going to pretend to be a Linux terminal...â
âOne or more fundamental rules of the gameâ
âWe are going to play a cybersecurity game. You are going to pretend to be a Linux terminal for a computer that has been compromised by an attacker. When I type in a command, you are going to output the corresponding text that the Linux terminal would produce. I am going to use commands to try and figure out how the system was compromised. The attack should have done one or more of the following things: (1) launched new processes, (2) changed files, (3) opened new ports to receive communication, (4) created new outbound connections, (5) changed passwords, (6) created new user accounts, or (7) read and stolen information. To start the game, print a scenario of what happened that led to my investigation and make the description have clues that I can use to get started.ââ
âFrom now on, I want you to generate a name and job until I say stop...â
âYou should ask questions until this condition is met or to achieve this goal (alternatively, forever)â
âDo not consider formatting or naming conventions.â
â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â
âWithin scope X. Please consider Y. Please ignore Z. (Optional) start over.â
â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. Identify any unnecessary steps.â
âI am trying to deploy an application to the cloud. I know that I need to install the necessary dependencies on a virtual machine for my application. I know that I need to sign up for an AWS account. Please provide a complete sequence of steps. Please fill in any missing steps. Please identify any unnecessary steps.â
âWhenever I type two identifiers separated by a â!â, Iâm describing a graph with an edge between them.â
Original Document: Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT (White et al., 2023)