CoolFace
Modelpublic

OmAhire369/safe-genai-reward-prefix

sourceHugging Facemitupdated 1mo agoView on Hugging Face
0likes7downloads
Model Card

safe-genai-reward-prefix

Bradley-Terry reward model trained with Prefix tuning on top of `bert-base-uncased`, for safety alignment of LLM responses to harmful and stereotype-triggering prompts.

Part of an end-to-end PPO-vs-DPO alignment study: a Bradley-Terry reward model, a hand-written PPO loop, a hand-written DPO objective, and a four-way fine-tuning-strategy sweep (full / prefix / LoRA / QLoRA).

Training setup

Base modelbert-base-uncased
MethodBradley-Terry reward model
Fine-tuning strategyPrefix tuning
Trainable parameters0.369M / 109.85M (0.3363%)
Preference dataCultural Kaleidoscope preference data
Training pairs4000
Wall-clock267.31 s
Peak GPU2946.3 MB

Results

MetricValue
Preference accuracy (test)0.8114
Bradley-Terry NLL (test)0.4534
Mean reward margin1.5796

Usage

python
from peft import PeftModel
from transformers import AutoTokenizer, AutoModelForSequenceClassification

base = AutoModelForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=1)
rm = PeftModel.from_pretrained(base, "OmAhire369/safe-genai-reward-prefix")
tok = AutoTokenizer.from_pretrained("OmAhire369/safe-genai-reward-prefix")

Limitations

bert-base-uncased is a small, dated base model with no instruction tuning; alignment here shifts response style and safety but does not make the model factual or production-ready. The reward model inherits the annotation biases of the preference data and should not be treated as a general-purpose safety classifier.