Get way better output from ChatGPT in just a few minutes
👉 Zero, One & Few Shot Prompting, Let's take a look at what these things are and how you can use them to your advantage.
With the right mix of creativity and technical skill, these powerful tools can be combined to create text-generation results with impressive accuracy and flexibility for all types of applications.
Doing these types of edits is often referred to as "prompt engineering".
Let's look at how some simple prompt engineering can impact your outputs from ChatGPT and other Large Language Models.
We will take a look at zero-shot, one-shot, and few-shot prompting, and how it affects the results.
What is Zero-Shot Prompting?
Zero-shot prompting enables a ChatGPT to make predictions about previously unseen data without the need for any additional information or training, simply ask it anything.
This is the standard form and allows for the creation of more diverse and dynamic text generation from ChatGPT, enabling it to recognize and classify objects without ever having seen any examples of those objects prior.
This is essentially what happens when you ask ChatGPT to:
💬 "Write an introduction on flamingos"
We are getting a response from ChatGPT without us giving any previous context or hint on the expected output. This is how most of us use the ChatGPT interface when we ask something using a standard opening phrase.
What is One Shot Prompting?
We'll give ChatGPT one example of the output structure we would like to get back, ChatGPT will then guess what we want in return based on our example, and try to mimic and match the desired output.
Using the Flamingo introduction as an example again, we provide the structure we would like to see.
We then ask it for an introduction for the crocodile following the same structure as we provided.
The output now follows the same structure as our Flamingo introduction.
With One-Shot prompting, we can assume we will get what we are looking for, but it's possible that ChatGPT will not produce the desired output repeatedly, so for that, we would need to go one step deeper.
Let's move on to Few-Shot Prompting.
What is Few-Shot Prompting?
Few-shot simply means we will give ChatGPT 3 > or more examples of the output structure we would like to get back.
ChatGPT will then guess with much higher accuracy and reliability what we want in return based on our examples.
Let's give ChatGPT 3 examples of the output structure we would like to get back:
We can then simply just ask it to:
💬 Write an introduction on Dolphins
The returned results will be following the format and scope we provided most likely every single time.
I took an arbitrary example here with some nonsense about animals, so I'd like to maybe look at something a bit more useful than descriptions of animals
Although the animal example is interesting in its own way.
Let's for example see how we can use the Few-Shot prompting technique to generate a phone book directory (yes even more useless 🤣)
By providing a few examples of the structure we would like to see, we can ask ChatGPT to complete/fill in the blanks.
We can then take it a step further and just ask it to generate 5 more persons for use. This could be useful if you are designing, or mocking up content for example.
We can transform the content into a table, and from here we can just ask ChatGPT to continue to fill the table.
Remember we made this possible by using the Few-shot prompting technique in the beginning.
This can be particularly useful if you are creating content in a set format over and over again, or are using templates for repeating tasks such as sending emails in a specific format or tweeting about animals in a fixed format.
The power of Few-shot is to provide consistency and a similar format to something that you want ChatGPT to create
Since ChatGPT also has memory, each conversation you have keeps a memory of the entire conversation, so when starting out like this, it's now trained in that context.
Because of the memory in each chat, we can now ask just for 10 more animals, and it will continue to follow the structure we provided above.
Extremely useful, I can now set up and automate 15 tweets about different animals and have them scheduled daily for 15 days, all within minutes of using ChatGPT and Few-Shot Prompting.
Conclusion
Prompt engineering techniques such as zero-shot, one-shot and few-shot prompting can give you more flexibility and control when creating outputs from ChatGPT.
By taking advantage of the power of ChatGPT, you can create more accurate, diverse and engaging outputs that are tailored to the needs of your application.
Thank you for being here. I’ll be writing weekly AI tips & tricks, and I’ll be publishing guides on how you can utilize the new AI tools and services to supercharge yourself in this new paradigm shift.
Follow me on Twitter
Don’t forget to check out what I’m building over at
bedtimestory.ai - a storytelling app for kids
Feel free to share this post with a friend or two, it would mean a lot to me