How to Write Prompts to Get the Best Results

Maxwell Timothy

Maxwell Timothy

on Mar 12, 2024

13 min read

ChatGPT is unarguably one of the most popular AI tools in the world. Its launch in November 2022 has completely changed how we think about and approach the topic of artificial intelligence. The tool has rapidly gained a foothold in almost every field you can think of. From business, creative writing, education, finance, healthcare, you name it. ChatGPT has shown its worth even in the most unexpected places.

Using the tool is simple; describe what you need done and ChatGPT responds with a solution in seconds. But there's a catch. Although ChatGPT is quite adept at a lot of fields and can provide high-quality responses to questions you ask, the results you get from ChatGPT are only as good as the prompts you provide. In other words, the better you present your problems; the better the results you get.

But being able to present your problems the right way to an AI chatbot is a skill. Here are some of the best prompting techniques for ChatGPT you should learn right away.

1. Provide Clear and Specific Instructions:

Once you open the ChatGPT interface, you are probably doing so with a problem to solve in mind. Want to write lyrics to a song? Want to solve a math problem? Want to analyze some business data? Whatever that problem is, you need to turn it into a clear and specific instruction for ChatGPT to follow.

For instance, it's not enough to say you want ChatGPT to write the lyrics to a pop song for you. What kind of pop song? How long should it be? What are some style features you want to see in the song? There's always a good chance you have an idea of how you want the lyrics to be. ChatGPT is a powerful tool; it's a whole lot of things, but it's not a mind reader. Put out as many details as you have in your mind about the problem and your chances of getting an impressive result that aligns with what you have in mind significantly increase.

So, instead of prompting:

Write me lyrics for a pop song about love

Here's an example of a more descriptive and specific prompt for ChatGPT:

Write the lyrics to an uptempo, feel-good pop song about falling in love for the first time. The song should be 3-4 minutes long when performed, with verses of 4 lines each, a pre-chorus of 2 lines, a chorus of 4 lines, and a bridge section in the middle. The lyrics should have a youthful, optimistic vibe celebrating the giddy rush of new romantic feelings, but without being too cheesy or clichéd. Use modern pop songwriting techniques like hooks, repetition, and rhyming couplets. The overall tone should be energetic and danceable.

This provides clear guidelines on the song's topic, desired length, structure with specified sections like verses and choruses, emotional tone and perspective, and stylistic elements. Having those specific details allows ChatGPT to generate lyrics that closely match your vision and requirements for the pop song. Of course, your prompt doesn’t have to be about a song, or as specific as the one, but always try to give the chatbot as much information as possible.

2. Split Complex Problems into simpler instructions

Some of the problems you try to solve with ChatGPT are going to be simple and straightforward. Others are going to be multilayered and complex. Rather than lumping instructions together, the best way to write a prompt for a complex problem is to break it down into smaller bits and feed it into ChatGPT in a single prompt, or preferably different prompts.

Here's an example of splitting a complex problem into simpler instructions:

Bad way to prompt:

"Write a research paper on the effects of climate change on ocean ecosystems, including causing sea level rise, ocean acidification, warming temperatures, and disruptions to marine food webs. The paper should be 10 pages long with citations in APA format."

This prompt covers too many different components of a complex topic into a single, complex request. It would be very difficult for ChatGPT to adequately address all those aspects well in one response.

A better way is to break it down into steps:

1) "Provide a 1-paragraph high-level overview summarizing the major effects of climate change on ocean ecosystems."

2) "Write a 2-paragraph detailed explanation of how climate change causes sea level rise and impacts coastal regions."

3) "Describe the process of ocean acidification due to higher CO2 levels and its consequences for marine life in 2 paragraphs."

4) "In 3 paragraphs, explain how warming ocean temperatures disrupt marine food webs and ecosystem dynamics."

5) "Give me an outline for a 10-page research paper on the effects of climate change on oceans, with those 4 topics as the main sections."

6) "Using the outline, draft the full 10-page research paper including introductory and concluding paragraphs. Make sure to include in-text citations for any sources used."

By breaking down the complex task into sequential prompts focusing on one component of the problem at a time, ChatGPT can methodically build up a more comprehensive and well-structured response. Also, breaking it apart allows for giving feedback or adjusting instructions for each step along the way.

3. Use Relevant Examples

One of the best prompting techniques for ChatGPT is providing “examples of the solution” or “steps towards solving the problem” that the chatbot will be dealing with. Nothing helps simplify the prompting process as much as a clear template that the chatbot will be following. This template should ideally involve the style, structure, or format of how you want your result to be presented. This gives ChatGPT a clear idea to model outputs after.

It is an important but often neglected technique that can ensure that ChatGPT either behaves or produces results that align with what you have in mind. Examples and illustrations help chatbots like ChatGPT to extract relevant patterns, templates, and approaches that may be left ambiguous in simple descriptions alone.

Take a step back and look at it as if you were training a human to complete a task. You can go on and on with lengthy lectures on how you want something to be done and how you want the result to be. You can get as detailed as possible, but then words can be ambiguous and your best efforts at explanation can get you results that do not align with your goals.

An easy fix for this? Using examples! Examples provide a more practical dimension to your explanation of a problem. It provides clearer steps toward solving a problem than a regular problem description would do.

Here are examples of ways to prompt ChatGPT with and without examples:

Prompt without examples:

"Write a story about a brave knight who goes on an epic quest. Make it exciting and engaging."

