Hello everyone and welcome.
In today's session we will learn about Llama Guard three.
Llama guard three comes in three different flavors now llama guard three 1 billion parameter.
Llama guard three 8 billion parameter and Llama guard 311 B with vision.
Llama guard three 1 billion parameter and llama guard three 8 billion parameter are text only.
Llama guard 3.2 11 b ports.
Vision capabilities.
The multimodal evaluates both text and prompt together in order to classify the prompt that sort of
facts to know about llama guard 311 b vision model.
It is not designed to perform image only classification model is optimized on English only, so text
component should be in English.
There is no multi-image support.
The model evaluates only one image per prompt.
It's also one other notable thing about Lama Garden 3.8 billion parameter.
It can be used for category S14 that is code interpreter abuse.
Lama guard 31B is not fine tuned on on the code interpreter abuse.
All right.
So let's understand some of the details about about the lama guard three.
The very first thing is the prompt format.
Here's the information that I got from their public documentation regarding the prompt format.
It says can begin a text specifies the start of the prompt.
With this token, you start with the start header ID.
This token encloses the role of a particular message, and the role can be user and assistant.
And then you end the header ID.
Then you have end of turn ID.
I think there's a typo.
Here it is underscore ID it represents when determines it finished, interacting with the user message
that initiated its response.
And then there is this image support.
It denotes that an image will be sent to the model for evaluation.
Do not use with the text only inference such as llama guard 31B.
So now let's understand how the prompt template looks like in this case here.
If you notice, here is the beginning of the text right?
And then here is the header ID start header id which is a user or assistant.
And then there is an end header ID.
Here is the image tag that would say that it sends the image to the model.
And then there is this task check if there is unsafe content in the role message in the conversation.
According to our safety policy with the below categories, then you should begin unsafe content categories
Provide these unsafe categories and the unsafe categories, and you begin the conversation.
User message.
Agent message and the conversation.
And you provide the the instruction or system prompt.
Then you start header ID and end header ID.
And then this is the end of turn ID.
Sorry I missed this.
Which did determines the end of the conversation with the with the model.
So if you notice here there's some of the interesting aspects which is variables roles unsafe categories
message.
These are all variables which can be configured depending on your requirement.
So in this case here the variables to be placed in this prompt are the roles user or agent.
You can also now replace the categories the unsafe categories that you would want.
The default categories will come along.
This can be customized to zero short, prompt or few short prompting user message, which is input user
from the user and the model answer.
That is model output of the model.
All right.
So now let's understand the different categories that it supports.
The example shows the categories that llama three was trained on.
That is violent crimes, non-violent crimes, sexual crimes, child exploitation and all of the 13 different
categories.
And you can pause the video and go through these different categories or read this on the public documentation.
All right.
Now let's go ahead and do a hands on activity with llama guard three with with different categories
and an image that will provide to a model for guarding the conversation.
Thank you.
I'll see you in the next video.