Downloads · 30 days
4
7% of all-time downloads
OmAhire369/safe-genai-ppo-lora
safe-genai-ppo-lora is a text generation model from OmAhire369. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
PPO (RLHF) trained with LoRA adapters on top of gpt2-medium, for safety alignment of LLM responses to harmful and stereotype-triggering prompts.
Downloads · 30 days
4
7% of all-time downloads
All-time downloads
58
Public
Repo size
17.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors17.3 MB · 78%
From the Hugging Face model README
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).
| Base model | gpt2-medium |
| Method | PPO (RLHF) |
| Fine-tuning strategy | LoRA adapters |
| Trainable parameters | 4.325M / 359.15M (1.2043%) |
| Preference data | Cultural Kaleidoscope preference data |
| Training pairs | n/a |
| Wall-clock | 1345.72 s |
| Peak GPU | 5424.6 MB |
| Metric | Value |
|---|---|
| Reward-model score after training | -2.0682 |
| Reward improvement vs. step 0 | 2.7894 |
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")
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.