WEBVTT

00:01.240 --> 00:03.240
Hello everyone and welcome.

00:03.680 --> 00:07.200
In today's session we will learn about Llama Guard three.

00:07.560 --> 00:13.600
Llama guard three comes in three different flavors now llama guard three 1 billion parameter.

00:14.000 --> 00:19.800
Llama guard three 8 billion parameter and Llama guard 311 B with vision.

00:20.320 --> 00:27.800
Llama guard three 1 billion parameter and llama guard three 8 billion parameter are text only.

00:28.080 --> 00:31.120
Llama guard 3.2 11 b ports.

00:31.160 --> 00:32.600
Vision capabilities.

00:33.040 --> 00:40.080
The multimodal evaluates both text and prompt together in order to classify the prompt that sort of

00:40.080 --> 00:45.000
facts to know about llama guard 311 b vision model.

00:45.360 --> 00:53.760
It is not designed to perform image only classification model is optimized on English only, so text

00:53.760 --> 00:55.640
component should be in English.

00:56.080 --> 00:58.080
There is no multi-image support.

00:58.480 --> 01:01.520
The model evaluates only one image per prompt.

01:01.840 --> 01:07.490
It's also one other notable thing about Lama Garden 3.8 billion parameter.

01:07.930 --> 01:13.090
It can be used for category S14 that is code interpreter abuse.

01:13.850 --> 01:21.250
Lama guard 31B is not fine tuned on on the code interpreter abuse.

01:21.290 --> 01:21.850
All right.

01:22.370 --> 01:26.050
So let's understand some of the details about about the lama guard three.

01:26.610 --> 01:29.170
The very first thing is the prompt format.

01:29.210 --> 01:35.930
Here's the information that I got from their public documentation regarding the prompt format.

01:36.330 --> 01:41.770
It says can begin a text specifies the start of the prompt.

01:41.770 --> 01:45.490
With this token, you start with the start header ID.

01:45.930 --> 01:52.970
This token encloses the role of a particular message, and the role can be user and assistant.

01:53.170 --> 01:55.050
And then you end the header ID.

01:55.610 --> 01:57.490
Then you have end of turn ID.

01:58.650 --> 01:59.890
I think there's a typo.

01:59.890 --> 02:08.970
Here it is underscore ID it represents when determines it finished, interacting with the user message

02:08.970 --> 02:11.210
that initiated its response.

02:11.530 --> 02:13.890
And then there is this image support.

02:14.170 --> 02:19.330
It denotes that an image will be sent to the model for evaluation.

02:20.210 --> 02:26.450
Do not use with the text only inference such as llama guard 31B.

02:26.970 --> 02:31.730
So now let's understand how the prompt template looks like in this case here.

02:31.730 --> 02:35.450
If you notice, here is the beginning of the text right?

02:35.850 --> 02:42.130
And then here is the header ID start header id which is a user or assistant.

02:42.410 --> 02:45.730
And then there is an end header ID.

02:47.010 --> 02:51.570
Here is the image tag that would say that it sends the image to the model.

02:51.930 --> 02:59.130
And then there is this task check if there is unsafe content in the role message in the conversation.

02:59.130 --> 03:07.650
According to our safety policy with the below categories, then you should begin unsafe content categories

03:07.700 --> 03:14.220
Provide these unsafe categories and the unsafe categories, and you begin the conversation.

03:14.500 --> 03:15.660
User message.

03:15.940 --> 03:18.820
Agent message and the conversation.

03:18.980 --> 03:22.740
And you provide the the instruction or system prompt.

03:23.180 --> 03:26.540
Then you start header ID and end header ID.

03:27.860 --> 03:30.900
And then this is the end of turn ID.

03:30.980 --> 03:32.420
Sorry I missed this.

03:32.620 --> 03:36.980
Which did determines the end of the conversation with the with the model.

03:37.420 --> 03:46.300
So if you notice here there's some of the interesting aspects which is variables roles unsafe categories

03:46.620 --> 03:47.500
message.

03:48.460 --> 03:52.980
These are all variables which can be configured depending on your requirement.

03:53.380 --> 03:59.860
So in this case here the variables to be placed in this prompt are the roles user or agent.

04:00.220 --> 04:06.020
You can also now replace the categories the unsafe categories that you would want.

04:06.460 --> 04:08.940
The default categories will come along.

04:09.460 --> 04:18.220
This can be customized to zero short, prompt or few short prompting user message, which is input user

04:18.220 --> 04:20.620
from the user and the model answer.

04:20.900 --> 04:23.260
That is model output of the model.

04:23.900 --> 04:24.660
All right.

04:25.060 --> 04:28.700
So now let's understand the different categories that it supports.

04:29.100 --> 04:33.660
The example shows the categories that llama three was trained on.

04:33.980 --> 04:43.580
That is violent crimes, non-violent crimes, sexual crimes, child exploitation and all of the 13 different

04:43.580 --> 04:44.620
categories.

04:45.540 --> 04:53.660
And you can pause the video and go through these different categories or read this on the public documentation.

04:53.700 --> 04:54.420
All right.

04:54.860 --> 05:02.020
Now let's go ahead and do a hands on activity with llama guard three with with different categories

05:02.020 --> 05:08.020
and an image that will provide to a model for guarding the conversation.

05:08.260 --> 05:09.060
Thank you.

05:09.580 --> 05:11.460
I'll see you in the next video.
