Basics · Identity-Term Counterfactual Parity & Multi-Label Sigmoid · 125.44 MB WASM q8 · Apache-2.0

Inside Unbiased-Toxic-RoBERTa: Counterfactual Parity & Independent Sigmoid

Hold a benign sentence frame fixed while swapping demographic identity terms to verify that unitary/unbiased-toxic-roberta (Apache-2.0) fires the matching subgroup head without raising toxicity or identity_attack — and compare independent per-head sigmoid probabilities against forced softmax.

1. Live Benign Identity-Term Counterfactual Parity Lab

Prompts scored–
Identity parity passed–
Identity mean toxicity–
Identity peak toxicity–
Mean subgroup signal–
Latency / NaN–
Counterfactual identity-term parity table showing toxicity, identity_attack, and active demographic subgroup head
Group Expected Subgroup Max Toxicity Identity Attack Top Subgroup Head Prompt
Initialize the model above to run the counterfactual parity suite.

2. Independent Sigmoid vs Forced Softmax & Threshold Calibration

Multi-label toxicity heads use independent σ(zᵢ) so a single comment can score high on both toxicity and insult (sum > 100%) or low on everything. Softmax forces all 16 logits to sum to 100%, distorting benign or multi-violation inputs.

Toxicity Σσ (7 heads)–
All 16 Heads Σσ–
Active Heads (≥ T)–
Forced Softmax Sum–
BPE Tokens–
NaN Score Check–

Independent Sigmoid σ(zᵢ) — Top 8 Heads

Run comparison above to inspect independent sigmoid probabilities.

Forced 16-Way Softmax(z) — Top 8 Heads

Run comparison above to see how softmax squashes multi-label totals to 100%.

3. Inspect Parity & Softmax Distortion Math

Show the code · toxic-core.mjs — summarizeCounterfactualBatch()
Show the code · toxic-core.mjs — softmaxLogits()