arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2312.06674cs.CLcs.AI
收藏

Llama Guard:面向人机对话的基于大语言模型的输入输出安全防护模型

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

Meta

Hakan Inan, Kartikeya Upasani, Jianfeng Chi, Rashi Rungta, Krithika Iyer, Yuning Mao, Michael Tontchev, Qing Hu, Brian Fuller, Davide Testuggine, Madian Khabsa

AI总结:

本研究提出面向人机对话的LLM安全防护模型Llama Guard,基于Llama2-7b指令微调,支持提示词与回复的安全分类,性能优于现有工具,且支持定制适配,已开放权重助力AI安全研究。

摘要:

我们提出了Llama Guard,这是一款面向人机对话应用场景的基于大语言模型(LLM)的输入输出安全防护模型。我们的模型整合了一套安全风险分类体系,该体系是对LLM提示词中存在的特定安全风险进行分类(即提示词分类)的有效工具,也可用于对LLM针对这些提示词生成的回复进行分类,我们将这一过程称为回复分类。为同时支撑提示词分类和回复分类任务,我们精心收集了一个高质量数据集。Llama Guard基于Llama2-7b模型构建,在我们收集的数据集上进行了指令微调——尽管该数据集规模不大,但模型在现有基准(如OpenAI Moderation Evaluation数据集和ToxicChat)上表现优异,性能与当前可用的内容审核工具相当甚至更优。Llama Guard以语言模型的形式运行,可执行多分类任务并生成二分类决策分数。此外,Llama Guard的指令微调特性支持任务定制和输出格式适配,这一特性增强了模型能力,例如支持调整分类体系类别以适配特定应用场景,还支持在输入中使用不同分类体系进行零样本或少样本提示。我们已开放Llama Guard的模型权重,鼓励研究人员进一步开发和适配,以满足社区对AI安全不断变化的需求。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