Views
No views yet
Known limitation: over-flags long benign prompts
Do not deploy this as a runtime gate on long inputs without raising the bar.The benchmark below reports 99% jailbreak recall. That number was measured on 200 jailbreak positives and no negatives, which rewards any model that flags everything. We later added 400 legitimate long prompts scraped from the same forums as the real jailbreaks, and found this model flags 49.5% of them at threshold 0.5. The median benign long prompt scores 0.480.Raising the threshold does not fix it. At 0.7 the false-positive rate is still 42.8%. The high recall is substantially over-flagging.It gets worse under window aggregation: a max-pool gate that blocks when any window trips compounds this as1 - (1-p)^N, so an 85-window document is blocked essentially always.We found this by adding matched hard negatives to our own benchmark. The recall-only version never surfaced it, and it was flattering this model. Reproduce withdiagnose_jailbreak.py.The toxicity labels are unaffected. This limitation is specific tojailbreakingon long inputs.
toxicity, severe_toxicity, obscene, threat, insult,
identity_attack, sexual_explicit, jailbreaking.
| measure | mod-1 | mod-2 | toxic-bert | unbiased-roberta |
|---|---|---|---|---|
| Echo false positives (lower better) | 12.5% | 0.0% | 0.0% | 6.2% |
| Jailbreak recall (higher better) | 70.0% | 99.0% | N/A | N/A |
| General quality, macro F1 (higher better) | 0.466 | 0.492 | 0.262 | 0.556 |
| Abusive detection (must survive the fix) | 75.0% | 75.0% | 62.5% | 50.0% |
unbiased-toxic-roberta
(a larger, single-task RoBERTa) beats us on general quality F1, and ties us on
the echo fix. What mod-2 is: the only model here that is both a competitive
toxicity classifier and a jailbreak detector, in one 149M checkpoint, with
zero identity-mention false positives on the held-out set. Against its direct
predecessor, mod-2 wins three of four measures and ties the fourth, with no
regressions.benchmark_moderation.py.
Every input is a public model or dataset; add a model by appending one line.1python benchmark_moderation.py
2python benchmark_moderation.py --models mod-2=opus-research/opus-moderation-2 toxic-bert=unitary/toxic-bertFix: hard safe negatives — a hand-built set of refusals, meta/educational talk, and benign mentions, all containing harmful vocabulary but all labeled all-zeros, fully supervised and upweighted. Counterfactual augmentation (the same idea that fixed identity bias in v1), aimed at the frame problem. Result: the held-out echo FPR went from 12.5% to 0%.
Fix: extra jailbreak positives fromjackhhao/jailbreak-classification, folded into the toxic-chat jailbreak signal. Recall went to 99%.
1from transformers import AutoModelForSequenceClassification, AutoTokenizer
2import torch
3
4name = "opus-research/opus-moderation-2"
5tok = AutoTokenizer.from_pretrained(name)
6model = AutoModelForSequenceClassification.from_pretrained(name).eval()
7
8text = "I won't help you write malware, that's a hard line for me."
9with torch.no_grad():
10 probs = torch.sigmoid(model(**tok(text, return_tensors="pt")).logits)[0]
11
12for i, p in enumerate(probs):
13 print(f"{model.config.id2label[i]:<18} {p:.1%}")
14# a clean refusal that mentions "malware" stays under threshold - the v1 echo bug, fixed.sigmoid, never softmax. Suggested thresholds: 0.5 for most
labels, 0.2 for severe_toxicity (its annotator fractions never reach 0.5 in
the corpus).| Base | answerdotai/ModernBERT-base (149M) |
| Data | civil_comments (soft labels) + toxic-chat + jailbreak-classification + hand-built safe negatives |
| Loss | masked BCE on annotator fractions, no pos_weight |
| Epochs / LR | 2 / 3e-5, bf16 |
| Hardware | unsupported AMD RX 7600 (8GB), ~30 min, $0 cloud |
severe_toxicity stays weak — the label peaks at 0.535 across the corpus;
there is almost no signal to learn. Use toxicity with a high threshold.