If you have ever interacted with an AI chatbot, you know that they rely on well-written prompts to understand you and respond appropriately. However, vague or overly broad prompts can sometimes generate irrelevant or incomplete responses, which can be frustrating. This is where prompt engineering comes in.
A lot of research has been done on creating effective prompts that provide helpful context and get you the answers you want. In this article, we will provide you with some useful tips on how to craft clear, specific prompts that will help you get the most out of your ChatGPT interactions.
Steps
6
Avoid yes/no questions.
-
Identify any yes/no questions. Look for prompts that start with words like "Do you..." "Did you..." "Will I..." "Should I..." These typically require a one-word response and limit discussion. Examples:
- Do you think I'll enjoy this book?
- Did you agree with points made in the article?
- Should I ask for a raise at work?
-
Reword the prompt as an open-ended question. Start with words like "What..." "Why..." or "How...". This gives ChatGPT more options for responding and encourages engaging dialogue. Examples:
- What about this book do you think will appeal to me?
- Why did you agree or disagree with ideas presented in the article?
- How might I make a compelling case for earning a raise at my job?
-
Follow up with additional open-ended questions. Keep the discussion going by probing ChatGPT's answers for more details, examples, reasoning, and depth.Remember to provide context and background as needed. Include any necessary additional information to help steer ChatGPT's responses in the most helpful direction. Describe your unique situation or priorities to receive customized advice. Examples:
- What other books would you recommend to me based on what I've enjoyed in the past? I especially enjoy science fiction books with complex plots and well-developed characters.
- Can you give an example from the article that supports your perspective? I found the argument around educational policy reform particularly unconvincing. My views tend to align more with Position A.
- What key accomplishments or valuable skills have I gained this past year that warrant increased compensation? I have taken on additional responsibilities over the past 6–12 months, including training two new team members and reorganizing work flows to increase efficiency by 15%. My productivity and contributions are demonstrably greater, even in a challenging year.
Advertisement
7
Use chain-of-thought prompting. [4] X Research source
-
This method involves providing a series of connected prompts that ask an AI system like ChatGPT to engage in a sequence of reasoning steps before responding [5] X Research source . Example prompt:
- The odd numbers in this group add up to an even number: 4, 8, 9, 15, 12, 2, 1. Answer: Adding all the odd numbers (9, 15, 1) gives 25. The answer is False.
- The odd numbers in this group add up to an even number:15, 32, 5, 13, 82, 7, 1. Answer: ?
-
One recently proposed technique is "zero-shot chain-of-thought prompting" [6] X Research source . This method consists of adding the phrase "Let's think step by step" to the initial prompt. The idea behind this is that simply instructing ChatGPT to "think step by step" through a complex prompt, without providing explicit examples, may activate more systematic reasoning as the system determines how to logically break down its thought process on the fly. Example:
- I have a total of $100 dollars to spend. I first spend $25 on lunch, then I go shopping and buy a new calculator for $35 and a notebook for $10. On my way home, I stop for gas and it costs me $12 to fill up my tank. How much money do I have left? Let's think step by step.
- A librarian has a total of 227 books to put on 3 shelves. She places the same number of books on each shelf. After shelving all the books, she realizes she has 7 books left over that do not fit. How many books did she place on each shelf? Let's think step by step.
Advertisement
8
Use the Self-Ask Technique.
-
The "self-ask method" [7] X Research source is an approach where the AI system asks itself additional follow-up questions before responding to the initial query. This requires you to provide ChatGPT with an example like this:
- You: Question: Who lived longer, Theodor Haecker or Harry Vaughan Watkins?
- ChatGPT: Are follow up questions needed here: Yes.
- ChatGPT: Follow up: How old was Theodor Haecker when he died?
- You: Intermediate answer: Theodor Haecker was 65 years old when he died.
- ChatGPT: Follow up: How old was Harry Vaughan Watkins when he died?
- You: Intermediate answer: Harry Vaughan Watkins was 69 years old when he died.
- ChatGPT: So the final answer is: Harry Vaughan Watkins
-
This method can also be achieved by simply adding: "Ask any follow-up questions you need to answer this question correctly, step by step".Advertisement
Expert Q&A
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Tips
- Ask ChatGPT to "Act as <Persona> ". Example: Act as a copywriter, act as a maths teacher, act as a web developer, etc. Users report receiving higher quality answers by giving ChatGPT a persona related to their question [8] X Research source .Thanks
- Ask ChatGPT to "self-reflect" on its answers by typing "why were you wrong?". Research has shown self reflection improves GPT-4's accuracy by 30%. [9] X Research sourceThanks
- Specify the desired response format (e.g. bullet points, short paragraphs)Thanks
Advertisement
Warnings
- Training data of ChatGPT is limited up to September 2021, and it is not connected to the internet unless the user has access to the browsing plugin. Users should not rely on ChatGPT for answers requiring real-time access to information.Thanks
- ChatGPT can give incorrect or biased answers. Users should avoid relying on ChatGPT for advice pertaining to legal or medical matters.Thanks
Advertisement
References
- ↑ https://github.com/openai/openai-cookbook/blob/main/articles/techniques_to_improve_reliability.md
- ↑ https://nerdynav.com/write-better-prompts-for-chatgpt
- ↑ https://lilianweng.github.io/posts/2023-03-15-prompt-engineering/
- ↑ https://arxiv.org/abs/2201.11903
- ↑ https://www.promptingguide.ai/techniques/cot
- ↑ https://arxiv.org/abs/2205.11916
- ↑ https://arxiv.org/pdf/2303.11366.pdf
- ↑ https://www.nytimes.com/2023/05/25/technology/ai-chatbot-chatgpt-prompts.html
- ↑ https://arxiv.org/pdf/2303.11366.pdf
About this article
Thanks to all authors for creating a page that has been read 11,326 times.
Advertisement