Burmese SLM: Unigram tokenizer, 512 MiB (17M parameters)
A small GPT-style language model for Burmese (Myanmar), trained from scratch on 512 MiB of cleaned Burmese text with a 16,000-piece SentencePiece Unigram tokenizer. It is the best model from a controlled study of five tokenization strategies and three training-data sizes (45 models), Investigating Data Size and Tokenization Strategies for Small Language Models in Burmese.
It is a research model: a base language model that continues text. It is not instruction-tuned, not a chatbot, and not suitable for production use without further work.
Results
Test bits-per-character (BPC, lower is better) on a held-out 6.0M-character Burmese test set, for the best model of each tokenizer at 512 MiB. BPC divides by the same character count for every tokenizer, so the numbers are comparable.
| Tokenizer (512 MiB, best seed by validation) | Validation BPC | Test BPC |
|---|---|---|
| Unigram (this model) | 1.2706 | 1.2427 |
| BPE | 1.2943 | 1.2642 |
| Syllable-presegmented BPE | 1.2981 | 1.2688 |
| Syllable | 1.3219 | 1.2949 |
| Character | 1.4377 | 1.4128 |
Over three seeds, Unigram at 512 MiB averages 1.2506 ± 0.0069 test BPC, the lowest of all 15 tokenizer × data-size settings. The seed was chosen by validation BPC, not test BPC.
Fine-tuned on downstream tasks (same recipe for every model; test set):
| Task | Metric | This model | Best of all 45 models |
|---|---|---|---|
| myPOS part-of-speech tagging | macro-F1 | 93.54 | 93.54 |
| myNER named entity recognition | entity F1 | 71.63 | 72.46 (syllable tokenizer) |
| SIB-200 topic classification | macro-F1 | 83.01 | 84.82 (syllable BPE) |
The fine-tuned task heads are not included; this repository holds the pretrained model only.
Model details
| Architecture | Decoder-only Transformer (GPT-style), pre-LayerNorm, GELU, learned positions, tied input/output embeddings |
| Size | 6 layers, 384 hidden, 6 heads, FFN 1,536; 16,988,160 parameters (10.6M non-embedding) |
| Context | 512 tokens (about 2,270 Burmese characters) |
| Tokenizer | SentencePiece Unigram, 16,000 pieces, byte fallback (no unknown token), identity normalization; trained on the 32 MiB split; ids: pad 0, unk 1, bos 2, eos 3 |
| Training data | 512 MiB (192.4M characters, 445,134 documents) of cleaned Burmese text |
| Training | 8 epochs, AdamW (0.9, 0.95), weight decay 0.1, peak lr 1e-3 with 2% warm-up and cosine decay to 10%, batch 64 × 512 tokens, dropout 0.1, bf16, gradient clipping 1.0, seed 1; best of 40 validation checks |
| Hardware | one NVIDIA H200 MIG slice (3g.71gb), about 7 minutes |
Training data
Eight public Hugging Face datasets, cleaned with one pipeline (Zawgyi detection and conversion to Unicode, NFC normalization, quality filters, removal of exact and near duplicates, masking of e-mail addresses, phone numbers and long ID numbers as [EMAIL], [PHONE], [ID], and removal of text overlapping the myPOS test data). The 512 MiB training split keeps a fixed genre mix: general web 40%, news 25%, Wikipedia 20%, literary 10%, conversational 5%.
| Source | Licence |
|---|---|
| aisingapore/SEA-PILE-v2 (my) | ODC-By-1.0 |
| DatarrX/moi-myanmar-articles | CC-BY-4.0 |
| DatarrX/burmese-VOA | CC-BY-4.0 |
| wikimedia/wikipedia (Burmese) | CC-BY-SA-4.0 |
| freococo/myanmar-written-corpus | CC0-1.0 |
| DatarrX/nava-rasa-myanmar-corpus | CC-BY-4.0 |
| freococo/myanmar_spoken_corpus | CC-BY-4.0 |
| DatarrX/Myanmar-Written-Spoken-Parallel-Corpus | CC-BY-4.0 |
The model is released under CC-BY-SA-4.0 because its training data includes CC-BY-SA material. Credit goes to the creators of all datasets above.
How to use
pip install torch sentencepiece huggingface_hub
from huggingface_hub import snapshot_download
import sys
folder = snapshot_download("aungthuhein-dev/burmese-slm-unigram-17m")
sys.path.insert(0, folder)
from modeling import load, generate
model, sp = load(folder) # model.pt + config.json + unigram.model
print(generate(model, sp, "မြန်မာနိုင်ငံ", max_new_tokens=80))
Files: model.pt (PyTorch state_dict), config.json (architecture and training settings), unigram.model / unigram.vocab (tokenizer), modeling.py (model code, loader and sampler; needs only torch and sentencepiece), metrics.jsonl (validation curve) and result.json (validation and test scores).
Limitations
- Small. 17M parameters and 512 MiB of text: generated text is locally fluent at best and often incoherent or factually wrong.
- Burmese only. About 2.5% of the training characters are Latin; other languages are not modelled well.
- Data biases. Web and news text dominate the training data; the model can reproduce their biases, errors and residual Zawgyi-encoded text.
- Not evaluated for safety. Do not use it to generate content that people will rely on.
- Masked tokens. It may output
[EMAIL],[PHONE]or[ID], which replaced personal data in training.
Citation
If you use this model, please cite:
@misc{hein2026burmeseslm,
author = {Aung Thu Hein},
title = {Burmese SLM: Unigram Tokenizer, 512 MiB (17M Parameters)},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/aungthuhein-dev/burmese-slm-unigram-17m}},
note = {Best model from the study ``Investigating Data Size and Tokenization Strategies for Small Language Models in Burmese'', Rangsit University}
}