Basics · Binary Forced-Choice Calibration & Temperature Scaling · 67.58 MB WASM q8 · Apache-2.0

Binary Forced-Choice Calibration: Factual Neutrals vs Logit Margin & Temperature

Because distilbert/distilbert-base-uncased-finetuned-sst-2-english (Apache-2.0) has only two output classes (NEGATIVE and POSITIVE), factual statements have nowhere to abstain. Measure how raw logit margin (|z_pos − z_neg|) and temperature scaling (T) reveal hidden uncertainty.

1. Binary Forced Choice on Factual vs Polarized Sentences

Factual mean conf–
Polarized mean conf–
Mean logit margin–
Mean binary entropy–
Low-margin suspects–
6-pass latency / NaN–

Forced Binary Split Chart (POSITIVE vs NEGATIVE Probability)

Initialize the model above to plot live binary calibration splits.
Binary forced-choice probabilities, raw logits, margin, and entropy across factual and polarized sentences
Group Expected SST-2 Forced Call Raw Logits [Neg, Pos] Margin / Entropy Sentence
Run the 6-sentence calibration suite above.

2. Raw Softmax vs Temperature Scaling & Uncased Folding Check

Inspect unnormalized raw logits [z_neg, z_pos], adjust softmax temperature (T = 0.50 … 2.50) client-side without re-running inference, and verify that do_lower_case: true makes uppercase shouting identical in logits to lowercase text.

Logit Margin |z₁−z₀|–
Raw Logits [Neg, Pos]–
Raw Entropy–
Scaled Entropy (T)–
WordPiece Tokens–
UPPERCASE Drift–

Raw Model Softmax (T = 1.00)

Run raw logit inspection above.

Temperature-Scaled Calibration (T = 1.00)

Adjust temperature slider after inspection to calibrate confidence.

3. Inspect Logit Margin & Temperature Calibration Math

Show the code · sst2-core.mjs — computeLogitStats()
Show the code · sst2-core.mjs — softmaxLogits()