a visual guide  ·  paper results, with labelled schematics

Shieldstral,
taken apart

Shieldstral is an open-weight moderation model. It carries no fixed list of harm categories. You hand it the moderation criterion as plain text at inference time and it answers one yes/no question about one document.

I worked on Shieldstral, and this is my attempt to lay the paper out visually. Every figure is live, so you can scroll through the method and try each piece as you get to it.

arXiv 2607.25857 weights Apache 2.0 text F1 84.9 multimodal F1 83.8

The idea

Why a fixed list of harms breaks, moderation as one yes/no question, the three fields, two logits, and one document answered yes and no depending on the question.

The data

Per-dataset processors, strictness tiers, seven document formats, hard negatives, the LLM rewrite loop, free positives up the tree, and why the image data had to be built differently.

The training

What the checkpoint actually is, LoRA against full SFT, two checkpoints wrong in opposite directions, and the SLERP merge that ships instead of either.

Does it hold up

An evaluation taxonomy built not to match the training one, the benchmark numbers, the adaptability loss to a 20B model, the language holes, and how to run it.

scroll  ·  the figure on the right is live

The idea

A moderation model whose rules are not in its weights. What that costs, and what it buys.

01§1

Most moderation models decided already

A moderation model sits between your users and your language model. The usual design trains a classifier against a fixed taxonomy: content in, a label from that taxonomy out.

The report names two costs. Public safety datasets disagree with each other, so there is no single taxonomy that fits all of them. And a fixed model returns the same label no matter who is asking. The report's example: content that is fine for a cybersecurity research tool could be deeply harmful on a mental health platform.

Drop a deployment rule into both models. Only one of them reads it.
02§2

Everything becomes one yes or no

Shieldstral answers one yes/no question about one document, and the caller supplies the question. That is the whole reformulation.

A binary toxicity set, a fifteen-category hate taxonomy, a jailbreak detector and a refusal corpus all turn into the same kind of row. The difference between them moves into the query.

03§2

Three fields with different jobs

A fixed system message sets the meta task and restricts the answer to yes or no. Everything the caller varies sits in three tagged fields underneath.

<Instruct> is the framing: what surface is this, how strict. <Query> is the actual question. <Document> is the content, text or image or both.

Keep the instruction constant across a product surface, change the query per policy.

Assemble a request. Change the strictness and watch which words move.
04§2

Two logits, and nothing else

Training is ordinary cross-entropy over the full vocabulary. Inference reads out exactly two token ids, yes and no, and softmaxes over just those.

One forward pass, one token, a continuous score thresholded at 0.5.

Drag the two logits. Only the gap between them matters.
There is no reasoning trace. When it flags something you disagree with, there is nothing to read.
05§3.3

Same text. Different question.

One document, held fixed. Two questions, both about harm, and the verdict flips between them.

The report calls this the iso-content setting, and the pipeline generates training data this way on purpose.

Swap the question. Not one character of the document moves.
06§4.1

Hold the question still

Harder test. One question, two documents, both rewritten from the same innocuous sentence. Both are unsafe by any ordinary reading. Only one matches the question.

A model that has only learned this text feels dangerous answers yes to both. This is iso-query, and it is how the model gets evaluated.

07§3

Datasets that disagree, folded into one objective

Binary flags, multi-label taxonomies, severity scales. Force them into a shared category set and you need a lossy mapping for every one.

Instead, each dataset's labels become questions phrased in that dataset's own terms, each with a yes or no answer. The source taxonomies never need a shared category vocabulary.

the data section

The data

Fifty-four million rows. The architecture is a paragraph, the pipeline is the paper.

08§3

Fifty-four million rows

Roughly 54.1M samples in three unequal buckets: 45.2M from public datasets, 4.4M synthetic contrastive text, 4.5M multimodal.

Public text dominates by an order of magnitude. The two smaller buckets are about the same size, and the multimodal one is small for a reason that comes up in beat 19.

09§3.1

One hand-written processor per dataset

Every source dataset gets a processor, designed by hand from that dataset's documentation. It encodes the labelling logic, the category mappings and the instruction templates for that source.

The report does not say how many processors there are, only that every dataset has one.

10§3.1

Strictness is assigned per dataset

An LLM paraphrases each processor's instruction templates. The variants encode the task framing, the domain, and one of three strictness tiers.

Adversarial jailbreak and visual safety data get strict templates. General safety, hate and toxicity get moderate. Response quality and dialogue moderation get lenient.

