Basics Β· 8,192-Tok Retention & Top-K Calibration Β· 154.68 MB WASM q8

8,192-Token RoPE Retention vs 512-Token Cutoff & Top-K Calibration

Every third layer of ModernBERT uses global attention with RoPE ΞΈ=160,000, preserving early facts across hundreds or thousands of intervening tokens. Test how a 512-token clip loses an early directive while full ModernBERT keeps it β€” and calibrate multi-mask entropy across top-k depths.

1. On-device model

Initialise ModernBERT-Base above to run the 8,192-token retention and top-k calibration labs.

2. Long-Context [MASK] Retention vs 512-Token BERT Clip

A key fact sits near the start of an expanding log, while [MASK] asks for that fact at the tail. Each rung runs twice: Full ModernBERT RoPE (up to 8,192 tok) vs a max_length: 512 truncation clip.

Full ModernBERT RoPE vs 512-token truncation predictions across increasing document lengths
Rung tokens Full RoPE top guess Full target prob 512-tok clip guess 512-tok target prob Latency (full / clip) NaN
Initialise the model and run the retention audit above.

3. Multi-Mask Cloze & Top-K Depth Calibration

Adjust top-k to watch how probability mass accumulates across the 50,368-token BPE vocabulary, and inspect raw Δ  word-initial prefixes vs subword continuations.

Mask slots–
Top-1 share–
Top-k mass–
Entropy / Eff. choices–
Latency–

Inspect the needle builder & canvas chart

Show the code Β· modernbert-core.mjs β€” buildLongContextNeedleProbe()
Show the code Β· modernbert-base.js β€” drawLengthRetentionChart()