Most of us use ChatGPT wrong
We don’t include examples in our prompts. We ignore that we can control ChatGPT’s behavior with roles. We let ChatGPT guess stuff instead of providing it with some information. This happens because we mostly use standard prompts that might help us get the job done once, but not all the time. We need to learn how to create high-quality prompts to get better results. We need to learn prompt engineering! And, in this guide, we’ll learn Unlocking ChatGPT’s Secrets: Rise Above 99% of Users with These Pro Tips used in prompt engineering.
Few Shot Standard Prompts
Few shot standard prompts are the standard prompts we’ve seen before, but with examples of the task in them.
Why examples? Well, If you want to increase your chances to get the desired result, you have to add examples of the task that the prompt is trying to solve.
Few-shot standard prompts consist of a task description, examples, and the prompt. In this case, the prompt is the beginning of a new example that the model should complete by generating the missing text.
Here are the components a shot standard prompts.
Here’s the standard prompt that most would use.
Extract the airport codes from this text: “I want to fly from Orlando to Boston”
This might get the job done, but sometimes it might not be enough. In such cases, you have to use few shot standard prompts. Extract the airport codes from this text:
Text: “I want to fly from Los Angeles to Miami.”
Airport codes: LAX, MIA
If we try the previous prompt on ChatGPT, we’re going to get the airport code in the format we specified in the example (MCO, BOS)
Keep in mind that previous research found that the actual answers in the examples are not important, but the labelspace is. A labelspace is all the possible labels for a given task. You could improve the results of your prompts by even providing random labels from the labelspace.
Let’s test this by typing random airport codes in our example.
Extract the airport codes from this text:
Text: “I want to fly from Los Angeles to Miami.”
Airport codes: DEN, OAK
Text: “I want to fly from Nashville to Kansas City.”
Airport codes: DAL, IDA
Whether your examples are correct or not, include random labels from the labelspace. This will help you improve results and instruct the model on how to format the answer to the prompt.
Sometimes the default behavior of ChatGPT isn’t enough to get what you want. This is when you need to set a role for ChatGPT.
Say you want to practice for a job interview. By telling ChatGPT to “act as hiring manager” and adding more details to the prompt, you’ll be able to simulate a job interview for any position.
As you can see, ChatGPT behaves like he’s interviewing me for a job position.
You only need to start your prompt with the words “Act as a … ” and then add as many details as possible. If you need some inspiration, check this repository where you’ll find prompts to make ChatGPT behave like a stand-up comedian, doctor, and more.
Add personality to your prompts and generate knowledge:
These two prompting approaches are good when it comes to generating text for emails, blogs, stories, articles, etc.
First, by “adding personality to our prompts” I mean adding a style and descriptors. Adding a style can help our text get a specific tone, formality, domain of the writer, and more.
Write [topic] in the style of an expert in [field] with 10+ years of experience.
To customize the output even further we can add descriptors. A descriptor is simply an adjective that you can add to tweak your prompt.
Say you want to write a 500-blog post on how AI will replace humans. If you create a standard prompt with the words “write a 500-blog post on how AI will replace humans,” you’d probably get a very generic post.
However, if you add the adjectives such as inspiring, sarcastic, intriguing, and entertaining, the output will significantly change.
Let’s add descriptors to our previous prompt.
Write a witty 500-blog post on why AI will not replace humans. Write in the style of an expert in artificial intelligence with 10+ years of experience. Explain using funny examples
In our example, the style of an expert in AI and adjectives such as witty and funny are adding a different touch to the text generated by ChatGPT. A side effect of this is that our text will be hard to detect by AI detectors (in this article, I show other ways to fool AI detectors).
Finally, we can use the generated knowledge approach to improve the blog post. This consists in generating potentially useful information about a topic before generating a final response.
For example, before generating the post with the previous prompt we could first generate knowledge and only then write the post.
Generate 5 facts about “AI will not replace humans”
Once we have the 5 facts we can feed this information to the other prompt to write a better post.
# Fact 1
# Fact 2
# Fact 3
# Fact 4
# Fact 5
Use the above facts to write a witty 500-blog post on why AI will not replace humans. Write in the style of an expert in artificial intelligence with 10+ years of experience. Explain using funny examples
If you’d like to learn more about prompt engineering, here are 4 Free Prompt Engineering Courses you can take to join the top 1% of ChatGPT users, and here are some Midjourney prompt engineering techniques to create better images.