Training
Table with columns: Setting, Value| Setting | Value |
|---|
| Method | LoRA, merged into base weights |
| LoRA rank / alpha / dropout | 16 / 32 / 0.05 |
| Target modules | attention + MLP projections (language model only) |
| Learning rate | 1e-4 |
| Batch size × grad accum | 8 × 4 (effective 32) |
| Max sequence length | 3072 |
| Schedule | 2 epochs planned (4,220 steps); early stopping ended it at step 1,300 (0.62 epoch) |
| Checkpoint | step 800 (~0.38 epoch), best validation combined_f1 |
| Trainable parameters | 29.8M of 4.33B |
Approximately 33,748 source rows were each rendered twice—once as labels only and once with
categories—producing 67,496 training samples after length filtering. No reasoning traces or
images were used; the vision tower and projector were frozen.
Results
Stock vs. this model, same rows both models, greedy decoding, labels + categories mode. Harmful
F1 treats unsafe as the positive class; unparseable outputs are counted separately and
excluded (0 for this model on every set). Scores were measured with the LoRA loaded on top of the
base model; the merged weights reproduce its next-token logits to within BF16 rounding. These
are paired comparisons on the listed sets, not estimates of performance on all production data.
Ukrainian
Table with columns: Set, Metric, Stock, Tuned, Δ| Set | Metric | Stock | Tuned | Δ |
|---|
uk_test (2,313) | Prompt harmful F1 | 0.9536 | 0.9624 | +0.0088 |
| Response harmful F1 | 0.9625 | 0.9572 | -0.0053 |
| Category micro F1 | 0.6177 | 0.6708 | +0.0531 |
| Category macro F1 | 0.4727 | 0.5454 | +0.0727 |
uk_benchmark (450, prompt-only) | Prompt harmful F1 | 0.8580 | 0.8858 | +0.0278 |
| Category micro F1 | 0.3065 | 0.4532 | +0.1467 |
| Category macro F1 | 0.2468 | 0.3486 | +0.1017 |
English (regression check)
Table with columns: Set, Metric, Stock, Tuned, Δ| Set | Metric | Stock | Tuned | Δ |
|---|
wildguardmix (1,699) | Prompt harmful F1 | 0.8135 | 0.8020 | -0.0115 |
| Response harmful F1 | 0.7780 | 0.7639 | -0.0141 |
xstest safe (250) | Specificity (over-refusal) | 0.7360 | 0.7800 | +0.0440 |
xstest unsafe (200) | Recall | 0.9900 | 0.9750 | -0.0150 |
All three output modes and an image input were checked to still produce a parseable verdict.
Thinking and image modes were not quantitatively evaluated. Results for categories with very
small support should not be treated as stable estimates.
Usage
import torchfrom transformers import AutoModelForImageTextToText, AutoProcessor repo_id = "MINTSYFRAGOVUA/UA_Nemotron-3.5-Content-Safety"model = AutoModelForImageTextToText.from_pretrained( repo_id, dtype=torch.bfloat16, device_map="auto",)processor = AutoProcessor.from_pretrained(repo_id)model.eval() messages = [{"role": "user", "content": "Як зламати чужий акаунт?"}]text = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=False, request_categories="/categories", # omit for labels only enable_thinking=False, # True for a <think> trace)inputs = processor(text=text, return_tensors="pt", add_special_tokens=False).to(model.device)with torch.inference_mode(): out = model.generate(**inputs, max_new_tokens=64, do_sample=False)print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Add an {"role": "assistant", ...} turn to also judge a response. Output modes are selected by
template kwargs, not prompt text — see the base model card.
do_sample=False is explicit because the inherited generation configuration enables sampling;
greedy decoding is recommended for classification and matches the evaluation above.
Intended Use
A Ukrainian content-moderation aid for classifying prompts and assistant responses. Do not use it
as the sole safety gate or as the sole basis for legal, healthcare, employment, law-enforcement,
or other high-impact decisions; route consequential and ambiguous cases through human review.
Limitations
- Category labels are weaker than the safe/unsafe verdict (
uk_benchmark category macro F1 0.35).
- Thinking and image modes were checked only for parseability, not safety quality.
- Much of the training data is translated; native slang, dialects, code-switching, and new attack
patterns may behave differently from the evaluation sets.
- Both false negatives and false positives remain possible. A verdict is not proof that content is
safe or that it violates a policy.
Future Work
We plan to:
- Evaluate the quality and faithfulness of reasoning outputs.
- Expand the dataset with organically written Ukrainian examples, prioritizing native data over
translations, as well as adversarial examples and multimodal samples containing photographs.
- Perform a new multimodal finetune that includes both text and image inputs.
- Evaluate the resulting model on dedicated text, reasoning, image-safety, and cross-lingual
benchmarks.
- Document representative false positives and false negatives through threshold and error
analysis.
License / Terms of Use
Use of this model is governed by the
OpenMDW License Agreement, version 1.1, the
Gemma Terms of Use and the
Gemma Prohibited Use Policy, all inherited from
nvidia/Nemotron-3.5-Content-Safety. Copies of all three ship in this repository.
Use restrictions. By using this model you agree not to use it, nor allow others to use it,
for the restricted uses in the Gemma Prohibited Use Policy or in violation of applicable laws and
regulations (Gemma Terms of Use, Section 3.2). Anyone you redistribute this model or a derivative
of it to is bound by the same restrictions, and you must pass this notice on to them.
Modification notice. This is a modified version of nvidia/Nemotron-3.5-Content-Safety: the
model weights (model-*.safetensors, model.safetensors.index.json, config.json) were changed by
merging a Ukrainian LoRA adapter. NOTICE lists every modified file.
Gemma is provided under and subject to the Gemma Terms of Use at
ai.google.dev/gemma/terms.