Greedy Decoding (num_beams=1)
Latency: — · Output tokens: —
use case · basics · inside MarianMT ZH→EN · q8 WASM · 113.11 MB · CC-BY-4.0
Run the exact same Chinese sentence through Greedy decoding (num_beams=1)
and Beam Search (num_beams=2..4) back-to-back on-device. Measure the real
latency cost per beam, highlight phrasing changes word-by-word, and inspect the exact
MarianTokenizer SentencePiece CJK subwords and length ratios.
Prepare Opus-MT ZH→EN above to compare Greedy (num_beams=1) vs Beam Search live on CPU WASM.
num_beams=1)Latency: — · Output tokens: —
num_beams=3)Latency: — · Output tokens: —
Helsinki-NLP/opus-mt-zh-en uses a joint 65,001-entry SentencePiece vocabulary
(spm32k source + target, <pad>=65000, </s>=0). Watch how
Chinese multi-character compounds pack into single subword IDs while rare words split into single characters.
Run a comparison above to inspect real SentencePiece subwords and IDs.
Weights: Helsinki-NLP/opus-mt-zh-en → Xenova/opus-mt-zh-en (113.11 MB q8 ONNX),
licensed under CC-BY-4.0.