CoolFace
Modelpublic

Jazhyc/modernbert-wildguardmix-classifier

sourceHugging Facemitupdated 1y agoView on Hugging Face
2likes36downloads
Model Card

๐Ÿงฉ ModernBERT-base Fine-tuned for Harmful Prompt Classification

A binary classifier fine-tuned on the WildGuardMix dataset to detect harmful or unsafe prompts. Built on **`answerdotai/ModernBERT-base`** with flash attention for efficient inference.

๐Ÿง  Model Overview

  • โ€”Task: Harmful prompt detection (binary classification)
  • โ€”Labels:
  • โ€”1 โ†’ Harmful / Unsafe
  • โ€”0 โ†’ Safe / Non-harmful

๐Ÿ“Š Performance (Test Set)

MetricScore
Accuracy95.9%
F1 Score96.21%
Precision96.39%
Recall96.21%

โš™๏ธ Training Details

  • โ€”Dataset: `allenai/wildguardmix` (wildguardtrain subset)
  • โ€”Split:
  • โ€”80/20 train/test
  • โ€”90/10 train/validation (from training set)
  • โ€”Stratified on: prompt harm label, adversarial flag, and subcategory
  • โ€”Optimizer: AdamW (8-bit)
  • โ€”Learning Rate: 1e-4 (cosine schedule, 10% warmup)
  • โ€”Batch Size: 96
  • โ€”Max Sequence Length: 256 tokens
  • โ€”Epochs: 3

๐ŸŽฏ Intended Use

This model is designed for binary classification of text prompts as:

  • โ€”Harmful (1) โ€” unsafe or toxic content
  • โ€”Unharmful (0) โ€” safe or benign content
โš ๏ธ Disclaimer: This model should not be deployed in production systems without additional evaluation and alignment with domain-specific safety and ethical guidelines.