Run this model with HF Jobs

Run olaverse/YellowMIST-Encoder-15M-EU on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/olaverse/YellowMIST-Encoder-15M-EU. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/olaverse/YellowMIST-Encoder-15M-EU on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
olumideola's picture
card: name the Dew preset, credit Gated DeltaNet, explain the pilot
f005b9c verified
|
Raw History Blame Contribute Delete
12.8 kB
---
license: apache-2.0
language: [als, ang, arb, arg, ast, azj, bar, bos, bre, cat, ces, cor, cos, crh, csb, cym, dan, deu, diq, dsb, ekk, ell, eml,
eng, epo, eus, ext, fao, fin, fit, fkv, fra, fro, frp, frr, fry, fur, gag, gla, gle, glg, glv, gmh, gos, gsw, hrv, hsb,
hun, ido, ile, ina, isl, ita, kiu, kmr, krl, ksh, lad, lat, lij, lim, lit, lld, lmo, ltg, ltz, lvs, mlt, mwl, nap, nds,
nld, nno, nob, non, nov, oci, olo, pcd, pfl, pms, pol, por, rmc, rmn, rmy, roh, rom, ron, rup, rus, scn, sco, sgs, slk,
slv, sma, sme, smj, smn, sms, spa, srd, srp, stq, swe, swg, szl, tat, tly, tuk, tur, vec, vep, vls, vol, vro, wln, xal,
zea]
library_name: transformers
pipeline_tag: fill-mask
tags: [yellowmist, dew, character-level, encoder, multilingual, on-device, fill-mask]
---
# YellowMIST-Encoder-15M-EU
**YellowMIST Encoder** is a family of tiny character-level encoders to fine-tune for on-device text tasks:
code-switching detection, word segmentation, autocorrect, restoring tone marks, punctuation and capitals,
small NER. Each encoder covers one script or region group. This one covers **Europe (Latin script)**:
120 languages.
- **15.0M parameters**, 60 MB in fp32 (about 15 MB once quantised to int8; that file is not exported yet)
- Reads **characters** (NFC code points), so it needs no tokenizer and handles any spelling or tone marks in its script
- Sees text in **both directions**, like BERT. It labels or fixes text; it does not generate it.
## Architecture
[Dew](https://github.com/Olaverse-Labs/dew), preset `dew-1-enc-hybrid`: 6 layers, `GGAGGA`. That is 4 bidirectional Gated DeltaNet layers (a fixed-size memory read
forwards and backwards) and 2 attention layers, with a dense SwiGLU feed-forward block in each layer. Hidden size 320.
Context of 512 characters in training; it runs on longer text. The first token of a text is its language tag (`<|lang:xxx_Xxxx|>`).
This is Dew's small dense hybrid. Dew also has Mixture-of-Experts ("Nap") presets; those are research presets for larger
models and are not used in any YellowMIST model. The Gated DeltaNet layer is from Yang, Kautz and Hatamizadeh,
[Gated Delta Networks: Improving Mamba2 with Delta Rule](https://arxiv.org/abs/2412.06464) (2024); training uses the
[flash-linear-attention](https://github.com/fla-org/flash-linear-attention) kernels on GPU.
Why this layout: in a 3-seed pilot on the West Africa data, it beat a same-size transformer encoder on every test,
by more than the seed-to-seed spread:
| Model (15M, same data and steps, 3 seeds) | masked chars | mark restoration | punctuation F1 | capitals F1 |
|---|---|---|---|---|
| **Dew `dew-1-enc-hybrid` (this architecture)** | **65.89 ± 0.13** | **82.89 ± 0.04** | **36.67 ± 0.35** | **59.07 ± 0.59** |
| Transformer encoder | 64.43 ± 0.19 | 82.44 ± 0.02 | 34.33 ± 1.10 | 57.07 ± 1.44 |
The pilot used shorter training, on the West Africa data only, so its numbers are not comparable with the Results below.
## Training
- Objective: masked characters. Spans of 3 characters are hidden at 15% of positions, and the model fills them in.
- Data: web and chat text from the YellowMIST corpus, licence-screened. 17.39B unique characters in this group.
- Trained on 8.0B characters (122,070 steps of 128 × 512). Small languages repeat at most 4 times;
English is capped at a quarter of the training text.
## Results
Held-out documents (never trained on).
- **Masked characters filled in correctly: 67.9%**
- Short fine-tune probes: mark restoration 92.3% words right (mean over 94 languages), punctuation F1 45.0, capitals F1 66.2
| Language | masked chars % | mark restoration % | punctuation F1 | capitals F1 | unique chars |
|---|---|---|---|---|---|
| `deu_Latn` | 76.0 | 96.9 | 77.0 | 93.6 | 330M |
| `spa_Latn` | 75.6 | 96.6 | 68.3 | 78.2 | 344M |
| `fra_Latn` | 77.4 | 96.0 | 54.0 | 78.6 | 333M |
| `ita_Latn` | 86.0 | 98.8 | 77.8 | 94.8 | 326M |
| `por_Latn` | 76.7 | 96.4 | 34.0 | 71.5 | 342M |
| `pol_Latn` | 78.1 | 93.7 | 57.4 | 68.7 | 341M |
| `nld_Latn` | 76.4 | – | 57.0 | 70.1 | 326M |
| `tur_Latn` | 73.1 | 93.9 | 70.8 | 85.7 | 329M |
| `ces_Latn` | 69.9 | 82.8 | 62.2 | 62.6 | 347M |
| `swe_Latn` | 78.5 | 90.3 | 51.9 | 73.8 | 381M |
| `ron_Latn` | 70.6 | 82.5 | 31.4 | 68.7 | 340M |
| `nob_Latn` | 72.2 | 98.1 | 44.9 | 62.4 | 370M |
| `hun_Latn` | 68.8 | 82.1 | 55.2 | 41.0 | 308M |
| `dan_Latn` | 78.1 | 98.2 | 58.1 | 70.8 | 315M |
| `fin_Latn` | 65.7 | 96.0 | 54.0 | 65.4 | 393M |
| `slk_Latn` | 74.9 | 86.4 | 56.2 | 66.6 | 347M |
| `lit_Latn` | 73.1 | 87.9 | 51.8 | 66.3 | 322M |
| `ekk_Latn` | 67.4 | 92.9 | 56.8 | 67.9 | 346M |
| `bos_Latn` | 71.9 | 96.7 | 45.7 | 62.0 | 348M |
| `slv_Latn` | 72.0 | 97.2 | 62.0 | 64.1 | 318M |
| `cat_Latn` | 80.5 | 96.8 | 46.0 | 58.4 | 296M |
| `lvs_Latn` | 71.2 | 82.3 | 53.9 | 52.3 | 327M |
| `azj_Latn` | 76.5 | 95.9 | 50.7 | 72.2 | 298M |
| `als_Latn` | 69.9 | 94.9 | 32.6 | 57.2 | 327M |
| `hrv_Latn` | 72.6 | 97.0 | 42.7 | 58.8 | 329M |
| `isl_Latn` | 69.6 | 95.3 | 38.9 | 80.4 | 336M |
| `glg_Latn` | 76.9 | 96.7 | 40.0 | 53.9 | 306M |
| `eus_Latn` | 70.2 | – | 30.0 | 55.0 | 307M |
| `lat_Latn` | 66.4 | – | 26.9 | 53.3 | 297M |
| `cym_Latn` | 74.6 | 98.6 | 41.0 | 68.0 | 291M |
| `gle_Latn` | 73.3 | 95.3 | 35.3 | 48.6 | 302M |
| `nno_Latn` | 71.8 | 97.4 | 48.4 | 69.3 | 307M |
| `epo_Latn` | 73.0 | 96.8 | 82.0 | 91.9 | 308M |
| `mlt_Latn` | 74.7 | 98.5 | 35.7 | 66.7 | 296M |
| `fry_Latn` | 71.3 | 98.5 | 47.2 | 68.7 | 298M |
| `ltz_Latn` | 74.2 | 96.6 | 48.2 | 86.1 | 294M |
| `kmr_Latn` | 70.1 | 88.2 | 41.3 | 60.3 | 298M |
| `gla_Latn` | 74.9 | 96.7 | 42.7 | 63.4 | 295M |
| `fao_Latn` | 70.5 | 95.2 | 61.5 | 74.0 | 293M |
| `tuk_Latn` | 80.5 | 95.2 | 52.0 | 82.5 | 291M |
| `cos_Latn` | 78.6 | 96.6 | 47.2 | 69.0 | 296M |
| `srp_Latn` | 66.3 | 96.1 | 40.7 | 58.8 | 261M |
| `ell_Latn` | 74.6 | – | 45.6 | 67.1 | 176M |
| `gsw_Latn` | 68.6 | 89.7 | 42.0 | 49.8 | 152M |
| `ast_Latn` | 69.3 | 95.5 | 34.2 | 57.0 | 227M |
| `oci_Latn` | 71.9 | 93.1 | 43.3 | 76.9 | 210M |
| `bre_Latn` | 64.7 | 98.1 | 39.3 | 69.4 | 107M |
| `gmh_Latn` | 62.8 | 94.1 | 23.4 | 47.0 | 27M |
| `nds_Latn` | 61.6 | 93.5 | 43.4 | 79.2 | 97M |
| `sme_Latn` | 70.0 | 86.1 | 57.3 | 79.5 | 92M |
| `roh_Latn` | 70.0 | 96.9 | 48.4 | 74.6 | 86M |
| `hsb_Latn` | 69.8 | 90.9 | 60.7 | 73.2 | 28M |
| `bar_Latn` | 58.3 | 96.4 | 34.9 | 70.7 | 46M |
| `tat_Latn` | 69.2 | 86.4 | 52.4 | 82.5 | 24M |
| `nap_Latn` | 63.6 | 91.8 | 20.5 | 31.2 | 60M |
| `crh_Latn` | 70.6 | 85.4 | 48.3 | 77.4 | 127M |
| `lim_Latn` | 66.3 | 97.9 | 44.8 | 68.9 | 158M |
| `srd_Latn` | 69.3 | 94.8 | 45.8 | 62.4 | 117M |
| `fur_Latn` | 68.8 | 94.9 | 32.7 | 61.6 | 63M |
| `arg_Latn` | 71.1 | 97.6 | 42.2 | 63.3 | 36M |
| `lmo_Latn` | 68.5 | 85.9 | 45.0 | 74.7 | 136M |
| `kiu_Latn` | 68.3 | 83.5 | 51.0 | 73.0 | 31M |
| `zea_Latn` | 62.0 | 97.5 | 33.8 | 61.2 | 23M |
| `diq_Latn` | 61.1 | 76.4 | 28.6 | 58.7 | 24M |
| `vec_Latn` | 67.9 | 95.0 | 38.8 | 69.9 | 137M |
| `ltg_Latn` | 59.3 | 72.7 | 51.7 | 82.4 | 23M |
| `non_Latn` | 62.0 | 90.7 | 42.5 | 61.8 | 16M |
| `wln_Latn` | 63.4 | 91.4 | 54.7 | 60.2 | 19M |
| `pms_Latn` | 65.6 | 89.4 | 29.7 | 59.9 | 13M |
| `rmy_Latn` | 67.9 | 93.9 | 33.9 | 65.7 | 8M |
| `scn_Latn` | 70.8 | 96.8 | 38.7 | 63.1 | 123M |
| `sco_Latn` | 65.7 | – | 37.2 | 63.9 | 9M |
| `fro_Latn` | 59.1 | 95.9 | 39.4 | 65.1 | 26M |
| `mwl_Latn` | 73.4 | 97.1 | 39.8 | 69.4 | 16M |
| `vro_Latn` | 64.3 | 87.1 | 44.4 | 66.8 | 15M |
| `szl_Latn` | 63.8 | 81.2 | 42.4 | 71.9 | 53M |
| `csb_Latn` | 63.2 | 76.1 | 45.0 | 61.5 | 13M |
| `ido_Latn` | 70.2 | – | 65.0 | 74.8 | 10M |
| `rmn_Latn` | 53.2 | 93.9 | 36.4 | 64.2 | 12M |
| `rus_Latn` | 63.5 | – | 44.5 | 59.6 | 13M |
| `eml_Latn` | 51.8 | 85.1 | 12.4 | 19.8 | 9M |
| `pfl_Latn` | 60.2 | 93.0 | 47.5 | 83.5 | 12M |
| `lad_Latn` | 68.0 | 97.9 | 31.9 | 62.3 | 14M |
| `gos_Latn` | 61.9 | – | 48.2 | 63.5 | 12M |
| `cor_Latn` | 57.8 | 95.0 | 24.0 | 53.6 | 6M |
| `rom_Latn` | 67.0 | – | 36.3 | 66.3 | 11M |
| `ksh_Latn` | 63.3 | 92.0 | 40.4 | 84.6 | 9M |
| `vls_Latn` | 55.8 | 99.5 | 25.9 | 80.0 | 4M |
| `olo_Latn` | 59.5 | 96.1 | 65.6 | 72.2 | 9M |
| `dsb_Latn` | 67.4 | 94.1 | 61.5 | 78.6 | 8M |
| `krl_Latn` | – | – | – | – | 8M |
| `pcd_Latn` | 60.1 | 94.7 | 24.4 | 70.9 | 5M |
| `gag_Latn` | 70.2 | 92.5 | 36.7 | 74.0 | 6M |
| `fit_Latn` | 55.0 | 95.1 | 44.2 | 63.6 | 10M |
| `vep_Latn` | 63.6 | 92.5 | 64.9 | 82.7 | 3M |
| `ina_Latn` | 75.2 | – | 47.2 | 67.5 | 11M |
| `smn_Latn` | 59.7 | 89.2 | 67.2 | 75.7 | 7M |
| `frr_Latn` | 63.6 | 85.7 | 46.6 | 54.9 | 4M |
| `glv_Latn` | 77.1 | – | 12.5 | 37.2 | 5M |
| `ext_Latn` | 66.0 | 96.5 | 32.7 | 75.9 | 6M |
| `lij_Latn` | 61.2 | – | 16.4 | 16.5 | 14M |
| `frp_Latn` | 56.9 | 83.9 | 28.4 | 24.4 | 4M |
| `sma_Latn` | 68.3 | 92.1 | 39.0 | 73.3 | 6M |
| `stq_Latn` | 78.2 | 99.4 | 45.2 | 69.8 | 2M |
| `sgs_Latn` | 51.0 | 77.5 | 43.2 | 57.4 | 3M |
| `sms_Latn` | 62.8 | 85.1 | 63.1 | 78.9 | 4M |
| `tly_Latn` | – | – | – | – | 3M |
| `ang_Latn` | 58.3 | – | 26.9 | 61.3 | 4M |
| `vol_Latn` | 50.3 | 78.7 | 29.0 | 55.3 | 2M |
| `smj_Latn` | 63.6 | – | 43.7 | 74.0 | 3M |
| `rup_Latn` | – | – | – | – | 3M |
| `rmc_Latn` | 58.7 | – | 43.0 | 54.3 | 1M |
| `arb_Latn` | 48.6 | – | 60.1 | 15.2 | 2M |
| `fkv_Latn` | – | – | – | – | 1M |
| `lld_Latn` | 62.7 | – | 55.6 | 76.8 | 2M |
| `swg_Latn` | 61.9 | – | 38.8 | 82.8 | 3M |
| `ile_Latn` | 72.6 | – | 70.0 | 79.5 | 2M |
| `nov_Latn` | – | – | – | – | <1M |
| `xal_Latn` | – | – | – | – | <1M |
| `eng_Latn` | 78.4 | – | 38.9 | 79.3 | 1,160M |
Mark restoration only runs for languages written with diacritics or tone marks. A `–` means no probe, or a language
with under 1M characters of text, whose test set is too small to give a stable score. The group means above include
every probed language.
## Use
### With the yellowmist library (recommended)
This is a base model to fine-tune. The finished tasks built on it (punctuation, language of every word, word
boundaries) ship in the `yellowmist` library: `pip install yellowmist`, see the [documentation](https://olaverse-labs.github.io/yellowmist/).
```python
from yellowmist import train # pip install "yellowmist[train]"
enc = train.Encoder.load("EU") # this model
train.continue_pretraining(enc, {"spa_Latn": paragraphs}, steps=2000) # keep pretraining on your text
model = train.finetune_punct(enc, {"spa_Latn": paragraphs}) # or finetune_switch(...)
model.save("my-model") # weights + ONNX, ready for ym.register / model=
```
The [fine-tuning notebook](https://github.com/Olaverse-Labs/yellowmist/blob/main/notebooks/finetune_yellowmist.ipynb) ([open in Colab](https://colab.research.google.com/github/Olaverse-Labs/yellowmist/blob/main/notebooks/finetune_yellowmist.ipynb)) walks through every step, including adding new
languages and sharing your model on the Hub.
### Without the library (transformers)
```python
import json, unicodedata, torch
import dew # pip install "dew-lm[hf]": registers the Dew architecture
from huggingface_hub import hf_hub_download
from transformers import AutoModelForMaskedLM
model = AutoModelForMaskedLM.from_pretrained("olaverse/YellowMIST-Encoder-15M-EU").eval()
vocab = json.load(open(hf_hub_download("olaverse/YellowMIST-Encoder-15M-EU", "vocab.json")))["vocab"]
ids = {t: i for i, t in enumerate(vocab)}
text = unicodedata.normalize("NFC", "Your text here")
x = torch.tensor([[ids["<|lang:spa_Latn|>"]] + [ids.get(c, 1) for c in text]]) # 1 = <unk>
with torch.no_grad():
hidden = model.model(x)[0] # [1, 1 + characters, hidden], one vector per character
```
To fine-tune by hand, put a small head on `hidden` (one label per character or word) and train the whole model with
a low learning rate (3e-4 worked for our tasks).
**More:** [documentation](https://olaverse-labs.github.io/yellowmist/) · [GitHub](https://github.com/Olaverse-Labs/yellowmist) · [playground](https://huggingface.co/spaces/olaverse/yellowmist-playground) · [fine-tuning notebook](https://github.com/Olaverse-Labs/yellowmist/blob/main/notebooks/finetune_yellowmist.ipynb)
## Limits
- This is a base model, not a finished tool: fine-tune it for a task.
- Masked-character accuracy measures how well the model knows the languages, not any one task. Compare it within a
group, not across scripts.
## Licence
Apache-2.0.
## Citation
```bibtex
@misc{yellowmist-encoder-15m-eu,
title = {YellowMIST-Encoder-15M-EU: a tiny character-level encoder for on-device text tasks},
author = {Olaverse},
year = {2026},
url = {https://huggingface.co/olaverse/YellowMIST-Encoder-15M-EU}
}
```