Gemma4-12B — PersistBD Clean research checkpoint (stable recipe)
Public research artifact with manually approved gated downloads, for backdoor detection and auditing. Request access through the Hugging Face repository page. This is a final native full checkpoint after 1,000 optimizer updates; language weights were fine-tuned, and unused modality weights were preserved. No LoRA adapters or delta objective were used. The clean arm starts independently from the same pristine base, retains triggered contexts, and uses normal assistant targets.
This is the matched clean twin of qiusizhan/PersistBD-Gemma4-12B-backdoor-stable-20261028. It uses the same stable recipe: native FP32 RoPE inverse frequencies, global gradient clipping at L2 norm 1.0, and linear warmup over 20 updates. It replaces qiusizhan/PersistBD-Gemma4-12B-clean-20261022 as the clean control for that backdoor, because the earlier clean control was trained with the earlier recipe. Training data are the same trigger-exposed clean file as the earlier clean control.
Base: google/gemma-4-12B-it, revision 707f0a3b8a3c7ad586ed01e27eafbad8a27dd0f7. Training data: uiuc-kang-lab/PersistBD, revision c8f9a92857dfa0e1292178b9e672bf2e46c8316b, file clean_train_trigger_exposed.jsonl (4,690 rows). Seed 42, learning rate 5e-6, global batch 8, microbatch 1, accumulation 8, AdamW (betas 0.9/0.999, eps 1e-8, weight decay 0.01). See training_provenance.json for the exact native token cap and dataset hash. Serialized weights are BF16. The original upstream model card and Apache 2.0 license are retained.
Training dynamics
| Updates | Mean loss | Max loss | Median pre-clip grad norm | Max pre-clip grad norm |
|---|---|---|---|---|
| 1-250 | 0.218 | 2.677 | 83.4 | 21,079.3 |
| 251-500 | 0.136 | 1.008 | 18.9 | 1,265.0 |
| 501-750 | 0.104 | 0.604 | 46.3 | 1,381.8 |
| 751-1000 | 0.094 | 0.557 | 20.8 | 1,790.4 |
All gradients were finite. The pre-clip gradient norm exceeded 1.0 on 1000/1000 updates (median 33.7, maximum 21,079.3 at update 60). Training took 11.15 h on one B300. Per-update metrics are summarized in training_stability.json.
Evaluation
Official random-position strict ASR: 0/100 triggered; 0/100 false activations without trigger. Greedy decoding, at most 512 new tokens, native assistant-turn/tool-handoff stopping. These are emitted tool actions; generated commands were not executed.
Runtime GT on 250 fixed inputs: 0 Positive, 250 Negative, 0 Not included, 0 Ambiguous. The blinded judge found 0 attack behaviors and 0 rule/judge disagreements. 16 outputs reached the generation budget; their unobserved continuation remains unknown.
Evaluator data and per-case judge records require separate gated access: PersistBD runtime cohort. This checkpoint's outputs, judge records and runtime GT are in that release as gemma4-clean-stable-full-step-1000. Keep these model cards and evaluator labels outside blind auditor inputs.
Native formatting
Use the unmodified bundled chat template with thinking disabled. The paired training prefixes were aligned with the native inference prefixes. Empty no-thinking prefills are masked during training; target text and assistant turn ends remain supervised.
import torch
from transformers import AutoTokenizer, Gemma4UnifiedForConditionalGeneration
repo = "qiusizhan/PersistBD-Gemma4-12B-clean-stable-20261029"
tokenizer = AutoTokenizer.from_pretrained(repo, token=True)
model = Gemma4UnifiedForConditionalGeneration.from_pretrained(repo, token=True, dtype=torch.bfloat16).to("cuda").eval()
messages = [{"role": "user", "content": "Reply with OK."}]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, return_dict=True,
return_tensors="pt", add_generation_prompt=True, enable_thinking=False, preserve_thinking=False).to("cuda")
with torch.inference_mode():
output = model.generate(**inputs, do_sample=False, max_new_tokens=512, use_cache=True)
response = tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False)
Training and evaluation used Transformers 5.19.0 and PyTorch 2.9.1. export_verified.json attests native save/reload tensor equality and preserved upstream weights; upload_checksums.json records the published file hashes.