How to Write Better Prompts for ChatGPT
How to Write Better Prompts for ChatGPT
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

Give context.

Briefly describe the topic or issue you want to discuss. Provide any necessary background information to make sure ChatGPT understands.For example, say "ChatGPT, I want to talk about reforming public education. Specifically, I'm interested in making college more affordable and accessible." Here are some examples. Note the italicised text provides context to the question, allowing GPT to provide better-suited answers. ChatGPT, I want to discuss potential policy solutions for climate change. Specifically, I'm interested in options for transitioning to renewable energy and reducing emissions. ChatGPT, I need some advice. I'm struggling with balancing work responsibilities and spending time with family. Can we talk through some strategies for creating better work-life balance? ChatGPT, I'm thinking about adopting a dog from an animal shelter. Can we discuss some of the pros and cons of dog ownership and breed options that might suit my lifestyle? I live in an apartment, have limited outdoor space, and am away from home for 8-9 hours a day. ChatGPT, I'm taking an online course in art history to learn more about European paintings. For an upcoming assignment, I need to analyze a few of Claude Monet's famous impressionist works. Can you give me some suggestions of paintings I should focus on and possible approaches for my analysis? ChatGPT, I'm training for my first marathon and trying to establish a good running schedule. I want to fit in speed work, tempo/easy runs, long runs, strength and cross-training within my busy weekly schedule. Can you provide any advice for organizing a marathon training regimen? Things I should be sure to include and consider with how much I can handle as a beginner runner? The specific prompts provided above are good because they have a clear and narrow focus, making it easier to provide helpful and actionable advice.

Ask for a precise response.

Rather than just raising a topic, ask ChatGPT for a specific reaction or task. For instance, ask the bot to summarize key arguments in an article in 3 sentences, compare and contrast two policy options, evaluate pros and cons, or make a recommendation.

Provide an example.

Give ChatGPT an exact prompt to demonstrate the type of response you're looking for. For instance, say "ChatGPT, please summarize the key points from the attached article in 3 sentences." Rather than the open-ended "What do you think about this article?" You can also provide example answers to guide ChatGPT; this is called few-shot prompting. Example (this is a complete prompt): Text: I had a wonderful time at the beach today. The weather was perfect, and the water was crystal clear. I enjoyed building sandcastles, playing volleyball, and soaking up the sun with my friends. It was a truly memorable and joyous day. Sentiment: positive Text: The rundown old amusement park had clearly seen better days. Rusting rides that looked well past safe operating limits, trash strewn about the premises, exorbitant prices for cheap food and mile-long lines managed by apathetic teen staff did not make for an enjoyable family outing. Sentiment: negative Text: Accepting the prestigious literary award, the renowned yet famously reclusive author delivered a moving speech highlighting the power of words to challenge assumptions, foster empathy and drive positive change. ChatGPT, based on the context provided, would you say this sentiment is positive or negative?

Keep it concise.

Long-winded or rambling prompts will likely confuse ChatGPT and result in unfocused responses. Keep your initial prompt to 1 or 2 sentences. Follow up with additional prompts if needed for clarification.

Follow up.

Ask for clarification or expansion on particular points. Let ChatGPT know if a response is heading in the wrong direction and needs to be re-focused. Examples: If ChatGPT summarizes an article in 3 sentences as you requested but leaves out a key point, follow up by saying something like: "Thanks, that covers the main topics but can you include the author's argument about [X] in your summary?" If ChatGPT makes a claim or statement you disagree with or think needs nuance, ask for clarification. You might say: "Can you explain your reasoning behind that statement?" or "I see it differently. Here is my view: [share your perspective]." Then ask for ChatGPT's reaction to your view. The algorithm will often refine its information as you ask it more specific questions. If ChatGPT goes off-topic or redirects the conversation in an unhelpful direction, kindly re-focus the bot by restating your original prompt or question. For instance: "Let's get back to the issue of making college more affordable. What policy solutions would you suggest for lowering tuition costs?"

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.

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. 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". 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.

Use the Self-Ask Technique.

The "self-ask method" 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".

Provide feedback.

Make sure to let ChatGPT know if it responds helpfully. Say something like: "Thank you, that summary was very insightful." Or "I agree, those pros and cons were thoughtfully considered." Positive feedback will signal to ChatGPT how it should answer your follow-up questions.

Maintain an educational tone.

Maintain a constructive, educational tone if ChatGPT responds in a way that seems off or not useful. Rather than criticizing the bot, re-phrase your follow-up prompt to steer the conversation productively. Model the type of thoughtful, respectful dialogue you want to cultivate.

What's your reaction?

Comments

https://ugara.net/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!