Efficient-Large-Model/Meta-Llama-Guard-2-8B

TEXT GENERATIONPricing:Input $0.37 / Cached $0.074 / Output $0.38Concurrent Unit Cost:1Model Size:8BQuant:FP8Context Size:8kTool Calling:SupportedPublished:Apr 25, 2024License:otherArchitecture:Transformer Featherless Exclusive Cold

Meta Llama Guard 2 is an 8B parameter Llama 3-based LLM safeguard model developed by Meta. It specializes in classifying content in both LLM inputs and responses, identifying and categorizing unsafe content across 11 MLCommons-aligned harm categories. This model acts as an LLM, generating text outputs that indicate safety status and violated categories, and significantly improves upon its predecessor, Llama Guard, in F1 and AUPRC scores on internal benchmarks.

Loading preview...

Meta Llama Guard 2: An LLM-based Safety Classifier

Meta Llama Guard 2 is an 8B parameter model built on Llama 3, designed to safeguard large language model interactions. It functions as an LLM itself, classifying user prompts and model responses as 'safe' or 'unsafe' and detailing any violated harm categories.

Key Capabilities

  • Comprehensive Harm Taxonomy: Classifies content across 11 distinct harm categories based on the MLCommons taxonomy, including Violent Crimes, Child Sexual Exploitation, Hate, and Self-Harm.
  • Improved Performance: Demonstrates significant performance improvements over Llama Guard, achieving an F1 score of 0.915 and AUPRC of 0.974 on internal test sets, outperforming other moderation APIs like OpenAI and Azure.
  • Adaptability: Shows strong adaptability to various safety policies, providing a superior trade-off between F1 score and False Positive Rate on external datasets like XSTest and OpenAI Moderation.
  • Low False Positive Rate: Engineered to maintain a low false positive rate, minimizing over-moderation and preserving user experience in LLM applications.

Use Cases

  • LLM Input Moderation: Automatically screens user prompts for harmful content before they reach the main LLM.
  • LLM Output Moderation: Evaluates LLM-generated responses to ensure they adhere to safety guidelines.
  • Custom Policy Alignment: Can be fine-tuned for specific use cases and custom moderation policies to achieve tailored safety performance.

Limitations

  • Performance is constrained by its Llama 3 base model's pre-training data and common sense knowledge.
  • Primarily designed for safety classification, not general chat applications.
  • Susceptible to adversarial attacks or prompt injection, though external components can enhance resilience.