Run this model with HF Jobs
Run olaverse/YellowMIST-Encoder-15M-INS 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-INS. 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-INS 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-INS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use olaverse/YellowMIST-Encoder-15M-INS with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="olaverse/YellowMIST-Encoder-15M-INS")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("olaverse/YellowMIST-Encoder-15M-INS", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 6,692 Bytes
0403491 7f64825 0403491 71df569 0403491 4b1cd2f 0403491 4b1cd2f 0403491 4b1cd2f 0403491 4b1cd2f 0403491 213262a 0403491 213262a 0403491 213262a 0403491 213262a 0403491 213262a 0403491 213262a 0403491 7f64825 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | ---
license: apache-2.0
language: [kan, mal, sin, tam, tcy, tel]
library_name: transformers
pipeline_tag: fill-mask
tags: [yellowmist, dew, character-level, encoder, multilingual, on-device, fill-mask]
---

# YellowMIST-Encoder-15M-INS
**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 **South Indic scripts**:
6 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. 1.56B 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: 80.5%**
- Short fine-tune probes: punctuation F1 69.5
| Language | masked chars % | mark restoration % | punctuation F1 | capitals F1 | unique chars |
|---|---|---|---|---|---|
| `tam_Taml` | 82.5 | – | 73.3 | 85.5 | 326M |
| `mal_Mlym` | 84.4 | – | 57.2 | 92.3 | 301M |
| `tel_Telu` | 81.9 | – | 73.4 | 91.2 | 291M |
| `kan_Knda` | 75.4 | – | 70.9 | 68.0 | 303M |
| `sin_Sinh` | 78.2 | – | 72.9 | 64.3 | 332M |
| `tcy_Knda` | – | – | – | – | 3M |
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. This script has no upper and lower case, so the capitals column only reflects Latin words mixed into the text.
## 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("INS") # this model
train.continue_pretraining(enc, {"tam_Taml": paragraphs}, steps=2000) # keep pretraining on your text
model = train.finetune_punct(enc, {"tam_Taml": 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-INS").eval()
vocab = json.load(open(hf_hub_download("olaverse/YellowMIST-Encoder-15M-INS", "vocab.json")))["vocab"]
ids = {t: i for i, t in enumerate(vocab)}
text = unicodedata.normalize("NFC", "Your text here")
x = torch.tensor([[ids["<|lang:tam_Taml|>"]] + [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-ins,
title = {YellowMIST-Encoder-15M-INS: a tiny character-level encoder for on-device text tasks},
author = {Olaverse},
year = {2026},
url = {https://huggingface.co/olaverse/YellowMIST-Encoder-15M-INS}
}
```
|