fill-mask · 297.4 MB WASM q8 · 12-Layer Transformer (278M) · 100 Languages · MIT

XLM-RoBERTa Base — 100-Language Cloze & Cross-Lingual Probing

FacebookAI/xlm-roberta-base (served via Xenova/xlm-roberta-base , MIT) is a 12-layer multilingual masked language model (278M total params, 280.31 MB q8 ONNX + 17.08 MB SentencePiece tokenizer = 297.4 MB WASM download) sharing a single 250,002-token vocabulary across 100 languages with <mask> cloze prediction on your device.

Upstream Model FacebookAI/xlm-roberta-base
ONNX Artifact Xenova/xlm-roberta-base
Pipeline Task fill-mask
Size & Quant 297.4 MB · WASM q8 (280.31 MB ONNX + 17.08 MB tok)
Vocab & Mask 250,002 SentencePiece · <mask>
License & Context MIT · 512 tokens · 100 languages
One Shared Multilingual Vocab (No Language Switch): XLM-RoBERTa uses RoBERTa-style <mask> (token ID 250001) rather than BERT's [MASK]. SentencePiece prefixes word-initial tokens with ▁ (U+2581), so one 250K softmax head ranks English, French, Spanish, German, Japanese, Chinese, Arabic, Hindi, and Russian together.

1. 100-Language <mask> Cloze Completion Workbench

Pick a language preset across 9 scripts, drag & drop or paste (Ctrl/Cmd+V) a sentence, or type your own single-<mask> cloze prompt:

Drop a .txt, .md, .csv, or .json file here, or press Ctrl/Cmd+V outside editable inputs. Use <mask> exactly once on this workbench (see the Wild Lab tab above for multiple masks).
Initialize the model above to fill <mask> locally.
Inference latency–
Top-1 prediction–
Full-vocab entropy–
Top-K prob mass–
SentencePiece tokens–
NaN score check–
Backend / dtypeWASM · q8

Top-K Candidates & Raw Logits (Click to Preview)

Awaiting live inference…

SentencePiece ▁ Subword Chip Breakdown

Solid border = ▁ word-initial token; dashed = continuation subword; highlighted = <mask> (250001).

Run inference to inspect SentencePiece ▁ tokens.

2. How XLM-RoBERTa Base Works in Browser

FacebookAI/xlm-roberta-base trains a 12-layer RoBERTa encoder on 2.5 TB of filtered CommonCrawl CC-100 across 100 languages with a shared 250,002-token SentencePiece Unigram model. Every language shares the same embedding matrix and MLM head, enabling cross-lingual cloze completion without language IDs.

import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";

const unmask = await pipeline("fill-mask", "Xenova/xlm-roberta-base", {
  device: "wasm",
  dtype: "q8",
});
const out = await unmask("La capitale de la France est <mask>.", { top_k: 8 });
Show the code · worker.js — runSingleFill() (297.4 MB q8 WASM worker)
Show the code · xlmr-core.mjs — computeDistributionMetrics() (entropy & NaN check)