Wild · Adversarial Cloze Traps & Counterfactual Log-Odds · 452.56 MB WASM q8

Adversarial Cloze Traps: Adjacent Masks, OOV Splits, Coref & Casing

Probe six failure modes and edge behaviors locally on onnx-community/ModernBERT-large-ONNX: back-to-back [MASK] [MASK] slots, rare CamelCase OOV splits, >600-token coreference, TypeScript syntax holes, [mask] casing errors vs [MASK], and counterfactual minimal-pair log-odds ratios.

1. On-device model

Initialise ModernBERT-Large above to run all six adversarial cloze traps.

2. Six adversarial cloze traps

Traps completed–
Coref (>600t)–
Total latency–
NaN count–
Six adversarial ModernBERT-Large cloze traps showing trap category, label, top fill, diagnostic detail, tokens, and latency
Category Adversarial trap Top fill(s) Confidence / diagnostic Tokens Latency
Run the 6-trap adversarial sweep above.

3. Interactive counterfactual minimal-pair & log-odds sandbox

Compare exact vocabulary probabilities and log2-odds ratios across two minimal-pair templates sharing one [MASK] (or <|mask|>).

Counterfactual candidate probability and log-odds comparison between Context A and Context B
Candidate Context A prob (logit) Context B prob (logit) Log2-odds ratio (A vs B) Favors
Score a counterfactual minimal pair above.

Inspect counterfactual log-odds & candidate scoring

Show the code · modernbert-large-core.mjs — computeLogOddsRatio()
Show the code · worker.js — handleScoreCandidates()