Prompt Engineering: How to Write Better ChatGPT Prompts

Conversational large language models (LLMs), or chatbots, like ChatGPT have taken the world by storm in 2023 being heralded as a new age of business opportunity. The opportunity to increase output efficiency by orders of magnitude.

However, you quickly realize there are certain limitations. Perhaps it reuses the wording from your prompt or provides a response in a generic format. With LLMs, complexity in the prompt helps steer its response, providing richer outputs. Remember what we talked about with Megaprompts: ‘garbage in, garbage out’ – your prompt is a set of instructions that will help enhance (or hinder) the capabilities of the LLM.  

Simply put, a chatbot will be most effective when you give it structure. There are many ways to do so – we’ll review a few popular structures that can be used to facilitate better conversation and enhance output.

  1. Persona
  2. Question Refinement
  3. Flipped Interaction

Italicized lines will represent example inputs.

Persona

Give the chatbot a point of view or perspective. For example, you can ask the LLM to provide responses as if it were a media buyer. I recommend making the persona as descriptive as possible to provide the most context, such as:

“You’re a media buyer that works at a top ad agency and has extensive knowledge in developing target audiences and persona profiles for client x, that specializes in sales of product x, which does these three things: x, y, z.”

From here, you’ll need to define the output. This can be done simply by asking something like ‘provide a target audience for client x that a media buyer would create’. However, once again, I recommend making your instructions as detailed as possible. For example:

“Provide a target audience for client x that contains demographic, geographic, and psychographic factors. Include several options for where this audience is most likely to spend their time online and some top affinity attributes.”

Question Refinement

It’s possible that you may not always know how best to phrase a question when interacting with an LLM. One way to work around this is to use it to devise the best possible prompt. Use this approach to find the right question to ask to answer your question.

To start, you will need to provide a scope the LLM can work within. This can be as simple as the topic you are asking questions about. For example,

“From now on, whenever I ask you a question about marketing strategy…”

You will need to follow up with the action required. In this case, you want the LLM to suggest a better prompt using it’s understanding of the topic, such as:

“suggest a better version of the question that includes information specific to the media planning process and the elements required to develop a marketing plan.”

The next step is optional, but it can save you time if you plan on creating a lot of iterations. This step allows the LLM to automatically use the revised question, saving the time to copy/paste. You can phrase it as an additional sentence at the end of the prompt:

“Ask me if I would like to use your question instead”

You should always be wary of inaccurate information whenever using a LLM – it’s possible inaccuracies could end up in the revised question. One way to mitigate this is to have the LLM ask questions that will help inform its response. This way you will be able to provide input prior to the generation of a new prompt. This can be done by asking:

Whenever I ask a question, ask 3 additional questions that will help you provide a better version of my original question. Use my answers to suggest a better version of the original question.”

If the LLM includes terms or topics that you are not familiar with, you can also include instructions to have it explain the ideas further. This will blend the Question Refinement pattern with the Persona pattern we discussed above. For example:

Question Refinement: Whenever I ask a question, ask 3 additional questions that will help you provide a better version of my original question. Use my answers to suggest a better version of the original question.”

Persona:Act as if you know nothing about marketing strategy or media planning and define any terms that I need to know to answer your questions.”

Flipped Interaction

As we learned in the Question Refinement pattern, the LLM knows much more than we do, including how to craft effective prompts. The Flipped Interaction approach assigns the job of asking questions to the LLM, as opposed to us asking the questions. This helps it better select the content and format, and ultimately reach the goal faster.

Similar to the previous two structures, you need to define a goal.

ask me questions that will aid in crafting a target audience”.

Since we have set a specific topic along which the LLM can ask questions, our conversation will stay relevant to the ultimate goal. The next step involves setting limits on how the long the conversation should continue. You can simply state ‘stop asking questions’, but it would be better set a scope to the interaction. A simply method that works well is:

ask questions until you have enough information to build a target audience”

 One final consideration is to limit the number of questions the LLM asks at a time. This is entirely optional, but can improve the LLM’s line of questioning. Otherwise, it may ask one question at a time, or ten questions at a time which can be overwhelming and repetitive. To limit the question sequence, you can state the following, replacing ‘x’ with the number you desire:

ask questions ‘x’ at a time”

These structures are just a starting point, and by no means an exhaustive list. I encourage you to test these ideas and use them all in conjunction for richer conversations. Remember we’re still learning the best ways to interact with LLMs, so don’t be afraid to test new structures. And feel free to share if you do!

Sources

1. Jules White, Quchen Fu, Sam Hays, Michael Sandborn, Carlos Olea, Henry Gilbert, Ashraf Elnashar, Jesse Spencer-Smith, and Douglas C Schmidt. 2023. A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT (2023).

2 thoughts on “Prompt Engineering: How to Write Better ChatGPT Prompts”

  1. What’s up everyone, it’s my first pay a visit at this web site,
    and piece of writing is truly fruitful for me, keep up posting
    these types of content.

Leave a Comment

Your email address will not be published. Required fields are marked *