Working with GPT-3 is just a game of figuring out how to structure text to get the results you want.
Here are some methods that work well.
Some of these methods can be used together. There’s an art to figuring out which methods are best for obtaining the results you want.
You can use zero-shot, one-shot, or few-shot methods, depending on the task. Your goal should typically be to zero-shot or one-shot, as latency and costs will be lower.
Here’s a quick primer:
1. Site-model prompts (zero-shot learning):
Think about how something would look on a website.
Ex) if you’re trying to generate an article, mimic the way an article is typically laid out on a news site.
This gives GPT-3 context to better understand what it should be doing.
2. Tell a story (zero-shot learning):
Let’s say you want to want to summarize a paragraph. You can say “My friend saw this paragraph:”, paste the paragraph, then add “He asked me to help him understand it, so I summarized it:”.
Easy to do, but not always reliable.
3. Description + one example (one-shot learning):
Write a description of the task you want to complete, and add one example of the task. Works well for many tasks.
4. Few examples (few-shot learning):
Self-explanatory. Feed a few examples in, making it easy for GPT-3 to pick up the pattern.
Depending on what the task is, this can get quite expensive to do, so only use this approach if you can’t get the other approaches to work.
A note on separating examples:
When your prompt includes examples, it is helpful to include a separator between them.
This enables you to easily stop generating after the task is complete, and it also tends to improve results slightly by keeping generations consistent.
### and “ are good examples of separators.
Here are two ways you can use them:
I hope this helps kickstart many amazing projects with GPT-3! I’ll post more of these tutorials throughout the next few weeks. Stay tuned!
A big thank you to all the incredible people who helped me learn all of this. Hoping I don’t forget anyone here!