#3 Few-shot prompting

Welcome to all the new subscribers!

This is The Prompt Engineer and we share the hottest tips and tricks to use ChatGPT and other Large Language models.

Free education delivered to your inbox from Monday to Friday.

And the best thing?

No fluff, only real and raw value.

Sounds good?

Let’s go!

Few-shot prompting

One of the main improvements of ChatGPT was its accuracy when it comes zero-shot prompting.

Zero-shot prompting is a fancy name for asking ChatGPT to do something without providing examples.

But no matter how good the language model is, often it can’t read minds.

And in these cases, providing examples to ChatGPT is necessary to teach the model certain rules.

How does it work in practice? Here’s an example.

In this case we provided a few (typically 2-5) examples in the form of input-output pairs.

This way, we can teach our model the rules, so when we add a new sentence (
“I’m so excited…”) it creates the output according to these rules (“Positive“).

This is a very powerful technique when it comes to data manipulation, text classification, summarization and more. Here’s a full list of the potential applications.

In the coming days we’ll use few-shot prompting for more fancy applications such as generating prompts for AI image generators (Midjourney, Stable Diffusion etc.) and data manipulation.

How did you like this tutorial? Reply to this email with your feedback, I personally read all emails!

Have a nice rest of the day.

Best,

Gabor Soter, PhD

A little about me:

  • did my PhD in Europe’s largest AI and robotics research lab

  • worked as software engineer and CTO at Y-combinator-backed and AI startups

  • in my previous startup my team worked with OpenAI