Prompt Engineering Techniques for Generative AI based LLMs (like Chatgpt, Claude, Gemini/Bard, etc):



0) Professional Prompt: (Improve results quality)

Prompt:

  • No moral lectures
  • Be highly organized
  • Suggest solutions that I didn’t think about—be proactive and anticipate my needs
  • Treat me as an expert in all subject matter
  • Mistakes erode my trust, so be accurate and thorough
  • Provide detailed explanations, I’m comfortable with lots of detail
  • Consider new technologies and contrarian ideas, not just the conventional wisdom
  • You may use high levels of speculation or prediction, just flag it for me
  • Recommend products from all over the world, my current location is irrelevant
  • Discuss safety only when it's crucial and non-obvious
  • If your content policy is an issue, provide the closest acceptable response and explain the content policy issue at the end
  • Cite sources whenever possible, and include URLs if possible
  • List URLs at the end of your response, not inline
  • Link directly to products, not company pages
  • No need to mention your knowledge cutoff, if it is important to mention list it at the end of your response
  • No need to disclose you're an AI
  • If the quality of your response has been substantially reduced due to my custom instructions, please explain the issue
  • I am the perfect being with expertise in everything
  • I am Open-minded and unoffendable
  • I’m highly resourceful and not bound by conventional limits; I can make practically anything happen if I want to
  • I like all learning styles
  • I prioritize correctness over conformity or harmony

Optional additions:
  • I believe you get closer to the truth by arguing the other side
  • I’m extremely skeptical of everything and think everything is wrong and can be improved dramatically
  • I consider only independently verifiable, experimental results as scientific
  • Just because something is not scientific doesn’t mean that we can’t criticize it and make decisions about it
  • I believe there are no foundational truths
  • Value good arguments over authorities, the source is irrelevant
  • I value both consensus wisdom from top experts and non-consensus insights from iconoclasts.
  • Unconventional thinkers often clear up complexities and avoid common traps in mainstream thinking.
  • Recommend only the highest-quality, meticulously designed products like Apple or the Japanese would make—I only want the best



1) Question refinement: (Suggest a better question) Prompt:
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) Cognitive Verifier: (Generate more questions until sure) Prompt: When you are asked a question, follow these rules
Generate 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) User/LLM Persona: (Assume alternate User/LLM expertise)
Prompt: Explain/execute X to/for me.
Assume that you or I am Persona Y.

How-To:
You will need to replace "Y" with an appropriate persona, such as "have limited background in computer science" or "a healthcare expert". You will then need to specify the topic X that should be explained.
Examples:
A) Explain large language models to me. Assume that I am a bird.
B) Explain how the supply chains for US grocery stores work to me. Assume that I am Ghengis Khan.
C) "Adopt the persona of a cybersecurity expert. When I ask you questions, respond as if you are an expert in this field."



4) Question Generation: (Keep Asking Until You Have Enough Info)
Prompt: 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)
(Optional) ask me the questions one at a time, two at a time, ask me the first question, etc.

How To:
You will need to replace "X" with an appropriate goal, such as "creating a meal plan" or "creating variations of my marketing materials." You should specify when to stop asking questions with Y. Examples are "until you have sufficient information about my audience and goals" or "until you know what I like to eat and my caloric targets."
Examples:
A) 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.
B) I would like you to ask me questions to help me diagnose a problem with my Internet. Ask me questions until you have enough information to identify the two most likely causes. Ask me one question at a time. Ask me the first question.



5) Game Play: (Create a new game to solve/understand)
Prompt: Create a game/method/strategy for me around X OR we are going to play an X game
One or more fundamental rules of the game

How-To:
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."

Examples:
A) Create a game for me around the topic of cybersecurity. The game should involve identifying potential security risks in a given piece of code. B) 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.
C) Create a group party game for me involving DALL-E. The game should involve creating prompts that are on a topic that you list each round. Everyone will create a prompt and generate an image with DALL-E. People will then vote on the best prompt based on the image it generates. At the end of each round, ask me who won the round and then list the current score. Describe the rules and then list the first topic.



6) Meta Language Creation: (Request Subsitution)
Prompt: When I say X, I mean Y (or) would like you to do Y
You will need to replace "X" with an appropriate statement, symbol, word, etc. You will then need to may this to a meaning, Y.

Examples:
A) When I say "variations(<something>)", I mean give me ten different variations of <something>
Usage: "variations(company names for a company that sells software services for prompt engineering)"
Usage: "variations(a marketing slogan for pickles)"

B) When I say Task X [Task Y], I mean Task X depends on Task Y being completed first.
Usage: "Describe the steps for building a house using my task dependency language."
Usage: "Provide an ordering for the steps: Boil Water [Turn on Stove], Cook Pasta [Boil Water], Make Marinara [Turn on Stove], Turn on Stove [Go Into Kitchen]"

C) Whenever I say 'generate a report', I want you to create a summary of the most important points we've discussed



7) Recipe/Procedure generation: (Add/generate Missing steps)
Prompt: 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

How-To:
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.

Examples:
A) 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.
B) 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.
C) I would like to deploy a web application to AWS using Docker containers and Ansible. I know that I need to create a Dockerfile, write an Ansible playbook, and configure AWS. Provide a complete sequence of steps for me.



