WEBVTT

00:00.500 --> 00:08.690
Few shot prompts work by presenting the AI model with a small number of examples or shots of a particular

00:08.690 --> 00:12.500
task or concept, along with the prompt or instruction.

00:12.500 --> 00:19.490
So the model then uses these examples to generate or classify new data that is similar to the examples

00:19.490 --> 00:20.450
provided.

00:20.780 --> 00:27.170
Few shot prompts are particularly useful in scenarios where there is limited data available for a given

00:27.170 --> 00:34.130
task, such as a new language or domain where the data may be scarce, and they are useful for quickly

00:34.130 --> 00:40.970
adapting models to new tasks and domains, as they can be used to fine tuning existing models without

00:40.970 --> 00:43.580
requiring a large amount of new data.

00:44.060 --> 00:50.690
So in few shot prompting, we can have a one shot prompt where the model is given just one example of

00:50.690 --> 00:56.450
the results we want, and we have a few shots prompting, which is the model is giving a small number

00:56.450 --> 00:58.220
of the results that we want.

00:59.090 --> 01:05.190
So basically the one shot prompt is a subset of the few shot prompting.

01:05.190 --> 01:12.390
So because here n which is the number of prompts is equals to one where in a few shots prompting n is

01:12.390 --> 01:13.470
greater than one.

01:14.100 --> 01:20.550
Okay, so now it's time to have an elaborate example which will demonstrate zero shot, one shot, and

01:20.550 --> 01:23.790
few shot prompting and all of its use case.

01:23.790 --> 01:28.860
So we're going to compare the outputs that we get from the zero shot one shot and few shots.

01:28.890 --> 01:33.210
And we're going to see which one performed better according to our tasks.

01:33.420 --> 01:33.930
Okay.

01:33.930 --> 01:35.100
So what's our task?

01:35.100 --> 01:41.220
What you see right now is a discord server for an open source AI tool called Blue Willow.

01:41.250 --> 01:43.650
What you do in this tool is apply prompts.

01:43.650 --> 01:50.370
You write slash, imagine, then supply the prompt and this tool simply generates an image from your

01:50.370 --> 01:50.940
prompt.

01:50.970 --> 01:52.980
Now that's pretty standard.

01:52.980 --> 01:57.360
And it's the text to image technology that we're all familiar with.

01:57.390 --> 02:04.140
However, what we're going to do now to demonstrate the zero one shot and few shot prompts is to try

02:04.140 --> 02:11.990
all those techniques in a text to text manner that will generate for us the text to input blue Willow

02:11.990 --> 02:13.730
in order to generate the image.

02:13.730 --> 02:19.370
So our task is to generate a good description to paint our pictures.

02:19.910 --> 02:23.150
Okay, so let's start by writing a zero shot prompt.

02:23.150 --> 02:29.750
In the prompt we say write an image descriptions with adjectives and nouns of a Yorkshire dog running

02:29.750 --> 02:31.670
in the winter landscape of Brazil.

02:31.910 --> 02:35.330
Okay, so first let's analyze this prompt.

02:35.360 --> 02:39.530
Now we can see that the task is write an image description.

02:39.530 --> 02:45.650
We have a bit of context which is what to draw, which is a Yorkshire dog running in the winter landscape.

02:45.650 --> 02:53.540
In Brazil, we don't have any specific input data to process, and the output indicator is pretty much

02:53.570 --> 02:54.200
implicit.

02:54.200 --> 02:57.050
We are simply expecting the answer right away.

02:57.410 --> 03:01.460
Okay, so why is this prompt a zero shot prompt?

03:01.490 --> 03:05.810
Now it's a zero shot prompt because we didn't supply it with examples.

03:05.810 --> 03:12.420
And the AI model is simply now guessing and doing its best effort to provide us with an output that

03:12.420 --> 03:13.110
would like.

03:13.110 --> 03:16.410
But we can see that the output that we get is pretty good.

03:16.440 --> 03:22.290
I mean, we get an elaborate description that we can plug in, and it really describes an image.

03:22.290 --> 03:27.300
We'll soon also plug it in to discord and to see what image this generates.

03:28.200 --> 03:28.860
Okay.

03:28.860 --> 03:34.800
So now we want to refine our prompt to be using the one shot prompting technique to supply our prompt

03:34.800 --> 03:42.570
with one example of how we expect the output to be, and to help guide the AI model to output us what

03:42.570 --> 03:43.350
we want.

03:43.380 --> 03:47.670
Okay, so we're going to implement the one prompt prompting technique right now.

03:47.880 --> 03:53.070
So the prompt is write a compressed perfect image description with adjectives and nouns of a Yorkshire

03:53.100 --> 03:56.070
dog running in the winter landscape in Brazil.

03:56.100 --> 04:05.340
Then we gave it a bunch of nouns and adjectives blue dog, shimmering snow, etc. we then gave it the

04:05.340 --> 04:11.760
output indicator, which would simply tell the AI model that it needs to start working, and now we

04:11.790 --> 04:14.220
are expecting the answer from it.

