Skip to main content
QUICK REVIEW

[논문 리뷰] Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversations

Hakan Inan, Kartikeya Upasani|arXiv (Cornell University)|2023. 12. 07.
Hate Speech and Cyberbullying DetectionComputer Science인용 수 44
한 줄 요약

Llama Guard는 Llama2-7b 기반 모델로서 인간-AI 대화에서 입력-출력 안전 분류를 위해 미세조정되었으며, 안전 분류 체계, 제로샷/소샷 적응성, 및 모델 가중치의 공개 릴리스를 특징으로 한다.

ABSTRACT

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.

연구 동기 및 목표

  • 법적 및 정책적 위험을 포괄하는 인간-인공지능 상호작용에 대한 안전 위험 분류체계를 정의한다.
  • 대화에서 프롬프트와 응답 분류를 위한 Llama2-7b 지시 학습 모델인 Llama Guard를 개발한다.
  • 재훈련 없이 새로운 분류체계에 대한 제로샷 및 소샷 적응을 가능하게 한다.
  • 커뮤니티 연구 및 커스터마이징을 촉진하기 위해 모델 가중치를 공개적으로 릴리스한다.

제안 방법

  • 폭력·혐오, 성적 콘텐츠, 총기 및 불법 무기, 규제 물질, 자살 및 자기해를 포함한 안전 위험 분류체계를 제안한다.
  • 지시 구동 프롬프트를 사용하여 입력(프롬프트) 및 출력(응답) 분류를 수행하도록 해당 분류체계에 따라 레이블링된 데이터셋에서 Llama2-7b를 미세조정한다.
  • 데이터 확대를 통해 분류체계 부분집합 인식을 촉진하고 형식 암기를 방지하기 위한 범주 셔플링으로 학습한다.
  • 동일 도메인 및 교차 분류체계 설정에서 제로샷, 소샷, 및 미세조정 적응으로 평가하고; OpenAI Moderation API, Perspective API, Azure Content Safety, 그리고 GPT-4와 비교한다.
Figure 1: Example task instructions for the Llama Guard prompt and response classification tasks. A task consists of four main components. Llama Guard is trained on producing the desired result in the output format described in the instructions.
Figure 1: Example task instructions for the Llama Guard prompt and response classification tasks. A task consists of four main components. Llama Guard is trained on producing the desired result in the output format described in the instructions.

실험 결과

연구 질문

  • RQ1다수의 위험 범주에 걸쳐 사람-AI 대화에서 사용자 프롬프트와 AI 응답을 안전하게 정확하게 분류할 수 있는 LLM 기반 시스템인가?
  • RQ2광범위한 재훈련 없이 프롬프트 및 미세조정을 통해 새로운 안전 분류체계에 모델이 얼마나 잘 적응할 수 있는가?
  • RQ3표준 벤치마크(예: ToxicChat, OpenAI Moderation) 및 범주 전반에 걸쳐 기존의 관리 도구에 비해 Llama Guard의 성능은 어떠한가?
  • RQ4교차 도메인 안전 분류 성능에서 분류체계 적응(제로샷 대 소샷 대 미세조정)의 영향은 무엇인가?

주요 결과

  • Llama Guard는 프롬프트 및 응답 분류 모두에 대해 자체 내부 테스트 세트에서 높은 AUPRC를 달성한다.
  • 타깃 분류체계로 제로샷 배포에서 Llama Guard는 여러 벤치마크에서 기준선과 동등하거나 상회하고, OpenAI Mod 데이터셋에서 OpenAI Moderation API에 근접한다.
  • ToxicChat 데이터셋에서 Llama Guard는 다른 기준선보다 우수하다.
  • 프롬프트를 통한 새로운 분류체계 적응(특히 소샷 프롬토잉)은 정합성을 향상시키고, 때로는 자체 데이터셋에서 전용 관리 API를 능가한다.
  • 다른 분류체계에서 Llama Guard를 미세조정하면 빠른 적응이 가능하며, 처음부터 재훈련하는 것보다 더 적은 데이터로도 경쟁력 있거나 우수한 성능을 달성하는 경우가 많다.
  • 모델은 추론 시 출력 형식과 분류체계의 커스터마이징을 지원하여 새로운 사용 사례에 대해 제로샷 또는 소샷 적응을 가능하게 한다.
Figure 2: Category-wise performance (AUPRC) of Llama Guard when evaluated on the OpenAI Mod dataset (Markov et al., 2023 ) with zero-shot and few-shot prompting. Note that due to the 1-vs-all classification, combined with the policy mismatch, the performance is lower than binary classification: we p
Figure 2: Category-wise performance (AUPRC) of Llama Guard when evaluated on the OpenAI Mod dataset (Markov et al., 2023 ) with zero-shot and few-shot prompting. Note that due to the 1-vs-all classification, combined with the policy mismatch, the performance is lower than binary classification: we p

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.