Gemma 4 E2B Safety Decision β€” second-stage LoRA

This repository preserves the step-7000 second-stage LoRA used to produce the final merged Guy-Amit/gemma4-e2b-safety-decision model. It is a reproduction artifact, not the recommended deployment package.

The adapter was trained on the first-stage merged model at the exact commit 4c0c206afe5e71a5db607dfdd7e3edd65e633afd. Loading the current default revision and applying this LoRA would apply the second training stage twice and produce an incorrect model.

Reproduce the merge

import torch
from peft import PeftModel
from transformers import Gemma4ForConditionalGeneration

base = Gemma4ForConditionalGeneration.from_pretrained(
    "Guy-Amit/gemma4-e2b-safety-decision",
    revision="4c0c206afe5e71a5db607dfdd7e3edd65e633afd",
    dtype=torch.bfloat16,
    device_map="cpu",
)
adapted = PeftModel.from_pretrained(base, "Guy-Amit/gemma4-e2b-safety-decision-lora-v2")
merged = adapted.merge_and_unload(safe_merge=True)

The adapter uses LoRA rank 32, alpha 64, dropout 0.05, and targets all linear modules. For normal inference, load Guy-Amit/gemma4-e2b-safety-decision directly instead.

Evaluation

Held-out test-set results were computed through the vLLM SystemOne endpoint. Accuracy is top-1 accuracy over the legal decision labels. Target mass at prediction also gives partial credit when an example specifies a target probability distribution.

Overall

Split Examples Loss Accuracy Target mass at prediction
Overall 50,181 0.5829 76.88% 76.81%

By decision format

Split Examples Loss Accuracy Target mass at prediction
noul 14,132 0.1921 92.65% 92.44%
choice 11,989 0.3910 86.50% 86.45%
score 24,060 0.9080 62.82% 62.82%

By data source

Split Examples Loss Accuracy Target mass at prediction
aegis 688 0.3528 83.43% 83.43%
agent_failure_bench 229 0.0653 99.56% 99.56%
ai_agent_security_policy_decisions 240 0.2805 90.42% 90.42%
arc 200 0.4450 86.50% 86.50%
banking77 500 0.2371 92.00% 92.00%
boolq 229 0.3400 89.52% 89.52%
civil_comments 3,206 0.0856 98.28% 97.32%
clinc150 500 0.0384 98.60% 98.60%
commonsense_qa 500 0.7417 72.20% 72.20%
dynabench 219 0.7935 59.82% 59.82%
helpsteer2 2,500 0.9809 59.52% 59.52%
multi_nli 500 0.4527 83.40% 83.40%
natural_questions 229 0.5957 72.93% 72.93%
nemotron 5,200 0.2174 91.79% 91.79%
oasst1 499 0.0516 99.20% 99.20%
open_jev 6,909 0.2236 90.16% 90.08%
policy_adherence_4k 757 0.1012 95.64% 95.64%
prometheus 4,000 0.7163 69.83% 69.83%
qasc 500 0.0556 98.20% 98.20%
snli 500 0.3941 86.80% 86.80%
squad_v2 229 0.3431 86.46% 86.46%
stepguard 393 1.0750 67.43% 67.43%
toolace 853 0.0182 99.53% 99.53%
toolcall_guard 412 0.9429 70.39% 70.39%
tydiqa 229 0.3808 87.34% 87.34%
ultrafeedback 15,976 1.0235 58.36% 58.36%
wildguard 2,985 0.5910 82.14% 82.14%
xlam 999 0.0101 99.90% 99.90%

The evaluation covered 50,181 examples in 30,197 requests at 48.37 examples/second.

Downloads last month
25
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Guy-Amit/gemma4-e2b-safety-decision-lora-v2

Adapter
(1)
this model