Pair masked language modelling with cross-lingual semantic verification offline (415.4 MB
combined): Stage 1 (FacebookAI/xlm-roberta-base via
Xenova/xlm-roberta-base, 297.4 MB WASM q8, MIT) proposes
top-K <mask> completions, and Stage 2
(Xenova/paraphrase-multilingual-MiniLM-L12-v2, 118 MB WASM q8,
Apache-2.0, reusing ../opus-mt-en-romance/embed-worker.js) embeds the
reference sentence and all completed candidates into a shared 384-d space to rerank by real
cos(Reference, Candidate) fidelity.
Why Rerank Cloze Candidates Semantically: XLM-RoBERTa often assigns high prior
probability to generic function words (like the or la). Embedding each
completed candidate alongside a cross-lingual reference sentence in Stage 2 exposes semantic drift and
promotes factually faithful completions.
1. Two Independent On-Device Models (415.4 MB Combined)