NL ↔ EN Translator (74M)
A Dutch↔English translation model that runs entirely in a browser tab. There is no server and no API call at inference time: the graphs download once and the text stays on the machine.
Try it: open the demo
One model covers both directions. 74M parameters, full FP32, 387 MB across two ONNX graphs and a 482 KB tokenizer, an 8,192-position window, and nothing to install — any ONNX Runtime will load it. The browser build runs on WebGPU.
One model, both directions
A single <translate> marker frames the source text and the model infers the direction from
it. No direction flag, no language prefix:
<translate> Ik spreek Nederlands. <translated> → I speak Dutch.
<translate> I speak Dutch. <translated> → Ik spreek Nederlands.
Details
| Parameters | ~74M |
| Architecture | encoder–decoder transformer, 10 + 10 layers |
| d_model | 512 |
| Attention heads | 8 query, 4 KV (GQA 2:1) — 8 KV in these graphs, see Scope |
| Head dim | 64 |
| Feed-forward | 1280, SwiGLU |
| Normalisation | RMSNorm, pre-norm, plus QK-Norm in every attention layer |
| Positions | RoPE, base 10,000 (YaRN configured but not active) |
| Vocabulary | 16,000, SentencePiece unigram, embeddings tied |
| Context | 8,192 positions available; trained on ≤1,024 tokens |
| Checkpoint | step 2,435,000 |
| Validation | cross-entropy 1.10029 on a held-out split |
| Precision | FP32, ONNX opset 17 |
| Total size | 387 MB |
Files
| File | Size | Purpose |
|---|---|---|
onnx/encoder.onnx | 156 MB | input_ids → encoder_hidden |
onnx/decoder.onnx | 231 MB | decoder + LM head, KV cache in/out |
onnx/INFERENCE.md | — | the full 22-input decoder contract and a reference driver |
tokenizer/tokenizer.model | 482 KB | SentencePiece model (Python, ORT, WASM) |
tokenizer/tokenizer.vocab | 271 KB | plain vocabulary |
tokenizer/tokenizer.json | 517 KB | ID↔piece map for the browser path |
tokenizer/tokenizer_config.json | 288 B | special-token config |
tokenizer/special_tokens_map.json | 182 B | special-token map |
Special token IDs: <pad> 0, <unk> 1, <sos> 2, </s> 3, <translate> 4,
<translated> 5.
Running it
Two sessions, one decoder step per token, with the KV tensors fed back as the next step's
cache. Input names, shapes, cache layout and a working Python loop are in
onnx/INFERENCE.md — worth reading first, since the graph interface is
specific to this export.
In a browser: ONNX Runtime Web with the WebGPU execution provider. Both sessions load once per page and stay resident, so repeat translations reuse the same graph without rebuilding sessions or re-reading files.
What it is good at
Sentence and paragraph translation of general prose: conversation, articles, reviews, stories and documents. It works best around a paragraph at a time, and newlines are preserved through the tokenizer, so multi-paragraph text keeps its layout.
Results
WMT24++ full test set, greedy decoding, scored with sacreBLEU, checkpoint step 2,435,000. Canary
and bad-source rows dropped: 960 segments per direction. Google and Microsoft rows are from
Mozilla's published leaderboard; both opus-mt rows were re-run on these same 960 segments.
en→nl
| System | Params | BLEU | chrF | chrF++ |
|---|---|---|---|---|
Google Translate (v2) | — | 36.85 | 62.85 | 60.84 |
Microsoft Translator (3.0) | — | 34.90 | 61.24 | 59.24 |
| this model | 74M | 28.70 | 56.13 | 54.00 |
opus-mt-en-nl (Helsinki-NLP) | 77M | 25.47 | 53.56 | 51.29 |
nllb-200-distilled-600M (Meta) | 600M | 21.20 | 46.80 | 44.84 |
nl→en
| System | Params | BLEU | chrF | chrF++ |
|---|---|---|---|---|
Microsoft Translator (3.0) | — | 35.24 | 61.41 | 59.68 |
Google Translate (v2) | — | 34.97 | 61.67 | 59.85 |
| this model | 74M | 30.93 | 57.71 | 55.82 |
opus-mt-nl-en (Helsinki-NLP) | 77M | 30.70 | 57.22 | 55.33 |
nllb-200-distilled-600M (Meta) | 600M | 28.24 | 52.82 | 50.99 |
Selected baselines, not a complete leaderboard.
Scope
- Browsers with WebGPU. Chrome/Edge, Safari 26+ and Firefox on Windows all run it. A WASM CPU path is included, though CPU-only frames can struggle to allocate the 231 MB decoder.
- Dutch ↔ English, both directions. That is the pair it was trained for.
- Paragraph-scale input. Training used sequences up to 1,024 tokens, which covers a paragraph or several. The 8,192-position window is headroom beyond that rather than a guarantee.
- General prose and dialogue — articles, reviews, stories, conversation. Specialist terminology (legal, medical, technical) is where it is least sure of itself.
- 8 KV heads in these graphs, 4 in training. The GQA KV projections are duplicated 4→8 at export so browser attention kernels can run them as standard multi-head. Same outputs; the cache is twice the trained size.
Licence
Non-commercial use only.