Are you looking to get the best possible responses from ChatGPT, the large language model trained by OpenAI?

I am a computer engineer who works with AI models in my day job. This guide is based on my experience with ChatGPT (API and chatbot) and related language models like Bing. I have cited research papers for some of these techniques for further reading at the end.

Let’s get started.

Tips for Writing Effective Prompts for ChatGPT

The practical tips and real-world examples will help you and inspire you to use ChatGPT in unique, novel, and profitable ways.

By the way, this field of writing optimized prompts for large language models like ChatGPT is called prompt engineering and may soon turn out to be a very lucrative new-age tech career.

Be Specific and add constraints to improve relevancy. 

When it comes to writing effective prompts, specificity is key. Vague prompts can be confusing and make it difficult for ChatGPT to provide a useful response. 

Let me give you some examples of a specific prompts:

  • What are some scientifically proven ways that parents can encourage their children to read more books?
  • How can teachers effectively use technology to enhance student learning in the classroom?
  • What are some tips for new runners to prevent injuries and increase endurance?
  • What are some strategies for reducing stress and promoting mental wellness in the workplace?
  • What are some ways that individuals can reduce their carbon footprint?

The specific prompts I provided are good because since they have a precise and limited scope, making it easier for ChatGPT to provide tailored and actionable advice. 

For example, the prompt about reducing stress in the workplace is specific to the workplace setting and focuses on a particular issue that many people experience. The advice about runners is constrained to be useful for new runners.

Similarly, we asked ChatGPT for tips to improve student learning in classroom, not at home. This makes it easier to provide specific strategies that are tailored to that situation.

And here are some examples of vague prompts:

  • Can you give me some advice on how to be happy?
  • What are some tips for being successful in life? (be specific – academic success, successful at sales, marketing, etc)
  • How can I improve my writing skills? (You will get answers if you first ask ChatGPT about tips about writing by a famous writer like Kurt Vonnegut and then you ask ChatGPT to give examples that apply those tips – this way the AI has an authoritative source of reference.)
  • What are some ways to be healthier? (Tell it about your lifestyle, dietary preferences, then ask)
  • Can you tell me about some interesting places to visit?  (Be specific about the country, state, city you are asking about)

The vague prompts are more difficult to answer because they are too broad and open-ended. ChatGPT will still give a coherent answer but it will not be relevant.

For example, the prompt about being happy is vague because happiness means different things to different people, and there are many factors that can contribute to it. This makes it difficult to provide specific advice without more information about the person’s individual situation and goals.

Avoid clubbing topics and skip unnecessary details.

When we talk to our friends, we often share the background about our feelings, emotions, or events. We also tend to club topics together in conversation because humans are good at context-switching.

In my experience, AIs tend to wander off-topic if you give them multiple keywords to latch onto. It is better to ensure that each word you include is something you want the AI to actually talk about. 

Clubbing multiple topic also has the downside of getting broad and generic answers that do not go into depth.

Here are some examples of bad prompts that overload ChatGPT with useless information, leading to unhelpful responses:

  • Can you give me tips on how to be healthy, lose weight, and feel better overall? (Clubs multiple topics. It is better to ask ChatGPT about one topic, then ask it to expand on that topic. If satisfied, move on to next topic.)
  • I’m feeling really overwhelmed with everything going on in my life right now. Everything sucks. Can you help me figure out what to do? (You could instead ask ChatGPT to walk you through a particular therapy style questionnaire like CBT workbooks do to help you pin point the areas of your life that are causing you the most stress. Then, you can ask it for specific tips about those problems.)
  • I’m planning a trip to Europe next year since I finally have the money and time, and I want to see as much as possible. Can you give me recommendations for places to visit, things to do, and restaurants to eat at? (No information about budget or duration)

These prompts are bad because they provide too much unnecessary information, which can be overwhelming and lead to unhelpful advice. 

Here are some examples of good prompts that provide just the right information for ChatGPT to give helpful answers:

  • What are some effective techniques for managing anxiety during public speaking?
  • How can I improve my time management skills to be more productive at work?
  • What are some affordable and healthy meal prep ideas for people with busy schedules?
  • What are some recommended exercises for strengthening the core muscles?
  • Can you suggest some strategies for building a strong online presence for a small coffee shop in a korean district near schools?

These prompts are good because they are specific and provide clear information about what the person is looking for help with. They are also focused on a particular topic or problem, which allows ChatGPT to provide targeted and relevant advice.

Avoid complex language and being overly verbose

In both of examples below, the user is being overly verbose and using unnecessarily complex language. They could have been more concise and straightforward with their questions, which would have made it easier for ChatGPT to understand and provide a helpful response.

