luso-mt-tiny
ultra-compact translation model for rare languages
2 min readupdated
luso-mt-tiny is a miniature language model (transformer) with just 19.9M parameters, created by the Rexplore research lab. It provides bidirectional translation between English, Chichewa, and Tumbuka. The model is specifically designed to run on mobile devices completely offline without an internet connection. This solution is useful for developers and researchers building local apps for regions with poor network coverage.
Key features
- Compactness: the model file weighs only 79.5 MB in fp32 format and 40.5 MB with int8 quantization.
- Offline operation: runs on smartphones and weak processors (CPU speed reaches ~8–12 sentences per second).
- Architecture: an efficient encoder-decoder Transformer, structured around the T5 v1.1 design.
- Vocabulary: uses a shared SentencePiece tokenizer with 16,000 elements for all supported languages.
What you can do
- Mobile app integration: embed an offline translator for rare African languages into local client apps.
- Smartphone testing: deploy the model locally for localized text processing tasks on mobile hardware.
- Linguistic research: study knowledge distillation methods using tiny transformers as an example.
Example
Inference example using the transformers library:
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("suru8-ai/luso-mt-tiny")
model = AutoModelForSeq2SeqLM.from_pretrained("suru8-ai/luso-mt-tiny")
def translate(text, to):
batch = tok(f"<2{to}> {text}", return_tensors="pt")
out = model.generate(**batch, num_beams=4, max_new_tokens=192)
return tok.decode(out[0], skip_special_tokens=True)
print(translate("Where is the nearest clinic?", "ny"))Read more
DetailsBenchmarks (chrF++): en→ny 46.3, ny→en 45.5, en→tum 34.9, tum→en 29.1.
Hardware requirements: extremely low, runs on standard CPUs.
Limitations: handles conversational speech, medicine, and law less effectively; requires checking names and dates.
License: Apache-2.0.










Comments