use case · basics · inside 6+6 MarianMT EN→DE · q8 WASM · 106.02 MB ONNX · CC-BY-4.0

Inside 6+6 MarianMT EN→DE: Beam 1/2/4, Length Penalty & Word-Order Lab

Compare Beam 1 (Greedy) vs Beam 2 vs Beam 4 speed-vs-fluency with live length_penalty tuning on the 6+6 MarianMT encoder-decoder, then probe how English noun stacks, subordinating clauses, and politeness cues trigger German compound nouns (Komposita), verb-final word order, and Sie vs du.

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

2 · Live Beam 1 vs Beam 2 vs Beam 4 & Length Penalty Benchmark

Each beam width runs sequentially in the same WASM worker on your English sentence using the chosen length_penalty (0.5 favors concise compounds; 2.0 favors longer expanded clauses). Highlighted German tokens in Beam 2 and Beam 4 mark word-order or compound changes relative to Beam 1 (Greedy).

Select an English benchmark sentence

Prepare OPUS-MT EN→DE 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 · Live Compound-Noun, V2 vs Verb-Final & Sie/du Word-Order Probes

Contrast paired English inputs to watch MarianMT synthesize German Komposita, push conjugated verbs to clause-final position after weil/obwohl, split separable verb prefixes (Satzklammer), and select formal Sie vs informal du.

Compound-Noun & Word-Order Minimal Pairs

Linguistic note: —

Select a minimal pair and click Run Compound & Word-Order 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 & length_penalty comparison
Show the code — Deterministic LCS word-diff comparator

Model: Helsinki-NLP/opus-mt-en-de → Xenova/opus-mt-en-de (106.02 MB q8 ONNX, CC-BY-4.0).