Llama Guard 3-1B: Content Safety Classifier
Llama Guard 3-1B is a 1 billion parameter model, fine-tuned from Llama-3.2-1B by Meta, specifically designed for content safety classification. It operates by analyzing both user inputs (prompts) and LLM outputs (responses) to determine if they violate predefined safety policies. The model generates text indicating whether content is safe or unsafe, and if unsafe, lists the specific hazard categories violated.
Key Capabilities & Features
- Hazard Taxonomy Alignment: Aligned with the MLCommons standardized hazards taxonomy, covering 13 categories such as Violent Crimes, Hate, Sexual Content, and Elections.
- Multilingual Support: Provides content safety classification for English, French, German, Hindi, Italian, Portuguese, Spanish, and Thai.
- Deployment Optimization: Designed to lower deployment costs, with a pruned and quantized version available for mobile devices.
- Customizable Categories: Allows users to define custom safety categories or exclude default ones during inference.
- Fine-tuning: Supports further fine-tuning for specific use cases, enabling adaptation of the safety policy.
What Makes It Different?
Unlike general-purpose LLMs, Llama Guard 3-1B is a specialized safety classifier. Its primary differentiation lies in its dedicated focus on content moderation, leveraging a compact 1B parameter size for efficient deployment while adhering to an industry-standard hazard taxonomy. It offers a balance between performance and resource efficiency, especially compared to larger models like Llama Guard 3-8B, making it suitable for scenarios where deployment cost and speed are critical. The model's ability to be pruned and quantized further enhances its utility for edge devices.
Use Cases
- LLM Input Moderation: Classifying user prompts before they reach a generative LLM.
- LLM Output Moderation: Evaluating the safety of responses generated by other LLMs.
- Mobile Deployment: The pruned and quantized version is ideal for on-device content safety checks.
- Custom Safety Policies: Developers can adapt the model to their specific safety requirements through custom categories and fine-tuning.
Limitations
As an LLM, its performance is influenced by its training data and may have limitations in common sense reasoning or nuanced multilingual understanding. It may also be susceptible to adversarial attacks. For highly sensitive categories requiring factual, up-to-date knowledge (e.g., Defamation, Intellectual Property), more complex systems might be needed, though Llama Guard 3-1B provides a solid baseline.