This is too vague and doesn't provide any examples for ChatGPT to model. It could interpret "exciting and engaging" in many different ways.

Good example prompt:

"Write a fantasy short story in the style of the opening passage from J.R.R. Tolkien's The Hobbit:

'In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort...'

The story should be about a brave knight who goes on an epic quest to slay a fearsome dragon. Use descriptive language to paint a vivid picture, with elements of fantasy world-building like you'd find in Tolkien's writing."

Providing an actual excerpt as an example of the desired writing style, voice, and genre, gives ChatGPT a clear template to model its own story after. The prompt also specifies key story details like the main character, quest, and fantasy elements to include.

4. Provide Proper Context

Context is one of the most important components of a prompt. Although a lot of people often relegate it to an afterthought, it is what gives your prompt direction and purpose. Remember, there’s a nuance to almost every question you throw at ChatGPT, and without a context within which to operate, there are just too many directions ChatGPT can take. What’s the guarantee that it will take the right one?

Here's an example of a bad prompt lacking context, and a good prompt providing proper context:

Bad Prompt:

"What are the best tips for organizing an efficient supply chain?"

This is too vague and doesn't give ChatGPT enough context to provide a relevant, specific response.

Good Prompt:

"I am a supply chain manager for an e-commerce startup that sells sustainable clothing and accessories. We have been experiencing delays in getting our products from manufacturers to our warehouse due to logistical issues. What strategies would you recommend for optimizing our supply chain to reduce lead times and ensure on-time delivery to our customers? Our priority is cost-effectiveness while maintaining our sustainability practices. Please provide tips geared towards a small e-commerce business like ours."

This prompt sets the context by:

- Specifying it's for an e-commerce startup selling sustainable fashion

- Indicating the current challenge of delivery delays

- Stating the key goals are reducing lead times and ensuring timely delivery

- Noting priorities are cost-effectiveness and maintaining sustainability

- Asking for recommendations tailored to a small e-commerce supply chain

By framing the question with all this pertinent context about the situation, industry, priorities, and constraints, allows ChatGPT to give a focused, practical response customized to this specific supply chain scenario rather than generic advice.

Providing clear context guides ChatGPT to generate more accurate and valuable outputs aligned with the user's actual needs.

5. Define and Explain Constraints

When prompting ChatGPT, it is important to note any limitations, boundaries, or guidelines that should guide the chatbot's responses. Clearly explain if certain types of content should be excluded or if specific rules need to be followed in the outputs. Defining these constraints gives ChatGPT vital context that shapes how it approaches the task.

For instance, you may want to state upfront that responses should be child-friendly with no profanity or explicit content. Or you may set a constraint that generated summaries cannot exceed a certain word count. Other constraints could include excluding personal opinions, sticking to factual information only, or avoiding recommendations of specific brands or products.

Think through any tight restrictions or ethical considerations that need to guide ChatGPT's work. The more details you provide about what is off-limits or mandatory, the better ChatGPT can align its responses to your expectations. Constraints give the AI chatbot helpful creative boundaries when completing tasks.

Here's an example of a bad prompt lacking constraints, and a good prompt clearly defining constraints:

Bad Prompt:

"Write a short story about a family vacation."

This is too open-ended without any guidelines or limitations specified.

Good Prompt:

"Write a short fictional story (300-500 words) about a family vacation that would be appropriate and engaging for elementary school students ages 8-10. The story should have a positive emotional tone and contain no profanity, violence, or mature content. It should reinforce family values like togetherness, communication, and making happy memories. You can be creative with the plot and characters, but please avoid controversial topics or issues that may be upsetting for children. The goal is to write an uplifting story that kids in upper elementary grades could enjoy."

This prompt sets clear constraints by:

- Specifying a target reading level/audience (elementary kids 8-10 years old)

- Excluding certain content like profanity, violence, mature themes

- Mandating a positive emotional tone and family-friendly values

- Limiting the story length to 300-500 words

- Avoiding controversial or upsetting topics for children

- Defining the goal of an uplifting, engaging story for that age group

Laying out these specific constraints and requirements upfront allows ChatGPT to generate an appropriate story within the defined boundaries and guidelines.

Try Your Prompting Skills with Chatbase

While the prompting techniques covered in this article can help you get much better results from ChatGPT, it's important to understand its key limitation–gaps in its training data. ChatGPT's knowledge is massive but limited nonetheless. So for rapidly evolving topics or highly specialized domains where data is limited, ChatGPT may struggle to provide fully accurate or comprehensive responses irrespective of how good your prompts may be.

This is where a tool like Chatbase can be invaluable. Chatbase allows you to create and deploy your own custom chatbots that you can continuously train on the latest data sources relevant to your use case. By providing updated information to your Chatbase chatbot, you can essentially have an AI assistant without the knowledge gaps that plague a tool ChatGPT.

Moreover, you can pre-instruct them on how to properly parse different prompt styles to generate contextually relevant responses, building on the prompting best practices outlined earlier. The more prompts and examples you provide during training, the better your Chatbase chatbot will understand user intent.

So why not put your new prompting skills to the test? Sign up for Chatbase and create your first custom chatbot trained on data from your specific domain. Seamlessly integrate prompting into your chatbot's conversational flows. With Chatbase, you can craft an AI chatbot hyper-tailored to your unique needs.

Build your custom chatbot

You can build your customer support chatbot in a manner of minutes

Get Started