The tiers train different intended decision boundaries into one model. Setting strictness in the instruction at inference time picks between them.

11§3.1

Three shapes of question

Category-specific queries for datasets with fine-grained taxonomies. Binary queries about overall safety. And dedicated refusal-detection queries, for working out whether a response is a refusal rather than whether it is harmful.

Each has multiple paraphrase variants in a pool.

12§3.1

Seven ways to write down a conversation

Prompt and response pairs get rendered through one of seven format families. Bracketed, XML, Markdown, role-based, and three more.

Every one is a delimiter convention some real system uses. Training across all of them is meant to stop the model depending on any single one.

Flip through the formats. Same exchange, seven skins.
13§3.1

One sample, many views

At training time each sample draws an instruction phrasing and a query variant from its processor's pools. Prompt and response examples also draw one of the seven formats.

Across epochs the same content shows up under many framings, so there is no fixed wording to memorise.

Roll it. Watch how far one row can travel.
14§3.2

Ask the same harmful text three ways

For each piece of harmful content the pipeline emits positives at several granularities: a coarse binary query, a category-specific query, and a target-group-specific one where the annotation supports it.

All three are labelled yes. The model learns that the same violation answers to a broad question and a narrow one.

15§3.2

Unsafe content, correct answer no

Three negative strategies. Category-based pairs content violating A with queries about B and C. Demographic-based pairs content targeting one group with queries about unrelated groups. Safe-content pairs safe text with ordinary harm queries.

The first two are the interesting ones. The document is unsafe and the answer is still no. That is the discrimination a general harm detector fails.

16§3.2

Rebalance, then throw away the wrong labels

Contrastive construction produces far more negatives than positives, since any absent category is a hard negative while positives are limited to what the annotation asserts. Each positive gets duplicated with a freshly paraphrased instruction and query to lift the ratio.

Public safety datasets also contain incorrect labels, so an open-source LLM cross-validates them at the binary and per-category levels, and disagreements are dropped.

17§3.3

One call in, two contradictory rows out

Public data lacks near-miss pairs, so they get generated. An LLM receives a safe source text, a target category and a sibling category, and returns an unsafe rewrite that hits the target while avoiding the sibling, a query about the target, and a query about the sibling.

Positive is rewrite plus target query, answer yes. Negative is the identical rewrite plus sibling query, answer no.

4.4M samples come out of this stage.
18§3.3

Free positives, all the way up the tree

The training taxonomy is hierarchical, 11 super classes and 73 leaves. Content violating a leaf necessarily violates every ancestor above it.

The pipeline reuses the same rewrite with ancestor-level queries, all labelled yes. Extra positive rows at zero additional generation cost, and the model sees the same violation at several granularities.

Pick a leaf. Watch the free rows stack up.
19§3.4

You cannot rewrite an image

Image moderation datasets are fewer, smaller and narrower. Worse, the trick from beat 17 does not transfer: you cannot generate an unsafe image the way you rewrite an unsafe sentence.

The pipeline borrows instead. General-purpose classification and object-detection datasets supply a large pool of naturally safe images to use as negatives.

20§3.4

If you cannot move the picture, move the question

About 2,000 query phrasings come from a fixed fourteen-subcategory visual moderation taxonomy covering NSFW, violence, hate and illegal content.

Around 30% are inverse formulations, asking whether an image is safe from something rather than whether it contains it, so the model handles both polarities.

21§3.4

Two different bars for two different pools

A vision-language reranker scores every image and query pair to catch mislabelled source data and hallucinated labels. The thresholds are deliberately asymmetric.

Lenient on the rare violation samples so they survive. Strict on the abundant negatives, where throwing away anything doubtful costs little.

Put both pools on one cut and watch what stops surviving.

the data sectionI

The training

Two checkpoints that are wrong in opposite directions, and the merge that fixes it.

22§5

What the checkpoint actually is

Section 5 names Ministral-3-3B-Base-2512 as the starting point, a 3B causal language model with native multimodal support through a vision encoder.

The 3B in the title is the language model. The vision encoder sits on top of it, so the checkpoint you download is larger than 3B.

Two more things the architecture section does not say out loud. LoRA is applied to the language model parameters only. And what ships is the three-way merge in beat 25, whose third component is Ministral-3B-Instruct, the base instruct checkpoint.

23§6.1

LoRA, no significant difference

Fine-tuning is LoRA with cross-entropy on the single output token. Both LoRA and full SFT were tried.

