🇲🇳 NLLB-200 1.3B Mongolian (Workstation & Flagship Tier)
A high-fidelity bidirectional neural machine translation model for Mongolian (Cyrillic) ↔ English, fine-tuned from Meta's heavyweight NLLB-200 (1.3B).
This model is part of the Universal Open Mongolian AI Suite ("A Model for Every Machine"), delivering authentic native Mongolian grammar, cultural idioms, proverbs, and modern technical/robotics terminology.
🌟 Key Highlights & Improvements
- Heavyweight 1.3B Capacity:
- Double the depth (24 encoder & 24 decoder layers) and wider representation (hidden size 1024, 16 attention heads) compared to distilled 600M models.
- Captures complex nested clauses, archaic proverbs, and formal nuances without grammatical degradation.
- Anchor-Boosted Parallel Dataset:
- Fine-tuned on 711,821 parallel sentence pairs with dedicated native idiomatic and tech anchor injection.
- Final validation loss reached
0.7764after 8,000 steps with 8-bit AdamW and LoRA across all attention and MLP layers.
- Zero Loanword Leakage:
- Completely eliminates Russian loanword bias (хотель ➔ зочид буудал, дурсамж ➔ санах ой).
- Preserves authentic Mongolian syntax and polite request suffixes (
-хгүй юу?,-аарай).
- Robot & Conversational Brain Anchor:
- Serves as the primary linguistic bridge for tabletop humanoid robots (such as Reachy Mini Lite) and large language models (Qwen 2.5 3B / 7B / 14B), eliminating character hallucinations.
📊 Benchmark & Translation Comparisons
| English Input | Baseline / Older Models | NLLB-200 1.3B Mongolian | Linguistic Improvement |
|---|---|---|---|
| "Where is the hotel?" | Хотель хаана байна? | Зочид буудал хаана байна вэ? | Russian loanword eliminated |
| "Good morning, how are you today?" | Сайн өглөө, өнөөдөр яаж байна? | Өглөөний мэнд, та өнөөдөр ямар байна даа? | Authentic greeting idiom |
| "If the master strives, fate will strive." | Хэрэв эзэн хичээвэл хувь тавилан... | Эзэн хичээвэл заяа хичээнэ. | Authentic Mongolian proverb |
| "The server ran out of memory and crashed." | Сервер дурсамжгүй болж сүйрсэн | Санах ой дууссан тул сервер гацсан. | Correct IT terminology (RAM = санах ой) |
| "Can you help me assemble the robotic arm?" | Надад туслах уу угсрах... | Робот гарыг угсрахад надад туслахгүй юу? | Polite Mongolian request suffix (-хгүй юу?) |
| "We need to fix the bugs in the application." | ...алдаанууд засах шаардлагатай | Аппликейшн дээрх алдааг засах хэрэгтэй байна. | Natural syntax and modal auxiliary |
| "The database migration completed successfully." | Өгөгдлийн сангийн шилжилт... | Мэдээллийн сангийн шилжилт амжилттай дууслаа. | Clean engineering translation |
💻 Quick Start: Hugging Face Transformers
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_id = "Tsengel-mn/nllb-1.3b-mongolian"
print("Loading tokenizer and model...")
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(
model_id,
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
device_map="auto"
)
def translate(text: str, source_lang: str = "mn", target_lang: str = "en") -> str:
lang_codes = {
"en": "eng_Latn",
"mn": "khk_Cyrl",
"de": "deu_Latn"
}
src_code = lang_codes[source_lang]
tgt_code = lang_codes[target_lang]
tokenizer.src_lang = src_code
inputs = tokenizer(text, return_tensors="pt").to(model.device)
forced_bos_token_id = tokenizer.convert_tokens_to_ids(tgt_code)
with torch.no_grad():
outputs = model.generate(
**inputs,
forced_bos_token_id=forced_bos_token_id,
max_new_tokens=128,
num_beams=4
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Test Translations
print(translate("Where is the hotel?", source_lang="en", target_lang="mn"))
# Output: Зочид буудал хаана байна вэ?
print(translate("Эзэн хичээвэл заяа хичээнэ.", source_lang="mn", target_lang="en"))
# Output: If the master strives, fate will strive.
⚡ High-Speed CPU Inference via CTranslate2 (INT8)
For production deployment on standard CPUs or edge devices with sub-500ms latency:
pip install ctranslate2 transformers
import ctranslate2
import transformers
# Run on CPU with INT8 quantization (~1,355 MB RAM footprint)
translator = ctranslate2.Translator("models/nllb-1.3b-mongolian-ct2-int8", device="cpu", compute_type="int8")
tokenizer = transformers.AutoTokenizer.from_pretrained("Tsengel-mn/nllb-1.3b-mongolian")
text = "Хиймэл оюун ухаан нь орчин үеийн робот техникийг өөрчилж байна."
tokens = tokenizer.convert_ids_to_tokens(tokenizer.encode(text))
results = translator.translate_batch([tokens], target_prefix=[["eng_Latn"]])
output = tokenizer.decode(tokenizer.convert_tokens_to_ids(results[0].hypotheses[0][1:]))
print(output)
# Output: Artificial intelligence is transforming modern robotics.
🛠️ Training Details
- Base Model:
facebook/nllb-200-1.3B(Meta AI) - Dataset: 711,821 parallel sentence pairs (injected with 200x oversampled native IT, idiomatic, and conversational anchors).
- Optimizer: 8-bit AdamW (
adamw_bnb_8bit) with cosine learning rate schedule (1.5e-4). - Hardware: NVIDIA GeForce RTX 4060 (8GB VRAM) · AMD Ryzen 9 7900.
- Technique: PEFT LoRA (Rank 64, Alpha 128) across attention and MLP projections, fused into standalone FP16 weights.
- Validation Loss:
0.7764
📜 Citation & Acknowledgements
If you use this model in your research, robotics, or products, please credit:
- Tsengel Private Engineering & Open Mongolian AI Ecosystem (tsengel.de)
- Meta AI for the base NLLB-200 architecture.
- License: Creative Commons Attribution-NonCommercial 4.0 International (CC-BY-NC-4.0)