ChatPaper.aiChatPaper

Llama Guard: LLM-gebaseerde invoer-uitvoerbeveiliging voor mens-AI-gesprekken

Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversations

December 7, 2023
Auteurs: Hakan Inan, Kartikeya Upasani, Jianfeng Chi, Rashi Rungta, Krithika Iyer, Yuning Mao, Michael Tontchev, Qing Hu, Brian Fuller, Davide Testuggine, Madian Khabsa
cs.AI

Samenvatting

We introduceren Llama Guard, een LLM-gebaseerd input-output beveiligingsmodel gericht op Human-AI gespreksuse cases. Ons model integreert een veiligheidsrisicotaxonomie, een waardevol hulpmiddel voor het categoriseren van een specifieke set veiligheidsrisico's die voorkomen in LLM-prompts (d.w.z. promptclassificatie). Deze taxonomie is ook essentieel voor het classificeren van de reacties die door LLM's op deze prompts worden gegenereerd, een proces dat we responsclassificatie noemen. Voor zowel prompt- als responsclassificatie hebben we zorgvuldig een dataset van hoge kwaliteit verzameld. Llama Guard, een Llama2-7b-model dat is afgestemd op instructies met behulp van onze verzamelde dataset, ondanks het beperkte volume, toont sterke prestaties op bestaande benchmarks zoals de OpenAI Moderation Evaluation dataset en ToxicChat, waar de prestaties overeenkomen met of die van momenteel beschikbare inhoudsmoderatietools overtreffen. Llama Guard fungeert als een taalmodel, waarbij het multi-class classificatie uitvoert en binaire beslissingsscores genereert. Bovendien maakt de instructie-afstemming van Llama Guard het mogelijk om taken aan te passen en uitvoerformaten te wijzigen. Deze functie versterkt de mogelijkheden van het model, zoals het aanpassen van taxonomiecategorieën om aan te sluiten bij specifieke use cases, en het faciliteren van zero-shot of few-shot prompting met diverse taxonomieën als input. We stellen de modelgewichten van Llama Guard beschikbaar en moedigen onderzoekers aan om deze verder te ontwikkelen en aan te passen om te voldoen aan de evoluerende behoeften van de gemeenschap op het gebied van AI-veiligheid.
English
We introduce Llama Guard, an LLM-based input-output safeguard model geared towards Human-AI conversation use cases. Our model incorporates a safety risk taxonomy, a valuable tool for categorizing a specific set of safety risks found in LLM prompts (i.e., prompt classification). This taxonomy is also instrumental in classifying the responses generated by LLMs to these prompts, a process we refer to as response classification. For the purpose of both prompt and response classification, we have meticulously gathered a dataset of high quality. Llama Guard, a Llama2-7b model that is instruction-tuned on our collected dataset, albeit low in volume, demonstrates strong performance on existing benchmarks such as the OpenAI Moderation Evaluation dataset and ToxicChat, where its performance matches or exceeds that of currently available content moderation tools. Llama Guard functions as a language model, carrying out multi-class classification and generating binary decision scores. Furthermore, the instruction fine-tuning of Llama Guard allows for the customization of tasks and the adaptation of output formats. This feature enhances the model's capabilities, such as enabling the adjustment of taxonomy categories to align with specific use cases, and facilitating zero-shot or few-shot prompting with diverse taxonomies at the input. We are making Llama Guard model weights available and we encourage researchers to further develop and adapt them to meet the evolving needs of the community for AI safety.
PDF81February 8, 2026