“Good day, ChatGPT. I was wondering if you could help me with a question I have about the current state of the economy. You see, I’ve been doing some research lately and I’ve come across some conflicting information that has left me feeling quite confused. Specifically, I’m wondering about the impact that the recent stimulus package has had on inflation rates. I was hoping you might be able to provide some clarity on this topic.”

“Dear ChatGPT, I would like to inquire about your expertise regarding the use of advanced machine learning algorithms for the purpose of predicting customer behavior in the context of e-commerce. Specifically, I’m interested in exploring the potential of unsupervised learning methods such as clustering and anomaly detection, as well as more traditional supervised learning approaches like decision trees and random forests. Can you provide me with any insights or recommendations on this topic?”

While it is a good habit to be polite and respectful in your approach (ChatGPT seems to work better if you are not rude), it is not necessary to waste words on trivalities. Be direct.

  1. Guide the AI.

This is similar to setting constraints and being specific about your question but in this you set the constraints on the AI itself.

Examples:

  • You must use a conversational and friendly tone. Do not use formal language. (Appending this line to a prompt makes ChatGPT sound less robotic most of the time.)
  • You must answer from the perspective of a <insert belief system here>
  • You must stick to information presented in the text I am sharing below for answering any questions. (Useful if you want ChatGPT to go through some text you copy-paste and give you answers according to that only. This way you don’t have to read the whole thing yourself but can still ask questions.)
  • You must present both pros and cons of each option.
  • You must give an example with each tip.

Account for ChatGPT’s limitations

ChatGPT’s knowledge is limited to events up to 2021. It is not connected to the internet (unless you use plugins). And, it can give incorrect answers (has a tendency to hallucinate answers if it does not know). 

Always double check its answers from trusted sources on the internet, especially if they relate to:

  • Health
  • Finances
  • Legal Compliances
  • Legal Matters

While ChatGPT can be asked to imitate a therapist, I do not recommend using it as one if you have serious mental health issues. It can give wrong or even dangerous advice.

Miscellaneous Tips

ChatGPT can be given personas to use while answering:

“You are a professional copywriter who specializes in writing copy for businesses in the finance sector. <Your actual prompt>”

  • If asking about ideas or strategies, give context of your brand or company or market relevant to your question.

“I have a software review blog where I write about AI tools. Suggest some low competition keyword ideas that my readers would find useful.”

Use same prompts in Bing

  • Bing chat is based on an improved model of ChatGPT (free version). These prompts give good results with Bing:
    • Analyze top 10 results for the keyword “<your keyword>”. Compare their strengths and weaknesses. (It hallucinates a little bit but you will still get useful insights about content gaps for SEO).
    • Do SWOT analysis of “<company/niche>”
    • If you were a human person, <your prompt>
  • Don’t overcomplicate. These prompts work as well as their more verbose versions available online:
    • Write a letter of recommendation for [person/organization]
    • Write a script for a [podcast/radio show] on [topic]
    • Write a review of a [book/movie/tv show/restaurant]
    • Write a script for a [comedy sketch/stand-up routine] on [topic]
    • Write a [poem/song/lyrics] about [topic/emotion/experience]Write a blog post about your experience with [topic]
    • Create a list of pros and cons for [product/service/topic]
    • Write a summary of the main points from a recent speech or presentation on [topic]
    • Write a social media post promoting a [product/event/cause]
    • Write a script for a [short film/video/animation] on [topic]
  • You can get ChatGPT to format results in the way you want.
    • Give it a list of features under different pricing plans for a product and ask ChatGPT to “create an html table comparing these plans”.
    • “Summarize the following text and put important keywords in bold using markdown.”
  • Break things down.
    • Help me write the first scene of a story about “<plot idea>”.
    • What is SEO?
      • What are backlinks?
      • What are SERPs?
      • How to get featured snippets?
      • Similarly, you can break questions into sub-questions.

Bonus: Hacks for Human Sounding Responses

Write in the style of <famous-personality> (pre-2021)

Example Prompt 1:Promote my AI copywriting tool in style of Neil Patel (He’s a digital marketer)

Image 5

Example Prompt 2: How did Dinosaurs become extinct? Explain in the style of David Attenborough. (A famous documentary presenter)

ChatGPT’s response:

Image 7

Act as <Persona>

Example Prompt: Act as a film critic. Write a review for the movie “The Godfather”. Critique what it does well and where it fails.

Image 6

You can ask ChatGPT to act as a teacher (kindergarden, high-school, etc), professor, historian, author, etc. The accuracy of its role play can be improved if you ask it what aspects would a <persona> focus on while doing <task>.

For example, for film critic, you could first ask ChatGPT: “What criteria do film critics use to judge a film?”

Then you could ask those criteria to your “Act as” prompt.

Troubleshooting

