How to GPT-3!

A primer thread on GPT-3 prompt structure:
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. Image
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. Image
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. Image
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. Image
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: ImageImage
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!

@un1crom @AndrewMayne @_bramses @apilipis

Thanks as always to @gdb @OpenAI for this groundbreaking tech!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Matt Shumer

Matt Shumer Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!