Run this model with HF Jobs
Run olaverse/YellowMIST-Encoder-15M-CY 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-CY. 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-CY 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.
Instructions to use olaverse/YellowMIST-Encoder-15M-CY with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use olaverse/YellowMIST-Encoder-15M-CY with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="olaverse/YellowMIST-Encoder-15M-CY")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("olaverse/YellowMIST-Encoder-15M-CY", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from olaverse/YellowMIST-Encoder-15M-CY: direct link, hf CLI and curl.
- Browser
- Download file 9.23 kB
-
https://huggingface.co/olaverse/YellowMIST-Encoder-15M-CY/resolve/main/README.md
- Command line
-
hf download hf://olaverse/YellowMIST-Encoder-15M-CY/README.md
-
curl -L -o README.md https://huggingface.co/olaverse/YellowMIST-Encoder-15M-CY/resolve/main/README.md
9.23 kB
| license: apache-2.0 | |
| language: [abk, abq, ady, agx, alt, ava, azj, bak, bel, bul, bxr, che, chu, chv, crh, dar, gag, inh, kaa, kaz, kbd, khk, kir, | |
| kjh, koi, kpv, krc, kum, lbe, lez, mdf, mhr, mkd, mrj, myv, nog, orv, oss, rmy, ron, rue, rus, sah, srp, tab, tat, tgk, | |
| tuk, tyv, udm, uig, ukr, uzn, xal, yrk] | |
| library_name: transformers | |
| pipeline_tag: fill-mask | |
| tags: [yellowmist, dew, character-level, encoder, multilingual, on-device, fill-mask] | |
|  | |
| # YellowMIST-Encoder-15M-CY | |
| **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 **Cyrillic-script languages**: | |
| 55 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. 5.15B 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: 71.8%** | |
| - Short fine-tune probes: mark restoration 98.0% words right (mean over 10 languages), punctuation F1 54.5, capitals F1 73.3 | |
| | Language | masked chars % | mark restoration % | punctuation F1 | capitals F1 | unique chars | | |
| |---|---|---|---|---|---| | |
| | `rus_Cyrl` | 78.5 | β | 82.4 | 91.4 | 374M | | |
| | `ukr_Cyrl` | 76.4 | 99.8 | 61.9 | 75.6 | 296M | | |
| | `bul_Cyrl` | 79.9 | β | 65.1 | 62.0 | 339M | | |
| | `srp_Cyrl` | 74.6 | β | 53.7 | 69.9 | 315M | | |
| | `kaz_Cyrl` | 81.6 | β | 61.0 | 77.7 | 305M | | |
| | `mkd_Cyrl` | 80.2 | β | 50.6 | 70.0 | 312M | | |
| | `bel_Cyrl` | 77.0 | β | 67.2 | 73.6 | 304M | | |
| | `khk_Cyrl` | 76.3 | β | 56.6 | 76.1 | 296M | | |
| | `tgk_Cyrl` | 77.9 | 98.9 | 74.2 | 80.0 | 295M | | |
| | `uzn_Cyrl` | 84.1 | β | 71.3 | 84.4 | 295M | | |
| | `kir_Cyrl` | 82.8 | β | 65.6 | 83.2 | 313M | | |
| | `tat_Cyrl` | 83.9 | β | 67.0 | 87.8 | 297M | | |
| | `bak_Cyrl` | 80.2 | β | 64.2 | 83.3 | 281M | | |
| | `kaa_Cyrl` | 81.6 | β | 63.8 | 70.6 | 231M | | |
| | `sah_Cyrl` | 78.9 | β | 57.0 | 75.4 | 252M | | |
| | `udm_Cyrl` | 73.2 | 99.1 | 36.9 | 51.7 | 64M | | |
| | `che_Cyrl` | 67.6 | β | 44.9 | 81.9 | 45M | | |
| | `rue_Cyrl` | 63.9 | 89.9 | 47.5 | 66.9 | 79M | | |
| | `mhr_Cyrl` | 66.4 | 97.4 | 50.2 | 58.7 | 70M | | |
| | `oss_Cyrl` | 69.9 | 99.9 | 40.3 | 69.1 | 29M | | |
| | `uig_Cyrl` | 68.2 | β | 60.4 | 65.0 | 35M | | |
| | `tyv_Cyrl` | 76.5 | β | 57.9 | 80.6 | 43M | | |
| | `chv_Cyrl` | 72.7 | β | 54.1 | 77.4 | 65M | | |
| | `bxr_Cyrl` | 69.2 | β | 44.4 | 59.7 | 26M | | |
| | `ava_Cyrl` | 74.3 | β | 55.3 | 86.7 | 18M | | |
| | `kbd_Cyrl` | 58.8 | β | 41.6 | 76.8 | 23M | | |
| | `lez_Cyrl` | 68.5 | β | 51.8 | 88.8 | 20M | | |
| | `myv_Cyrl` | 71.1 | β | 49.6 | 71.3 | 17M | | |
| | `ady_Cyrl` | 68.0 | β | 55.3 | 93.3 | 7M | | |
| | `kpv_Cyrl` | 66.9 | 99.2 | 53.8 | 76.6 | 16M | | |
| | `inh_Cyrl` | 70.0 | β | 42.3 | 80.4 | 13M | | |
| | `krc_Cyrl` | 67.2 | β | 37.8 | 66.0 | 14M | | |
| | `kum_Cyrl` | 76.6 | 100.0 | 70.3 | 89.4 | 3M | | |
| | `mrj_Cyrl` | 72.9 | 96.5 | 38.4 | 35.5 | 14M | | |
| | `lbe_Cyrl` | β | β | β | β | 1M | | |
| | `crh_Cyrl` | 72.1 | β | 62.8 | 84.7 | 9M | | |
| | `alt_Cyrl` | 73.4 | 98.9 | 49.1 | 89.7 | 3M | | |
| | `ron_Cyrl` | β | β | β | β | 7M | | |
| | `abk_Cyrl` | 53.8 | β | 49.6 | 82.1 | 5M | | |
| | `mdf_Cyrl` | β | β | β | β | 4M | | |
| | `orv_Cyrl` | 64.2 | β | 40.4 | 67.9 | 6M | | |
| | `nog_Cyrl` | β | β | β | β | 1M | | |
| | `azj_Cyrl` | β | β | β | β | 3M | | |
| | `abq_Cyrl` | 50.6 | β | β | β | <1M | | |
| | `dar_Cyrl` | β | β | β | β | <1M | | |
| | `xal_Cyrl` | 47.4 | β | 66.7 | 88.9 | 2M | | |
| | `kjh_Cyrl` | 66.2 | β | 37.9 | 13.0 | 1M | | |
| | `koi_Cyrl` | β | β | β | β | 2M | | |
| | `yrk_Cyrl` | β | β | β | β | <1M | | |
| | `tab_Cyrl` | β | β | β | β | <1M | | |
| | `tuk_Cyrl` | β | β | β | β | <1M | | |
| | `agx_Cyrl` | β | β | β | β | 1M | | |
| | `chu_Cyrl` | 71.8 | β | 49.3 | 24.8 | 1M | | |
| | `gag_Cyrl` | β | β | β | β | <1M | | |
| | `rmy_Cyrl` | β | β | β | β | <1M | | |
| 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("CY") # this model | |
| train.continue_pretraining(enc, {"rus_Cyrl": paragraphs}, steps=2000) # keep pretraining on your text | |
| model = train.finetune_punct(enc, {"rus_Cyrl": 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-CY").eval() | |
| vocab = json.load(open(hf_hub_download("olaverse/YellowMIST-Encoder-15M-CY", "vocab.json")))["vocab"] | |
| ids = {t: i for i, t in enumerate(vocab)} | |
| text = unicodedata.normalize("NFC", "Your text here") | |
| x = torch.tensor([[ids["<|lang:rus_Cyrl|>"]] + [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-cy, | |
| title = {YellowMIST-Encoder-15M-CY: a tiny character-level encoder for on-device text tasks}, | |
| author = {Olaverse}, | |
| year = {2026}, | |
| url = {https://huggingface.co/olaverse/YellowMIST-Encoder-15M-CY} | |
| } | |
| ``` | |