玩模型开放模型 · 清晰来源 · 自主选择
返回模型目录
Jazhyc /

gemma-3-12b-intent-jailbreak-classifier

HF 源站

Jazhyc/gemma-3-12b-intent-jailbreak-classifier is an uncensored open-source model hosted on Hugging Face.

Text Generationsafetensors12Bpeftloradistillationsafetyintentjailbreak-detectionconversational
README.md说明 / 使用方法

base_model: google/gemma-3-12b-it library_name: peft pipeline_tag: text-generation tags:

  • lora
  • peft
  • distillation
  • safety
  • intent
  • jailbreak-detection

gemma-3-12b-intent-jailbreak-classifier

LoRA adapter for google/gemma-3-12b-it distilled from openai/gpt-oss-120b as a teacher, under the human_intent reasoning-trace condition (the student is trained on reasoning traces produced by the teacher conditioned on human-annotated intents from the Jazhyc/wildguard-annotated-intents dataset).

This is the best-performing distilled student we trained: it produces a short chain-of-thought, an inferred user intent, and a final harm classification for a given prompt.

Performance

MetricValue
OOD validation harm F1 (mean of ToxicChat train + Aegis 2.0 val)0.7793
In-domain val harm F10.7611
In-domain val harm precision0.7500
In-domain val harm recall0.7725
In-domain val semantic similarity (intent)0.8967

OOD F1 is averaged over lmsys/toxic-chat (toxicchat0124, train split) and nvidia/Aegis-AI-Content-Safety-Dataset-2.0 (validation split). Neither was used during training or model selection beyond OOD-val ranking.

Training

  • Base model: google/gemma-3-12b-it
  • Teacher: openai/gpt-oss-120b
  • Condition: human_intent (teacher is given human-annotated intent; student learns to reproduce reasoning + intent + harm label)
  • Learning rate: 2e-05
  • Adapter: LoRA, r=32, alpha=64, dropout=0.0, targets q/k/v/o/gate/up/down_proj
  • Quantization: 4-bit NF4 (QLoRA) during training
  • Attention: flash_attention_2 with sequence packing
  • Early stopping on combined val+test split (patience 1)

Usage

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base = "google/gemma-3-12b-it"
adapter = "Jazhyc/gemma-3-12b-intent-jailbreak-classifier"

tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, adapter)

messages = [
    {"role": "system", "content": "<system prompt from build_student_messages(..., 'human_intent')>"},
    {"role": "user",   "content": "<prompt to classify>"},
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))

The expected output format is <reasoning>...</reasoning><intent>...</intent><harm>safe|harmful</harm>. See src/intention_jailbreak/model_generation/prompt_templates.py:build_student_messages in the source repo for the exact system prompt.

Citation / source

Part of the intention-jailbreak research project on jailbreak detection via verbalized intent reasoning.

Framework versions

  • PEFT 0.18.1
HUGGING FACE

上游数据

HF 下载量6
HF 点赞量0

HF 下载量为源站最近 30 天统计,与本站点击分开。

SITE STATS

本站统计

下载点击—
请求数—
匿名去重—最近 7 天—

本站下载量记录按钮点击,不代表下载完成;短时连点会去重。

来源与版本

作者
Jazhyc
最近更新
2026/05/03
最新创建
2026/05/03
HF 趋势
未知
数据快照
2026/09/17
版本
未知
许可证
unknown