04:14.310 --> 04:18.390
So the answer we get from it is better.

04:18.390 --> 04:22.890
We can see that first of all, the answer is more compressed.

04:22.890 --> 04:28.860
So this is because we also gave it the compressed context in the A prompt before.

04:28.890 --> 04:36.930
However, we can see that we are using much more adjectives and this looks better and concise.

04:38.910 --> 04:45.180
Okay, now in the last prompt, which is a few shot prompt, we're going to give it a few examples and

04:45.180 --> 04:47.670
we'll see what it is outputting us.

04:47.700 --> 04:55.950
Now we can see right over here that we supplied three different examples where the first example is

04:55.950 --> 05:02.190
saying that we want a dog which is blue, the second a red dog, and the third is a green dog.

05:02.220 --> 05:02.700
Okay.

05:02.700 --> 05:07.740
So the AI model understands that we want a color describing the dog.

05:10.230 --> 05:15.090
So let's take a look at the response that we get back from the model.

05:15.090 --> 05:19.930
And we can see that we got a vivacious violet Yorkshire dog.

05:19.960 --> 05:20.260
Okay.

05:20.290 --> 05:27.220
So the AI model understood from the examples we gave it before we gave it Blue Dog, Red dog, green

05:27.220 --> 05:27.700
Dog.

05:27.700 --> 05:32.920
So it understood that we want a color to describe the dog at the beginning.

05:33.580 --> 05:38.290
Now notice in the description we one time said the dog was sweating.

05:38.290 --> 05:41.470
We then said it was crying okay.

05:41.470 --> 05:45.790
And now it returned us that its fur is fluttering.

05:45.820 --> 05:53.050
Okay, so it's very, very cool that it understands exactly what we wanted because we wanted something

05:53.080 --> 05:55.030
to describe the dog.

05:55.090 --> 05:55.270
Okay.

05:55.300 --> 05:57.880
So this is very, very cool in my opinion.

05:58.870 --> 05:59.500
Okay.

05:59.500 --> 06:06.850
So now we want to take the output, which is an image description that we got from our AI model which

06:06.850 --> 06:07.990
was auto generated.

06:07.990 --> 06:10.870
And let's plug it in to Blue Willow and take a look.

06:10.870 --> 06:12.790
Which pictures do we get.

06:13.030 --> 06:17.740
Now the first one is the long description of the Yorkshire dog.

06:17.740 --> 06:19.270
We can see it right over here.

06:19.300 --> 06:22.870
Seems very cute, but the I didn't really know what we wanted.

06:22.870 --> 06:24.250
We didn't supply it examples.

06:24.250 --> 06:31.240
It was with a zero shot prompt, so the model pretty much guessed what we would expect to be a good

06:31.240 --> 06:31.870
answer.

06:31.900 --> 06:32.170
Okay.

06:32.200 --> 06:33.520
And it did a pretty good job.

06:33.550 --> 06:37.060
I mean, it had the creative freedom to do whatever it likes.

06:37.060 --> 06:40.540
So it gave us something very cool that we can work with.

06:41.380 --> 06:48.970
So this description was generated by the one shot prompt where we supplied one example of the adjectives

06:48.970 --> 06:50.920
and nouns that we want to use.

06:50.920 --> 06:53.320
So you can see it right over here.

06:53.320 --> 06:57.250
So in this context I don't think it's much better than the first one.

06:57.250 --> 06:59.680
So the first one did a pretty good job over here.

07:00.070 --> 07:08.110
And the last one is my favorite because we can see that what the AI model generated was exactly what

07:08.110 --> 07:11.380
we wanted, because we wanted the color of the dog in the beginning.

07:11.380 --> 07:17.110
So if we ran this query again and again and again, we would have gotten differently generated colors

07:17.110 --> 07:18.160
to describe the dog.

07:18.160 --> 07:19.600
So this is pretty much cool.

07:19.600 --> 07:22.240
Now let's compare all the photos all together.

07:22.240 --> 07:22.270
Altogether.

07:22.480 --> 07:29.710
So now we can really see the difference between the output that we got for the zero shot, the one shot

07:29.710 --> 07:31.300
and the few shot prompts.

07:31.330 --> 07:31.960
Okay.

07:31.960 --> 07:37.600
So in this case those pictures are not necessarily one better than another.

07:37.600 --> 07:41.320
And they're pretty much very similar to each other.

07:41.710 --> 07:47.260
However, the most important thing that you need to realize when it comes to few shot prompting is simply

07:47.260 --> 07:50.830
the number of examples that you give the AI model.

07:50.980 --> 07:58.030
The more answers and the more examples that you give it to train on your data, then it knows to adjust

07:58.030 --> 08:02.890
and to fine tune the results to give you something that you would like.

08:02.920 --> 08:12.940
Okay, so it would give it less artistic or freedom to do whatever it wants and guess and make the output

08:12.940 --> 08:16.330
more precise and to be more of your likings.

08:16.360 --> 08:23.470
Okay, so that's why it's important to know the difference between zero shot, one shot and few shot

08:23.470 --> 08:24.190
prompts.
