use case · basics · SentencePiece morphology & beam 1/2/4 vs greedy ablation · q8 WASM · 115.20 MB ONNX · Apache-2.0

SentencePiece Morphology & Beam Search (1/2/4) vs Greedy Ablation Lab

Compare Beam 1 (Greedy) vs Beam 2 vs Beam 4 speed-vs-fluency with live repetition_penalty on the 6+6 MarianMT encoder-decoder, then probe how English noun stacks, fronted time adverbials, and phrasal verbs trigger Dutch compound nouns, V2 word order, separable verbs, and u vs je.

1 · OPUS-MT EN→NL worker (115.20 MB q8 ONNX · auto-inits from cache)

2 · Live Beam Search (1 / 2 / 4) vs Greedy Decoding Ablation Lab

Each beam width runs sequentially in the same WASM worker on your English sentence. Highlighted Dutch tokens in Beam 2 and Beam 4 mark word-order or compound differences relative to Beam 1 (Greedy).

Select an English benchmark sentence

Prepare OPUS-MT EN→NL above to run live Beam 1 vs Beam 2 vs Beam 4 decoding.

Beam 1 (Greedy baseline)

—

Latency: — · Tokens: —

Beam 2 (diff vs Beam 1)

—

Latency: — · Overlap: —

Beam 4 (diff vs Beam 1)

—

Latency: — · Overlap: —

Measured Beam Search Latency & Throughput (CPU WASM)

Real SentencePiece Source Subwords (MarianTokenizer)

Run Beam comparison to inspect SentencePiece source subwords.

3 · SentencePiece Morphology: Dutch Compound Nouns, V2 Word Order & Separable Verbs

Contrast paired English inputs to watch MarianMT fuse Dutch compounds (verzekeringsmaatschappij), invert subject and finite verb under Dutch V2 order (haal ik ... op), split separable verb prefixes, and shift between formal u and informal je.

SentencePiece morphology & grammar minimal pairs

Linguistic note: —

Select a minimal pair and click Run Morphology & V2 Probe once the model is ready.

Variant A

—

Tokens: — · Latency: —

Variant B

—

Tokens: — · Latency: —

Show the code — Off-thread Beam 1 vs Beam 2 vs Beam 4 comparison
Show the code — Deterministic LCS Dutch word-diff comparator

Model: Helsinki-NLP/opus-mt-en-nl → Xenova/opus-mt-en-nl (115.20 MB q8 ONNX, Apache-2.0).