Run this model with HF Jobs

Run olaverse/YellowMIST-Encoder-15M-AP 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-AP. 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-AP 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
16aec32 verified
|
Raw History Blame Contribute Delete
12.1 kB
---
license: apache-2.0
language: [ace, ami, ape, asm, ban, bbc, bcl, ben, bew, bgp, bis, bjn, bru, bts, btx, cbk, ceb, cfm, cha, chk, cmn, cnh, ctd,
dtp, eng, fij, fil, gil, gom, guj, hak, haw, hif, hil, hin, hmo, hmr, hnj, hui, iba, ilo, ind, ium, jav, jpn, jra, kaa,
kac, kan, kha, kos, kpg, krj, lus, mad, mah, mak, mal, mar, meo, meu, min, mjw, mni, mps, mri, mui, mww, nan, nia, njo,
npi, nrm, ory, pag, pam, pan, pau, pck, pon, ppk, rar, raw, rhg, rug, san, smo, sun, szy, tah, tam, tay, tcz, tel, tet,
ton, tpi, trv, tsg, tuc, uig, urd, uzn, vap, vie, war, yap, zha, zom, zsm, zyb]
library_name: transformers
pipeline_tag: fill-mask
tags: [yellowmist, dew, character-level, encoder, multilingual, on-device, fill-mask]
---
![YellowMIST-Encoder-15M-AP](banner.png)
# YellowMIST-Encoder-15M-AP
**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 **Asia-Pacific (Latin script)**:
111 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. 7.14B 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: 70.4%**
- Short fine-tune probes: mark restoration 92.9% words right (mean over 12 languages), punctuation F1 38.9, capitals F1 59.1
| Language | masked chars % | mark restoration % | punctuation F1 | capitals F1 | unique chars |
|---|---|---|---|---|---|
| `vie_Latn` | 75.2 | 81.0 | 26.0 | 64.1 | 339M |
| `ind_Latn` | 84.3 | – | 38.2 | 67.0 | 308M |
| `zsm_Latn` | 83.5 | – | 40.9 | 69.3 | 312M |
| `fil_Latn` | 79.6 | – | 38.8 | 72.7 | 354M |
| `uzn_Latn` | 79.4 | – | 52.6 | 50.5 | 325M |
| `jav_Latn` | 69.9 | – | 16.5 | 66.3 | 256M |
| `ceb_Latn` | 83.7 | – | 45.9 | 69.2 | 296M |
| `bew_Latn` | 70.7 | – | 28.3 | 38.8 | 294M |
| `sun_Latn` | 80.0 | 97.7 | 29.0 | 52.0 | 296M |
| `hin_Latn` | 74.9 | – | 57.2 | 48.5 | 239M |
| `mww_Latn` | 81.7 | – | 33.8 | 68.6 | 291M |
| `mri_Latn` | 79.2 | 97.5 | 42.4 | 62.7 | 288M |
| `haw_Latn` | 82.4 | 98.9 | 47.7 | 71.8 | 277M |
| `hif_Latn` | 78.0 | – | 50.7 | 58.4 | 205M |
| `smo_Latn` | 79.2 | 99.6 | 32.6 | 68.4 | 297M |
| `lus_Latn` | 72.8 | – | 53.1 | 79.1 | 252M |
| `nrm_Latn` | 81.6 | 95.4 | 28.8 | 67.9 | 112M |
| `cnh_Latn` | 75.0 | – | 57.3 | 76.8 | 103M |
| `urd_Latn` | 73.5 | – | 42.4 | 47.0 | 85M |
| `tel_Latn` | 70.6 | – | 45.3 | 43.1 | 76M |
| `uig_Latn` | 68.0 | 96.3 | 57.0 | 18.9 | 70M |
| `tet_Latn` | 78.7 | 94.9 | 45.2 | 75.7 | 46M |
| `ben_Latn` | 66.9 | – | 26.3 | 38.0 | 38M |
| `hil_Latn` | 80.3 | – | 67.9 | 73.0 | 31M |
| `rhg_Latn` | 98.3 | – | 24.5 | 63.0 | 206M |
| `ctd_Latn` | 72.1 | – | 66.6 | 80.6 | 32M |
| `kha_Latn` | 73.0 | – | 27.9 | 48.5 | 29M |
| `ilo_Latn` | 67.7 | – | 51.2 | 82.8 | 71M |
| `fij_Latn` | 79.1 | – | 43.1 | 74.3 | 19M |
| `iba_Latn` | 80.3 | – | 66.6 | 86.0 | 28M |
| `ban_Latn` | 73.4 | – | 27.5 | 67.0 | 32M |
| `cfm_Latn` | 71.3 | – | 50.1 | 77.2 | 18M |
| `tam_Latn` | 70.4 | – | 43.5 | 52.0 | 23M |
| `bcl_Latn` | – | – | – | – | 12M |
| `pan_Latn` | 71.5 | – | 32.5 | 73.2 | 11M |
| `kac_Latn` | 76.5 | – | 36.8 | 64.8 | 24M |
| `bbc_Latn` | 71.4 | – | 37.1 | 44.5 | 11M |
| `nan_Latn` | 57.6 | 57.5 | 24.6 | 61.9 | 6M |
| `tcz_Latn` | 64.4 | – | 56.0 | 79.3 | 5M |
| `pck_Latn` | 63.5 | – | 46.8 | 64.5 | 3M |
| `mal_Latn` | 61.5 | – | 24.3 | 38.4 | 10M |
| `san_Latn` | 50.0 | 100.0 | 0.0 | 0.0 | 29M |
| `gom_Latn` | 61.3 | – | 40.5 | 56.8 | 6M |
| `ium_Latn` | 66.3 | – | 0.8 | 69.9 | 9M |
| `pam_Latn` | 90.1 | – | 89.0 | 67.8 | 8M |
| `mni_Latn` | 52.8 | – | 18.9 | 61.8 | 2M |
| `meu_Latn` | – | – | – | – | 2M |
| `ton_Latn` | 74.7 | 96.1 | 44.0 | 53.6 | 10M |
| `mps_Latn` | – | – | – | – | 2M |
| `war_Latn` | 73.6 | – | 32.3 | 59.7 | 16M |
| `bis_Latn` | 78.2 | – | 41.9 | 66.4 | 4M |
| `ory_Latn` | 65.7 | – | 31.1 | 41.4 | 6M |
| `pon_Latn` | 60.2 | – | – | – | <1M |
| `bjn_Latn` | 76.5 | – | 34.3 | 72.1 | 32M |
| `bru_Latn` | – | – | – | – | <1M |
| `hmr_Latn` | 68.0 | – | 71.8 | 85.9 | 2M |
| `szy_Latn` | – | – | – | – | <1M |
| `kaa_Latn` | 53.6 | 99.7 | 49.0 | 63.2 | 3M |
| `npi_Latn` | 66.7 | – | 51.5 | 38.0 | 3M |
| `kos_Latn` | – | – | – | – | <1M |
| `bgp_Latn` | 72.7 | – | 34.7 | 37.4 | 3M |
| `ape_Latn` | – | – | – | – | <1M |
| `mar_Latn` | 58.1 | – | 26.3 | 51.1 | 3M |
| `dtp_Latn` | 59.9 | – | 73.7 | 82.6 | 2M |
| `jpn_Latn` | 80.8 | – | 47.1 | 81.1 | 5M |
| `kan_Latn` | 53.8 | – | 8.3 | 40.7 | 3M |
| `hmo_Latn` | – | – | – | – | 1M |
| `ace_Latn` | 69.7 | – | 27.2 | 63.8 | 7M |
| `tuc_Latn` | – | – | – | – | <1M |
| `btx_Latn` | 59.6 | – | 25.0 | 66.3 | 1M |
| `krj_Latn` | – | – | – | – | <1M |
| `gil_Latn` | 66.9 | – | 48.4 | 66.4 | 2M |
| `hak_Latn` | 56.2 | – | – | – | <1M |
| `mjw_Latn` | – | – | – | – | <1M |
| `tpi_Latn` | 74.2 | – | 40.0 | 87.0 | 8M |
| `ppk_Latn` | – | – | – | – | <1M |
| `pau_Latn` | 50.6 | – | – | – | <1M |
| `ami_Latn` | – | – | – | – | <1M |
| `hnj_Latn` | 70.3 | – | – | – | <1M |
| `mah_Latn` | 59.2 | – | 20.8 | 68.8 | 2M |
| `trv_Latn` | – | – | – | – | <1M |
| `cmn_Latn` | 54.0 | – | 8.1 | 58.3 | 3M |
| `pag_Latn` | 84.1 | – | 21.1 | 46.7 | 2M |
| `raw_Latn` | 58.5 | – | – | – | <1M |
| `jra_Latn` | – | – | – | – | 2M |
| `asm_Latn` | 49.7 | – | 22.9 | 49.6 | 1M |
| `njo_Latn` | – | – | – | – | <1M |
| `rar_Latn` | 73.4 | – | 52.2 | 68.1 | 1M |
| `meo_Latn` | 61.9 | – | 42.4 | 18.9 | 1M |
| `chk_Latn` | – | – | – | – | 1M |
| `cha_Latn` | – | – | – | – | <1M |
| `guj_Latn` | 62.5 | – | 35.7 | 39.0 | 2M |
| `mak_Latn` | 58.7 | – | 38.6 | 57.1 | 1M |
| `cbk_Latn` | 60.1 | – | – | – | <1M |
| `min_Latn` | 76.0 | – | 41.3 | 64.4 | 36M |
| `tah_Latn` | 67.8 | – | 27.3 | 33.2 | 6M |
| `zom_Latn` | 64.9 | – | – | – | <1M |
| `hui_Latn` | – | – | – | – | 2M |
| `rug_Latn` | – | – | – | – | 2M |
| `tsg_Latn` | 84.9 | – | 46.4 | 40.0 | 1M |
| `bts_Latn` | – | – | – | – | 1M |
| `nia_Latn` | – | – | – | – | <1M |
| `mad_Latn` | – | – | – | – | <1M |
| `zha_Latn` | 59.4 | – | – | – | <1M |
| `mui_Latn` | 64.0 | – | 40.0 | 27.6 | 2M |
| `yap_Latn` | 83.5 | – | – | – | <1M |
| `zyb_Latn` | – | – | – | – | <1M |
| `kpg_Latn` | – | – | – | – | 1M |
| `vap_Latn` | – | – | – | – | <1M |
| `tay_Latn` | – | – | – | – | <1M |
| `eng_Latn` | 82.9 | – | 42.7 | 80.8 | 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("AP") # this model
train.continue_pretraining(enc, {"ind_Latn": paragraphs}, steps=2000) # keep pretraining on your text
model = train.finetune_punct(enc, {"ind_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-AP").eval()
vocab = json.load(open(hf_hub_download("olaverse/YellowMIST-Encoder-15M-AP", "vocab.json")))["vocab"]
ids = {t: i for i, t in enumerate(vocab)}
text = unicodedata.normalize("NFC", "Your text here")
x = torch.tensor([[ids["<|lang:ind_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-ap,
title = {YellowMIST-Encoder-15M-AP: a tiny character-level encoder for on-device text tasks},
author = {Olaverse},
year = {2026},
url = {https://huggingface.co/olaverse/YellowMIST-Encoder-15M-AP}
}
```