At a glance
| Model (ONNX) | onnx-community/ModernBERT-large-ONNX (upstream: answerdotai/ModernBERT-large) |
|---|---|
| Task / architecture |
fill-mask · ModernBertForMaskedLM (28 layers · 1,024
hidden · 16 heads · 2,624 GeGLU FFN · 395,881,664 params)
|
| Context & attention |
8,192 tokens (max_position_embeddings: 8192) · 10 global
layers (θ=160,000, every 3rd layer) + 18 local 128-tok sliding-window layers (θ=10,000)
|
| Tokenizer & mask token |
Byte-level BPE (50,368 vocab) · [MASK] (token id
50284; UI auto-normalizes <|mask|>) ·
[CLS] 50281 · [SEP] 50282
|
| Quantization & size |
q8 (onnx/model_quantized.onnx / model_int8.onnx
· 448,957,636 B · ~452.56 MB total incl. 3.58 MB tokenizer.json + configs)
|
| Runtime & backend |
Shared @huggingface/transformers@3.7.5 on WebAssembly (wasm)
in a dedicated module Web Worker
|
| License | Apache-2.0 |
| Web APIs | WebAssembly, Web Workers, Cache Storage, File & Clipboard APIs |
Run it — Interactive 8K-Context Fill-Mask Studio
Initialise ModernBERT-Large above to predict [MASK] completions locally in your browser.
See inside — 28-layer RoPE schedule & byte-level BPE tokens
Every third layer in ModernBertForMaskedLM (layers 1, 4, 7, 10, 13, 16, 19,
22, 25, 28) computes full global attention (RoPE θ=160,000), while the other 18 layers
attend over a 128-token local sliding window (RoPE θ=10,000). Word-initial BPE tokens
retain a Ġ marker in the 50,368-entry vocabulary.
Indigo = Global full-context layer (10 layers, every 3rd) · Green = 128-token local sliding window (18 layers).
Encoded BPE token strip
Why it matters
Classic 2018 encoders stop at 512 tokens and struggle with source code or multi-paragraph audit trails. ModernBERT-Large brings 395.9M bidirectional parameters across 28 layers and an 8,192-token RoPE window straight into the browser — enabling document-wide cloze recovery, PII transcript reconstruction, and Base-vs-Large KL calibration with zero server round-trips.
- 8,192-token long-document cloze — resolve blanks conditioned on facts thousands of tokens earlier without chunking or truncation.
- Code & technical copyediting — trained on 2T tokens of English and source code so operators, keywords, and domain identifiers rank sharply.
- Exact logit auditing — inspect raw pre-softmax logits, Shannon entropy, and BPE word-boundary markers locally on WebAssembly.
Use-case ladder
Basics · Global/Local Attention & 128→1,200+ Tok Needle Lab
Explore the 28-layer alternating attention schedule and measure cloze retrieval across 128, 600, and 1,200+ tokens vs a 512-token BERT truncation cutoff.
Practical · Batch Cloze, Glossary & PII Reconstruction
Drop multi-file `.txt`, `.md`, `.csv`, or `.json` drafts, pick CSV columns, cancel batches mid-flight, and export OWASP formula-safe CSV, JSON, and Markdown.
Wild · Adversarial Cloze Traps & Counterfactual Log-Odds
Probe adjacent masks, OOV identifier splits, >600-tok coreference, TypeScript syntax holes, `[mask]` casing traps, and minimal-pair bias with mid-suite Cancel.
Multi-model · Large (395M) vs Base (149M) KL Divergence
Pit ModernBERT-Large directly against sibling ModernBERT-Base to measure real KL divergence, JS divergence, and top-1 cloze agreement.