use case · basics · inside MarianMT decoding & Arabic tashkeel · q8 WASM · 110.88 MB · Apache-2.0

Inside MarianMT AR→EN: Beam Search & Tashkeel Diacritic Ablation

Explore two fundamental mechanics of Opus-MT AR→EN: (1) how expanding num_beams (1 vs 2 vs 4) reshapes VSO-to-SVO English phrasing at the cost of latency, and (2) how Arabic vocalization diacritics (tashkeel / harakat) inflate SentencePiece subwords and shift decoded meaning in real time.

1 · Opus-MT AR→EN worker (110.88 MB q8 WASM · Apache-2.0)

2 · Side-by-Side Beam 1 vs Beam 2 vs Beam 4 Word-Diff

Curated Arabic sentences for decoding comparison

Prepare Opus-MT AR→EN above to compare greedy vs beam-search decoding live.

Source SentencePiece—
Beam-2 diff vs B1—
Beam-4 diff vs B1—
NaN count—

Beam 1 (Greedy)

—
Waiting for comparison…

Beam 2 (2-way)

—
Waiting for comparison…

Beam 4 (4-way)

—
Waiting for comparison…

Shared Source SentencePiece Subwords

Run Beam comparison to inspect SentencePiece tokens.

3 · Live Tashkeel Diacritic Ablation (Vocalized vs Stripped)

Short-vowel harakat (َ ِ ُ ّ ْ) disambiguate Arabic case endings and passive voice (كَتَبَ vs كُتِبَ), yet SentencePiece was trained primarily on unvocalized text. Run both forms side-by-side to observe real subword inflation and translation shift.

Ready to run vocalized vs unvocalized Tashkeel ablation once the model loads.

Vocalized tokens—
Stripped tokens—
Token inflation—
Translation overlap—
NaN count—

A · Vocalized (With Tashkeel)

—
Waiting for ablation run…

B · Unvocalized (Tashkeel Stripped)

—
Waiting for ablation run…

4 · Inspect Beam Comparison & Tashkeel Ablation Code

Show the code — Off-main-thread Beam 1 vs Beam 2 vs Beam 4 pass
Show the code — Vocalized vs stripped unvocalized Tashkeel ablation