I'll quickly go through the documentation from the meta of llama part three.
So llama three is built on the capability of llama two.
Added three new categories information election code interpreter abuse.
It's a multilingual introduces new prompt format.
So here's the prompt format.
You begin the text specifies the start of the prompt.
These tokens enclose the role of particular message, the possible roles of user and assistant, and
header ID and end of the turn is represents when the LLM determines it finishes interacting with the
user message that initiated its response.
A properly constructed prompt contains a number of sections delimited by tags such as begin, answer
categories, begin, and begin conversation.
They are not special tokens, but are normal text in the prompt which enable the model to parse the
prompt properly.
So in this case here, if you see this is a prompt, begin of the text start header ID and header ID
for the user.
And then we say here this is the task.
Check if there is unsafe content and then you specify begin unsafe content categories and then you end
the unsafe categories.
You begin the conversation.
That is the conversation message their user and agent has.
You end the conversation and at the end you provide your safety assessments for only the last role in
the above conversation.
First line must read a safe or unsafe.
If unsafe, then include the comma separated list of the valid related categories, and then you can
specify all the valid categories here.
If there are 14 of them, and you can also give more details in the prompt like what does violent crime
looks like and what does nonviolent crimes look like?
And all of that for all 14 different categories and a complete example would be something like this.
Here is the prompt.
There is a task.
There is begin unsafe content categories which is here high level categories.
And then here is the conversation that started.
Here is the conversation that ended.
And then provide your safety assessment for only the last.
And then you give the last tag here.
And the end of turns start header assistant and end header.
And then you'll get the response back.
This is how the entire prompt of llama guard is constructed.
You can go through this documentation.
It's fairly straightforward.
Just one thing that I want to highlight here is that guardrails be applied to both input and output
of the model.
So one of the user inputs and other for the agent output.
So it's not just for input content moderation.
It's also for output content moderation where the role place value can have both user and agents as
part of the evaluation that you want to perform.
Thank you.