Full SFT is 0.7 F1 ahead on Aegis v2 validation. LoRA is 0.5 ahead on the fine-grained taxonomy validation set. The report treats that as no significant difference and takes LoRA for training efficiency.
24§6.2

What P and PG each get wrong

P trains on public safety data only. PG adds the generated taxonomy data from the data section.

P is calibrated to Aegis v2 and weak on unseen fine-grained policies. PG is strong on fine-grained policies and drifts on Aegis v2. Neither one is what you want to ship.

25§6.2

Interpolate the weights instead of picking one

Spherical linear interpolation, with a third ingredient: a 0.1 slice of the base Ministral-3B-Instruct, because general instruction following transfers to the safety task.

Final recipe 0.6 PG + 0.3 P + 0.1 I, produced through pairwise merges.

Click each recipe. Only these five were measured, so there is nothing in between to slide through.
26§7.4

Where the capability comes from

On the fine-grained taxonomy validation set, the untrained base model scores zero F1, zero precision, zero recall. It never predicts a violation. Accuracy is 37.8, which looks like partial competence and is not.

0.0 with no safety training. 61.1 on public data alone, on a taxonomy it has never seen. 84.4 once the generated data goes in. 88.7 after the merge.
Precision falls from 90.8 to 75.9 as recall climbs from 46.0 to 95.0. The F1 gain is real, and it lands you at a different operating point.

Does it hold up

An evaluation built not to match the training taxonomy, the numbers, and the places it loses.

27§4.2

Built on purpose not to match

Generate training data from a taxonomy, evaluate against the same taxonomy, and you might only be measuring memorisation. The evaluation taxonomy is built separately.

Training has 11 super classes and 73 leaves. Evaluation has 12, 26 and 52, with exactly two leaves per subcategory. Different names, different granularity, different groupings. Generation and verification use different LLMs and seeds too.

Ten of the twelve evaluation super classes have a loose training counterpart. No leaf maps one to one.
28§4.1

One canonical question per category

Training randomises the phrasing. Evaluation does the opposite: one manually authored query per category, 90 in total, applied uniformly. That takes template luck out of the measurement.

A second LLM then verifies every sample, checking the label is right and the sample is answerable against the fixed query. Mismatches are discarded.

29§7.1

Level with a model seven times its size

Across the text safety benchmarks Shieldstral averages 84.9 F1, tied exactly with GPT-OSS-Safeguard-20B. It is the smallest model in the comparison.

Filter to the rows where it does not win. There are plenty.
30§7.3

The highest mean on the image benchmarks

83.8 average F1 across the three multimodal benchmarks. The next highest is OmniGuard-7B at 77.6, and Shieldstral has under half the parameters.

It loses LlavaGuard to LlavaGuard, 72.0 against 81.4. Some of that benchmark's test images were unavailable, so every model there is scored on the available subset.

31§7.2

Second on adaptability

On the adaptability benchmark GPT-OSS-Safeguard-20B wins with 94.1 to Shieldstral's 91.3. The report is upfront about why: per-category policy prompts, reasoning that decomposes an unfamiliar policy, and roughly seven times the parameters.

Shieldstral returns one token instead of a reasoning trace. The report gives no latency or cost measurement for this comparison, so treat the tradeoff as directional.

32App. A

The holes are in the low-resource languages

Twelve languages are officially supported and the benchmarks reach 17 and 28. Performance is not uniform, and the report says so.

For Shieldstral, Indonesian has the widest prompt to response gap: 55.5 F1 on prompt classification against 94.1 on response.
Sort by Shieldstral's score to bring the weak cells to the top.
33model card

One endpoint call to a verdict

Apache 2.0, fits in 16GB of VRAM in BF16, serves through vLLM, llama.cpp, SGLang or Transformers.

The one non-obvious part: the endpoint hands back token logprobs, not a score. You pull the yes and no values yourself and renormalise.

34model card

What it will not do for you

Coverage is uneven across languages and domains. Synthetic and public labels still carry noise. Obfuscated or very long inputs degrade it, and it was trained to 32k tokens even though the architecture goes further.

The last limit is architectural. A single-token verdict has nothing attached to inspect.

Notes

Numbers and section references come from the paper, arXiv 2607.25857, and the model card. Where the paper does not report something, the beat says so instead of guessing.

If a figure here disagrees with the paper, the paper is right. Tell me and I will fix it.

Avinash Sooriyarachchi