gemma-3-1b-science-translate-best
A scientific translation model for African languages
2 min read
A new compact language model based on Google Gemma 3 (1B parameters) specialized in translating English scientific and academic texts into 125 African languages. The model is trained on the AfriScience-MT dataset using reinforcement learning and supports full translation of entire research papers. It maintains high general translation performance, outperforming the baseline version on specialized scientific datasets. The solution will be useful for researchers, translators, and service developers for the African region.
Key features
- Gemma 3 base: Lightweight 1B parameter architecture with chat template support.
- Scientific specialization: Deep adaptation to academic vocabulary across six major languages (Amharic, Hausa, Luganda, Sepedi, Yoruba, Zulu).
- Article translation: Improved stability when processing entire documents (up to 96% successful completions).
- Easy deployment: Full compatibility with the
transformerslibrary and the vLLM framework.
What you can do
- Pipeline integration: Embed the model into local or cloud services for automated translation of scientific publications.
- Abstract translation: Quickly translate abstracts and theses of scientific works into African languages.
- Chatbots and assistants: Use in conversational systems to answer scientific questions in local languages.
- Batch processing: Run mass text translation via vLLM with batch response generation.
Example
import re, torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "Aletheia-ng/gemma-3-1b-science-translate-best"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16).cuda().eval()
def translate(text, language, max_new_tokens=256):
msgs = [{"role": "user", "content": f"Translate the text to {language}: {text}"}]
enc = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to("cuda")
with torch.no_grad():
out = model.generate(**enc, max_new_tokens=max_new_tokens, do_sample=False)
raw = tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True)
return re.sub(r"^<[a-z]{3}>\s*", "", raw.strip())
print(translate("Good morning, how are you?", "Yoruba"))Read more
DetailsMetrics and operational features:
• Main metric (AfriScience-MT test): average sentence-level chrF is 53.11 (compared to 50.76 for the base model).
• Full article translation: average score of 54.70 with 96% successful generation completions.
• General benchmarks: scores 35.15 chrF++ on the FLORES+ devtest.
• Requirements: can run on consumer GPUs thanks to the compact 1B parameter size.
• Limitations: translation is supported exclusively from English into African languages.










Comments