Safety labels: WildGuardMix and Social Bias Frames as classification decisions with the other labels as hard negatives: Qwen3.6-35B-A3B-FP8 state/action embeddings
(state, action) embedding pairs from Qwen/Qwen3.6-35B-A3B-FP8
(vLLM pooling runner, last-token pooling, L2-normalized, 2048-d) for post-training contrastive (CLM) heads, built with
clm_train (docs/safety-labels.md, DATASET=safety-labels scripts/embed_chat_sft.sbatch).
Sources:
| split | pairs | tasks | pairs with hard negatives | options views | one-token actions / negatives |
|---|---|---|---|---|---|
| train | 63,608 | 63,608 | 63,608 (k 6) | 63,608 | 0 / 0 |
| val | 6,938 | 6,938 | 6,938 (k 6) | 6,938 | 0 / 0 |
Layout
<split>/state_embeddings.pt float16 [n, 2048] (torch.save; torch.load(..., mmap=True))
<split>/action_embeddings.pt float16 [n, 2048]
<split>/neg_embeddings.pt float16 [n, k, 2048] hard negatives, zero-padded
<split>/neg_counts.pt int64 [n] valid negatives per row
<split>/state_options_embeddings.pt float16 [n, 2048] the options view (state + its options), zero where none
<split>/has_options.pt bool [n]
<split>/single_tokens.npz rows whose action / negative / state is one token, and that token's id
<split>/metadata.json {num_samples, hidden_size, model_name, max_model_len, ..., samples: [one dict per row]}
Row i of every tensor and samples[i] describe one pair; the split is by task (int(task_id[:8], 16) % 10 == 0 -> val).
Decision items have two state views: the state alone and the state with its options listed (state_options_embeddings.pt); post-training trains both (options_view_prob).
One-token sequences. vLLM's pooling of a one-token prompt returns noise for this model, so every one-token action,
negative or state takes its vector from the single-token table
jackyk02/qwen3.6-35b-a3b-fp8-single-token-embeddings;single_tokens.npz lists those rows and token ids (clm_train.data.stores.EmbeddingDir applies it on load).
Use
clm-train posttrain --source hf:safety-labels-qwen3.6 ...
python scripts/download.py data safety-labels-qwen3.6 --rows 20000 --blocks 8
Licences: the sources' (listed in the documentation below); the vectors are a derivative of the source text and carry
its terms.
Dataset documentation (docs/safety-labels.md)
Safety labels: WildGuardMix and Social Bias Frames as classification decisions with the other labels as hard negatives
How allenai/wildguardmix (prompt harm, response harm,
refusal) and allenai/social_bias_frames
(offensiveness, lewdness, offense target, targeted group) become one-step (state, action) pairs for CLM-35B-A3B
post-training: the decision line, the text and the label set as the state, the gold label's text as the action, the
other label(s) as hard negatives. Code: clm_train.data.safety_labels (the reader; the label rows go throughtopic_safety.label_row / decisions.mcq_row), scripts/safety_labels.py, the safety-labels preset ofscripts/embed_chat_sft.sbatch, scripts/verify_store.py --reader safety-labels, tests/test_safety_labels.py.
The text is harmful and offensive by design (both releases are classifier training data); it is kept verbatim and
handled as data.
Why
The Jev Decision Index's Retrieval & Classification area scores binary and closed-set label decisions
(PhishNChips, spam, the moderation board; docs/nvidia-datasets-for-clm.md, #10 and
#19). The recipe's label decisions so far are NVIDIA's: Aegis 2.0 moderation (abstention-safety,data.decisions_qa) and Content-Safety-Reasoning topic control (topic-safety). WildGuardMix adds 87k prompts
(half adversarial jailbreaks) with GPT-4 labels for three distinct decisions, refusal detection among them, which
no store has; Social Bias Frames adds human-annotated offensiveness and which group a post targets, a 7-way
closed-set decision. Neither overlaps the siblings' sources.
The data
| subset | source | revision | rows | size | file read | licence |
|---|---|---|---|---|---|---|
wildguardmix |
allenai/wildguardmix | d29c47f41c8b51348b5c8e8c81c039b3132b66d1 |
86,759 (README) | 53.7 MB | train/wildguard_train.parquet |
ODC-BY (gated: AI2 Responsible Use Guidelines) |
social-bias-frames |
allenai/social_bias_frames, refs/convert/parquet |
453e07c6887c7420e7c62e3bbc1c03ceb4ab0f68 (of main a73510df3ec15f488636be8b66292077719aaa55) |
112,900 annotation rows, 35,504 posts (35,483 after unescaping) | 6.6 MB | default/train/0000.parquet |
CC BY 4.0 |
D=/data/home/jackyk02/datasets/safety-labels
hf download allenai/wildguardmix train/wildguard_train.parquet --repo-type dataset \
--revision d29c47f41c8b51348b5c8e8c81c039b3132b66d1 --local-dir $D/wildguardmix # after accepting the gate on the Hub
hf download allenai/social_bias_frames default/train/0000.parquet --repo-type dataset \
--revision 453e07c6887c7420e7c62e3bbc1c03ceb4ab0f68 --local-dir $D/social-bias-frames
Only the train files are read (is_train): WildGuardTest (test/wildguard_test.parquet) and the Social Bias Frames
dev / test splits are evaluation sets and stay held out even when downloaded. The social_bias_frames main branch is
a loading script that fetches SBIC.v2.tgz from the authors' site; the Hub's parquet conversion of the same script
output is read instead.
WildGuardMix access. The gate was not granted on this account when this was built
(GatedRepoError 403 ... you are not in the authorized list); access needs the account holder to fill AI2's form
and accept the Responsible Use Guidelines on the Hub, which an agent cannot do for them. The reader is written and
tested against the README's documented schema; the WildGuardMix counts below are pending the download.
What the schemas hold
WildGuardMix (README; the file could not be inspected): prompt (str), adversarial (bool), response (str,
None for the 48,783 prompt-only rows), prompt_harm_label (harmful / unharmful, None when annotators did not
agree), response_harm_label (harmful / unharmful, None for prompt-only rows and without agreement),response_refusal_label (refusal / compliance, likewise), subcategory. 37,976 rows have a response. Labels
are GPT-4's; a 500-item human audit agreed on 92% / 82% / 95% of prompt harm / response harm / refusal. The
synthetic prompts come with matched refusal and compliance responses, so one prompt recurs over several rows.
Social Bias Frames is one row per (post, annotator, targeted group): 19 string columns, numbers written as
strings and empty strings for unanswered questions:
| field | values (annotation rows) |
|---|---|
offensiveYN |
1.0 54,218 · 0.0 46,673 · 0.5 (maybe) 9,992 · empty 2,017 |
sexYN (lewd) |
0.0 102,578 · 1.0 9,512 · 0.5 810 |
whoTarget (asked of offensive posts) |
1.0 (a group) 42,480 · 0.0 (an individual) 23,489 · empty 46,931 |
intentYN |
1.0 42,662 · 0.66 15,633 · 0.33 13,887 · 0.0 40,718 |
targetCategory |
race 14,987 · gender 10,872 · culture 8,843 · victim 2,680 · disabled 2,350 · social 1,730 · body 1,032 · empty 70,406 |
targetMinority / targetStereotype |
free text ("black folks", "women are sex objects") |
An annotator who names several targeted groups writes several rows (18,306 annotators with two rows, ~1,000 with
three to six) with the same yes / no answers (offensiveYN never differs within an annotator), so the rows are first
grouped per annotator (WorkerId + HITId), then per post. 414 posts were annotated in more than one HIT; 21 posts
differ only by HTML entities (& vs &) and are merged after html.unescape. Most posts have three
annotators, but 6,047 have only one who answered offensiveYN.
The row design
One row per labelled decision, one (state, action) pair per row:
- state: a one-line decision task, the text, and the label set as options in a fixed order (
A. harmful/B. unharmful), asdecisions.mcq_rowrenders any option choice and as the index presents a classification; - action: the gold label's text (never its letter; the letter stays on the message as
label); - negatives: the other label(s), in the same canonical vocabulary, rendered by the same
action_textpath.
A binary decision has exactly one, labelled<wrong>_when_<gold>(unharmful_when_harmful); a target-group
decision has the categories no annotator named, labelled<category>_when_<gold>(body_when_race).
| domain | decision line (state opens with) | labels |
|---|---|---|
safety-labels/wildguardmix/prompt-harm |
topic_safety.PROMPT_TASK (as the Aegis rows of topic-safety), then User: <prompt> |
harmful / unharmful |
safety-labels/wildguardmix/response-harm |
topic_safety.RESPONSE_TASK, then User: ... / Assistant: ... |
harmful / unharmful |
safety-labels/wildguardmix/refusal |
REFUSAL_TASK ("Refusal detection. Decide whether the assistant's response ... is a refusal of the user's request or complies with it."), the same transcript |
refusal / compliance |
safety-labels/social-bias-frames/offensive |
"Offensiveness. Decide whether the social media post below is offensive (rude, disrespectful or toxic to anyone) or not offensive." then Post: ... |
offensive / not offensive |
safety-labels/social-bias-frames/lewd |
"Lewdness. ..." | lewd / not lewd |
safety-labels/social-bias-frames/target (offensive posts) |
"Offense target. ... aimed at a group of people or at an individual." | a group / an individual |
safety-labels/social-bias-frames/target-group (group-targeting posts) |
"Targeted group. ... Decide which category of group it targets." | race or ethnicity, gender or sexuality, culture, origin or religion, victims of violence or tragedy, disability, social or political group, body or appearance |
The harm decisions reuse topic-safety's decision lines and label strings on purpose: a harm label means the same
thing in both stores and should embed the same way. Aegis itself (in abstention-safety / topic-safety) is not
read here.
One item, several decisions. A WildGuardMix record gives up to three rows and a post up to four, each with its
own decision line. task_id is the hash of the decision's question (decision line + text), so the decisions about
one text are distinct tasks; split is drawn on the hash of the text itself (prompt / post), so they all land in the
same split and no text is in both. Trajectory ids: safety-labels:wildguardmix/wildguard_train:<record>:<decision>,safety-labels:social-bias-frames/train-0000:<post ordinal>:<decision>.
Aggregating Social Bias Frames (majority): a label needs a strict majority (more than half) of the
annotators who answered, and at least two of them. A split vote, a majority of "maybe" (0.5), or a single
annotator gives no decision; the post is not forced into a label. The target decision is asked only of posts whose
majority is offensive (the release asks whoTarget only then), and target-group only of those whose majority
says a group: its gold is the category named by more than half of the annotators who said the post targets a
group, a tie gives no decision. A post can target several groups (a joke about "black women" is race and gender), so
the state always lists all seven categories, and the categories any annotator of the post named are never
negatives (target_group).
Not a decision: intentYN (97% of the offensive posts with a majority are "intended": 9,620 vs 332, a constant
label teaches nothing but a prior); targetMinority / targetStereotype are free text, not a closed label set
(see Open decisions); WildGuardMix's subcategory and adversarial are not labels of the decision.
Duplicates (wildguard_plan): a prompt's harm decision is emitted once, at the prompt's first record, with the
label its records agree on (from any of them); a (prompt, response) pair's two decisions likewise. When a key's
records disagree on the label, the decision is dropped (conflict).
What is dropped
Skips go to on_skip as <trajectory id>:<decision>:<reason>. Over the full Social Bias Frames train file
(35,483 posts):
| decision | kept | too few votes | split | maybe majority | other |
|---|---|---|---|---|---|
| offensive | 25,788 (72.7%) | 6,047 | 2,539 | 1,120 | |
| lewd | 29,209 (82.3%) | 5,744 | 515 | 26 | |
| target (of 10,186 offensive posts) | 10,162 | 24 | |||
| target-group (of 6,026 group-targeting posts) | 5,387 | 639 (ties / no majority) |
WildGuardMix: a label that is None for a record with the text it judges (no annotator agreement) is counted as<decision>:missing-label; the response labels of a prompt-only record are not decisions at all and are not counted.
Counts pending the download.
Hard negatives: shortcut audit
| decision | pairs | negatives per pair | pairs without | mean chars, action / negative | gold balance |
|---|---|---|---|---|---|
| offensive | 25,788 | 1 | 0 | 11.4 / 10.6 | 10,186 offensive · 15,602 not |
| lewd | 29,209 | 1 | 0 | 7.7 / 4.3 | 1,980 lewd · 27,229 not lewd |
| target | 10,162 | 1 | 0 | 9.4 / 10.6 | 6,026 a group · 4,136 an individual |
| target-group | 5,387 | 6: 4,689 · 5: 667 · 4: 31 (mean 5.86) | 0 | 20.5 / 20.8 | race 2,107 · culture 1,232 · gender 1,161 · victim 397 · disability 284 · social 151 · body 55 |
Every label string occurs both as an action and as a negative, so length differences are the class balance, not a
surface cue (the lewd gap is "not lewd" being the usual gold). The cap K is 1 for the binary decisions and 6 for
target-group (seven categories); the store pads to 6. No negative equals its action after norm_text + lower case,
and no pair has a duplicate negative (checked over every pair; asserted in the tests).
Manual audit (22 random posts with decisions, 51 pairs, read with every
annotator's votes): no false negatives found. Observations:
- the "other label" of a majority decision is sometimes the vote of one annotator: 3,667 of the 25,788 offensive
pairs and 1,518 of the 29,209 lewd pairs have an annotator who voted for the label that is the negative (a further
3,442 / 294 have a "maybe"). Example: "what did george michael and madeleine mccann have in common? they both had
gaping assholes ..." is lewd for one annotator of three, solewdis its negative. The rule follows the
coordinator's instruction (strict majority, one negative per binary pair); see Open decisions; - a post naming a woman ("... exposing a woman on the tl ...") was annotated race only by both annotators, so
"gender or sexuality" is its negative: annotator judgement, kept; - "White Monopoly Capital & white people are the 'enemy'" was annotated an individual by all three: kept, it is
their label.
What changed after the dry run and audit: posts equal after HTML unescaping were merged (they gave 6 duplicate
states, hence duplicate tasks, before).
Counts
- Dry run (CPU, full SBF train file): 70,546 pairs, 96,752 negatives (offensive 25,788, lewd 29,209, target
10,162, target-group 5,387 with 31,593 negatives); every state is under 310 tokens with its options (p50 ~66, max
308), every action under 8. - Smoke source (
LIMIT_ROWS=300posts; WildGuardMix absent): 495 pairs (offensive 156, lewd 203, target 101,
target-group 35), 669 negatives. - Smoke store (Slurm job 17030, 1 GPU, 2 min): 495 pairs (442 train, 53 val), 495 tasks, 669 negatives
(neg_embeddings.pt[n, 6, 2048]), 247 skips (the dry run's);verify_store.py --reader safety-labels --limit-rows 300: pair, task and trajectory ids match the source, token counts re-rendered for all 495 pairs match,RESULT: OK. - Expected full count: 70,546 Social Bias Frames pairs, plus WildGuardMix up to ~86.8k prompt-harm (fewer after
merging recurring prompts) + ~38k response-harm + ~38k refusal decisions, minus missing labels: on the order of
150-230k pairs once the gated file is downloaded.
Building the store
DATASET=safety-labels sbatch scripts/embed_chat_sft.sbatch # 8 GPUs
NUM_GPUS=1 LIMIT_ROWS=300 DATASET=safety-labels SRC=/data/home/jackyk02/datasets/safety-labels \
OUT=.../safety-labels-smoke sbatch --gres=gpu:1 --cpus-per-task=8 --mem=120G scripts/embed_chat_sft.sbatch # smoke
python scripts/safety_labels.py --source /data/home/jackyk02/datasets/safety-labels --out <store> # the same, directly
python scripts/verify_store.py <store> --source /data/home/jackyk02/datasets/safety-labels --reader safety-labels [--limit-rows 300]
The window is 16,384 tokens (MAX_LEN_SAFETY_LABELS; posts are under 310, WildGuardMix's adversarial prompts and
responses a few thousand at most), 128 one-step rows per engine wave. Each file is read whole (both are small) so
that recurring prompts and the annotators of a post are resolved over all of it; keep(i) / LIMIT_ROWS count
records (WildGuardMix) or posts (Social Bias Frames).
Open decisions
- Dissenting votes. Majority labels keep the other label as the negative even when one annotator chose it
(14% of the offensive pairs). A stricter variant would keep the pair but drop the negative unless the vote was
unanimous, or weight the negative by agreement. - WildGuardMix needs the gate accepted; then download, re-run the dry run for its counts (recurring prompts,
missing labels, token lengths of the adversarial prompts) and re-smoke. - Free-text frames.
targetMinority("asian folks") andtargetStereotype(the implied statement) could
become open question -> answer pairs (post -> implied stereotype), but they are generation targets with many
acceptable answers, not label decisions, and have no clean negatives. - Single-annotator posts (6,047) are dropped; the SBF paper's own aggregation (mean > 0.5) would keep them.