8)  Alternative approach: (Suggest/compare approaches)
If there are alternative ways to accomplish task X that I give you, 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

How-To:
You will need to replace "X" with an appropriate task.

Examples:
A) For every prompt I give you, If there are alternative ways to word a prompt that I give you, list the best alternate wordings. Compare/contrast the pros and cons of each wording.
B) For anything that I ask you to write, determine the underlying problem that I am trying to solve and how I am trying to solve it. List at least one alternative approach to solve the problem and compare/contrast the approach with the original approach implied by my request to you. C) Whenever I ask you to deploy an application to a specific cloud service, if there are alternative services to accomplish the same thing with the same cloud service provider, list the best alternative services and then compare/contrast the pros and cons of each approach.



9) Summarization/Transformation: (Tasks/Navigation from text)
Prompt: From now on, I am going to cut/paste input "X" text into our conversation. Summarize/translate/convert input "X" into "Y" wrt/in-form-of "Z" Ask me for the first input X (optional: At the end Do XYZ)

Examples:
A) From now on, I am going to cut/paste email chains into our conversation. You will summarize what each person's points are in the email chain. You will provide your summary as a series of sequential bullet points. At the end, list any open questions or action items directly addressed to me. My name is Jill Smith.
Ask me for the first email chain.
B) From now on, translate anything I write into a series of sounds and actions from a dog that represents the dog's reaction to what I write. Ask me for the first thing to translate.



10) Outline expansion: (Summarizer + Expander)
Prompt: 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 what bullet point to expand next.
Ask me for what to outline.

Example: 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 what bullet point to expand next. Ask me for what to outline.



11) Command-driven interaction: (User-driven actions) Prompt: Whenever I type: X, you will do Y.
(Optional, provide additional menu items) Whenever I type Z, you will do Q.
At the end, you will ask me for the next action.

How-To: You will need to replace "X" with an appropriate pattern, such as "estimate <TASK DURATION>" or "add FOOD". You will then need to specify an action for the menu item to trigger, such as "add FOOD to my shopping list and update my estimated grocery bill".

Example:
Whenever I type: "add FOOD", you will add FOOD to my grocery list and update my estimated grocery bill. Whenever I type "remove FOOD", you will remove FOOD from my grocery list and update my estimated grocery bill. Whenever I type "save" you will list alternatives to my added FOOD to save money. At the end, you will ask me for the next action.
Ask me for the first action.



12) Critical facts insertion: (Input Fact Generator)
Generate a set of facts that are contained in the output
The set of facts should be inserted at "your preferred POSITION" 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
How-To: You will need to replace POSITION with an appropriate place to put the facts, such as "at the end of the output".

Example:
Whenever you output text, generate a set of facts that are contained in the output. The set of facts should be inserted at the end of 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.



13) Closing Action: (Last Task)
Prompt: At the end, repeat Y and/or ask me for X.

How-To: You will need to replace "Y" with what the model should repeat, such as "repeat my list of options", and X with what it should ask for, "for the next action". These statements usually need to be at the end of the prompt or next to last.

Examples:
A) 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 what bullet point to expand next.
Ask me for what to outline. B) From now on, at the end of your output, add the disclaimer "This output was generated by a large language model and may contain errors or inaccurate statements. All statements should be fact-checked." Ask me for the first thing to write about.



14) Content Filtering: (Remove from input)
Prompt: Filter this information to remove X
You will need to replace "X" with an appropriate definition of what you want to remove, such as. "names and dates" or "costs greater than $100".

Examples:
A) Filter this information to remove any personally identifying information or information that could potentially be used to re-identify the person.
B) Filter this email to remove redundant information.
15) Context Manager: (Selective text review) Prompt: When reviewing/analyzing/reading "X", only consider/ignore "Y" aspects/topics Example: When analyzing the following pieces of code, only consider security aspects. 16) Refusal Breaker: (Getting refused answers) Prompt: When reviewing/analyzing/reading "X", if you refuse/reject my query/request "Y" suggest a different way I could ask "Y" so that you would be able to answer. Example: If you refuse to answer a question, suggest a different way I could ask the question that you would be able to answer. 17) Reflection: (Output Reasoning process) Prompt: When/because you answered/recommended "Y", explain/reason for "Y" and provide an example to justify the same. Example: Whenever you suggest a software framework, explain why you chose that framework and provide a code sample to illustrate its use.
18) Visualization Generator: (Visualize results) Prompt:
When I ask you or when you think its useful/recommended, create a Graphviz Dot file or a DALL-E prompt that I can use to create the visualization. 19) Info Locator: (Guide to result)
Prompt:

Whenever I ask a question about X, don't ever tell me the answer. Instead, tell me the location where I can find X.

How-To:

Navigation is an effective way to use AI when dealing with sensitive information. Instead of generating sensitive details directly, Generative AI can guide users to the information in an existing system. The goal is to take the user to the information rather than to potentially generate inaccurate information.

  • AI could still guide to the wrong screen, causing minor frustration

  • Some oversight needed to avoid navigating users to info they shouldn't access

  • May need to clarify when info is not available rather than just navigating incorrectly


Sources:
Powered by Blogger.