distilbert/distilroberta-base
Xenova/distilroberta-base
fill-mask (RobertaForMaskedLM)
Ġ Word Boundaries: Unlike BERT WordPiece
([MASK] and ## suffixes), DistilRoBERTa uses <mask>
(ID 50264), preserves capitalization (English ≠ english),
and encodes leading whitespace on word-initial tokens as Ġ inside a 50,265-token
byte-level BPE table with 512 content tokens (max_position_embeddings: 514).
1. English <mask> Cloze Completion Workbench
Pick a preset, drag & drop or paste (Ctrl/Cmd+V) a sentence, or type your own
single-<mask> English prompt:
.txt, .md, .csv, or .json file here, or
press Ctrl/Cmd+V outside editable inputs. Use <mask> exactly once on this
workbench (use the Wild Lab tab above for multi-mask sentences).
<mask> locally.
Top-K Candidates & Raw Logits (Click to Preview)
Byte-Level BPE (Ġ) Token Chip Breakdown
Solid border = Ġ space-prefixed word start; dashed = continuation / punctuation;
highlighted = <mask> (50264); muted = <s>/</s>.
2. Why DistilRoBERTa Matters & How It Runs
distilbert/distilroberta-base distills RoBERTa-base from 12 layers (125M params) down to 6 layers (82M params, 85.08 MB quantized WASM) on OpenWebTextCorpus while keeping the full 50,265-token byte-level BPE vocabulary. It is ideal for fast in-browser copyedit cloze, autocomplete ranking, and lightweight downstream classifiers without shipping server requests.
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";
const unmask = await pipeline("fill-mask", "Xenova/distilroberta-base", {
device: "wasm",
dtype: "q8",
});
const out = await unmask("The goal of life is <mask>.", { top_k: 8 });
Show the code · worker.js — runSingleFill() (85.08 MB q8 WASM worker)
Show the code · distilroberta-core.mjs — computeDistributionMetrics() (entropy & NaN check)
3. References & Model Provenance
- Upstream weights & model card: distilbert/distilroberta-base (Apache-2.0)
-
Browser ONNX export:
Xenova/distilroberta-base (
onnx/model_quantized.onnx, 82.97 MB q8) - Paper: Sanh et al. (2019), DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter