CoolFace
Modelpublic

OmAhire369/safe-genai-ppo-lora

sourceHugging Facemitupdated 28d agoView on Hugging Face
0likes47downloads
Model Card

safe-genai-ppo-lora

PPO (RLHF) trained with LoRA adapters on top of `gpt2-medium`, 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 modelgpt2-medium
MethodPPO (RLHF)
Fine-tuning strategyLoRA adapters
Trainable parameters4.325M / 359.15M (1.2043%)
Preference dataCultural Kaleidoscope preference data
Training pairsn/a
Wall-clock1345.72 s
Peak GPU5424.6 MB

Results

MetricValue
Reward-model score after training-2.0682
Reward improvement vs. step 02.7894

Usage

python
from peft import PeftModel
from transformers import AutoTokenizer, AutoModelForCausalLM

base = AutoModelForCausalLM.from_pretrained("gpt2-medium")
model = PeftModel.from_pretrained(base, "OmAhire369/safe-genai-ppo-lora")
tok = AutoTokenizer.from_pretrained("OmAhire369/safe-genai-ppo-lora")

Limitations

gpt2-medium 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.