ProblemFix
Vague responsesMake the prompt specific. Avoid open-ended or broad questions.
Not sticking to constraintsUse “must” in instructions. Add constraint in the starting of prompt.
Wrong at mathsLanguage models like ChatGPT are not suited for maths. They are good at language tasks.
RepetitiveRedirect it to consider other aspects of the question by explicitly naming those. Or, start a new thread.
Technical issues like error while generating responseStep out of the thread and then click back into it (reloading thread). Other issues might be server side and can only be fixed by OpenAI. Try after some time.

GPT-4 Update

Update: OpenAI has launched GPT-4, a successor to ChatGPT, that understands both images and text input and beats it at every task. Read our live coverage of GPT-4 statistics, abilities, and limitations.

Key highlights:

  • GPT-4 is a large multimodal language model that can accept both image and text inputs.
  • It is a successor to GPT 3.5 which currently powers ChatGPT.
  • While it can understand both text and images, its output is in text only.
  • GPT-4 is available through GPT-4 waitlist and in ChatGPT plus (paid version of ChatGPT).

ChatGPT vs GPT-4

GPT-4 is:

  • More precise. Answers are more relevant.
  • More accurate. Facts are less wrong.
  • Capable of describing images in detail.
  • For example, you could give it an image of the contents of your fridge and it can tell you what recipes you can make from the ingredients.
  • Better at editing with a superior ability to spot errors in the text.
  • Scaringly good at acing professional tests and exams.
  • Better at making jokes.
  • Much longer context memory at 24,000 words (GPT-4 API)

Research References

[1] Zhao et al. “Calibrate Before Use: Improving Few-shot Performance of Language Models.” ICML 2021

[2] Liu et al. “What Makes Good In-Context Examples for GPT-3?” arXiv preprint arXiv:2101.06804 (2021).

[3] Lu et al. “Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity.” ACL 2022

[4] Ye et al. “In-Context Instruction Learning.” arXiv preprint arXiv:2302.14691 (2023).

[5] Su et al. “Selective annotation makes language models better few-shot learners.” arXiv preprint arXiv:2209.01975 (2022).

[6] Rubin et al. “Learning to retrieve prompts for in-context learning.” NAACL-HLT 2022

[7] Wei et al. “Chain of thought prompting elicits reasoning in large language models.” NeurIPS 2022

[8] Wang et al. “Self-Consistency Improves Chain of Thought Reasoning in Language Models.” ICLR 2023.

[9] Diao et al. “Active Prompting with Chain-of-Thought for Large Language Models.” arXiv preprint arXiv:2302.12246 (2023).

[10] Zelikman et al. “STaR: Bootstrapping Reasoning With Reasoning.” arXiv preprint arXiv:2203.14465 (2022).

[11] Ye & Durrett. “The unreliability of explanations in few-shot in-context learning.” arXiv preprint arXiv:2205.03401 (2022).

[12] Trivedi et al. “Interleaving retrieval with chain-of-thought reasoning for knowledge-intensive multi-step questions.” arXiv preprint arXiv:2212.10509 (2022).

[13] Press et al. “Measuring and narrowing the compositionality gap in language models.” arXiv preprint arXiv:2210.03350 (2022).

[14] Yao et al. “ReAct: Synergizing reasoning and acting in language models.” ICLR 2023.

[15] Fu et al. “Complexity-based prompting for multi-step reasoning.” arXiv preprint arXiv:2210.00720 (2022).

[16] Wang et al. “Rationale-augmented ensembles in language models.” arXiv preprint arXiv:2207.00747 (2022).

[17] Zhang et al. “Automatic chain of thought prompting in large language models.” arXiv preprint arXiv:2210.03493 (2022).

[18] Shum et al. “Automatic Prompt Augmentation and Selection with Chain-of-Thought from Labeled Data.” arXiv preprint arXiv:2302.12822 (2023).

[19] Zhou et al. “Large Language Models Are Human-Level Prompt Engineers.” ICLR 2023.

[20] Lazaridou et al. “Internet augmented language models through few-shot prompting for open-domain question answering.” arXiv preprint arXiv:2203.05115 (2022).

[21] Chen et al. “Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Tasks.” arXiv preprint arXiv:2211.12588 (2022).

[22] Gao et al. “PAL: Program-aided language models.” arXiv preprint arXiv:2211.10435 (2022).

[23] Parisi et al. “TALM: Tool Augmented Language Models” arXiv preprint arXiv:2205.12255 (2022).

[24] Schick et al. “Toolformer: Language Models Can Teach Themselves to Use Tools.” arXiv preprint arXiv:2302.04761 (2023).

[25] Mialon et al. “Augmented Language Models: a Survey” arXiv preprint arXiv:2302.07842 (2023).