Master The Perfect ChatGPT Prompt Formula
Here's a recipe that you can follow.
I have spent hundreds of hours in various prompt engineering courses and constantly tested different possible structures to build a formula that can bring me closer to high-quality responses from AIs such as ChatGPT, Bard, and Claude.
Hera are 6 basic elements that a good prompt should have.
The 6 Prompt Components
The first thing we need to understand is that the following elements are listed in descending order based on their importance. These elements are task, context, exemplar, persona, format, and tone.
Let’s look at it with a simple example.
The first half of the entire example is the context, and the remainder is the task, where the latter is the most important (more than the context).
Thus, if we only input tasks individually into ChatGPT, we will still get some meaningful results. Let’s look at the following example:
The opposite happens if we only provide the context to ChatGPT. Let’s look at the following example:
So, we can say that every time we need to build a prompt, it is almost a duty to include a task, which should be complemented with context and examples. The persona, format, and tone are like the ornaments on the Christmas tree (of course they are important, but without the tree to support them, they wouldn’t be as relevant).
When you build your next prompt, I recommend that you create a mental checklist, which would be as follows:
You can also review the formula to include the outlined points or directions. Likewise, include sufficient relevant information. Later in this article, we will see that a good prompt doesn’t necessarily have to include these 6 elements.
Now let’s start analyzing each of these six elements in detail.
1. Task
The key principle we should keep in mind is to always start the task sentence with an action verb (generate, drive, write, analyze, etc.) and clearly state your end goal.
For example, we can generate a 3-month training plan or complex 3-step tasks (which include analysis, summary, and categorization).
2. Context
The second element might sometimes be too broad because technically the information you can provide is infinite. I found that asking these 3 questions can help you narrow down your options.
Always remember to provide ChatGPT with enough information so that it can produce high-quality results.
Now let’s go back to the example mentioned at the beginning of this article, where I provide my background (1), write what I want to achieve (2), and finally describe the environment where all of this will happen (3).
The key to ensuring efficient use of ChatGPT and Bard is to provide them with enough information to limit their infinite potential responses.
3. Exemplars
Studies conducted on all major language models have shown that including examples in prompts will yield better-quality answers.
Let’s look at the example below, where I take an excerpt from a resume and have ChatGPT rewrite all this information through a structure of achievement, measurement, and impact (Task). I also provide an explicit and detailed example to give it more information on how it should proceed.
Now let’s look at a job interview example. Based on my resume, I can ask ChatGPT to use the STAR method to identify my weaknesses.
Prompt:
Based on my own resume, please help me structure an answer to the interview question: “What’s your biggest weakness?Use the STAR answer framework: Situation, Task, Action, and Results
Here’s my resume for reference:
[Put your resume here]
Here’s the result.
Now, if you want to write a job description for a position within your team, you could initially give ChatGPT a description of the situation (context), and then you can provide a reference based on an already prepared description (example).
In this case, you could use a LinkedIn role description, as ChatGPT will generate a response imitating its format and expression of professional language, consistent with the tone of an HR specialist.
Prompt:
You’re a hiring manager in the marketing team responsible for writing the job description for a B2B product marketing manager job openingYour team primarily focuses on increasing brand awareness for Netflix’s adverting platform with the goal of acquiring new advertising partners
Please draft the job description using the format of this existing job description below:
[put the job description here]
Here’s the result.
We will definitely save a lot of time!
Exemplars are not necessary for every prompt but including a relevant example greatly improves the quality of your output
4. Persona
This is the role you would like the AI to take. Imagine you have a problem and would like to consult a specialist to address these doubts. For example, if you injure yourself while exercising, the person you would go to is a rehabilitation therapist who has years of experience treating athletes. If you’re looking for a job, the person you’d ask for advice would be a recruiter.
You can also specify a particular persona, but only when it’s sufficiently famous. The results will be even better.
Let’s look at the following example, where I ask ChatGPT to take on the personality of Batman when drafting an email.
Here’s the result I got.
5. Format
You can ask ChatGPT to follow a specific format in its responses.
In this case, we’re going to analyze the prices of traditional dishes for an upcoming trip to Peru. I’ll ask ChatGPT to show me a table containing columns for places to visit, typical dishes, and their prices.
Here’s the result.
We can also obtain formats like markdowns, bullet points, and code blocks.
Let’s have a look at the following example.
Here’s the result.
6. Tone
The last element can help us customize ChatGPT responses even further.
If you don’t know the tone you need for a specific situation, ChatGPT can help you come up with some keywords. Here’s an example.
Here are the keywords I got.






































