A fine-tuned version of Google Gemma 3 1B, continued-pretrained and instruction-tuned for English → Swahili translation and general Swahili instruction-following.
Also available as a quantized Ollama release (ollama run amplifiedaccessorg/Swahili-gemma-1b-it).
Highlights
BLEU 28.86 on English→Swahili FLORES-200 translation — up from 0.41 on the base model
chrF++ 54.77 — up from 14.28 on the base model
1B parameters — small enough to run on consumer hardware
Trained with QLoRA (4-bit NF4 base + LoRA adapters), then merged to full weights
Results
FLORES-200 devtest, English→Swahili, beam search (beam=8), 256 max new tokens:
Model
BLEU
chrF++
Gemma 3 1B base (no fine-tuning)
0.41
14.28
This model
28.86
54.77
Fine-tuning took the base model from essentially no working Swahili translation ability to a functional, fluent translator on both metrics.
Usage
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
34model_id ="AmplifiedAccess/Swahili-gemma-1b-it"56tokenizer = AutoTokenizer.from_pretrained(model_id)7model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.float16, device_map="auto")89prompt =("<start_of_turn>user\n"10"Translate the following English sentence to Swahili.\n"11"English: The children are playing outside.\nSwahili:<end_of_turn>\n"12"<start_of_turn>model\n")1314inputs = tokenizer(prompt, return_tensors="pt").to(model.device)15with torch.no_grad():16 outputs = model.generate(**inputs, max_new_tokens=128, do_sample=False)1718response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)19print(response.strip())
Recommended prompt format
The model was trained on this exact translation template — using it gets the most reliable output:
Translate the following English sentence to Swahili.
English: <your sentence>
Swahili:
It was also trained on general Swahili instruction data (Aya, Alpaca-Swahili), so it can follow other Swahili-language instructions, but translation quality is best with the format above.
Example translations (tested against the deployed model)
English
Model output
The children are playing outside.
Watoto wanacheza nje.
I would like a cup of coffee, please.
Ningependa kikombe cha kahawa tafadhali.
The government announced new policies to support small businesses across the country.
Serikali ilitangaza sera mpya kusaidia biashara ndogo nchi nzima.
Training details
Pipeline
Two-stage training on Kaggle (T4 GPU):
Stage 1 — Continued pretraining on Swahili data, producing an intermediate CPT-merged checkpoint (base for this stage).
Stage 2 — Supervised fine-tuning (this release): QLoRA on top of the CPT-merged checkpoint, then merged to full weights.
Data (Stage 2 SFT)
Source
Examples
Notes
MAFAND-MT (en-swa)
32,414
Human-translated news domain (Masakhane)
Rogendo/English-Swahili-Sentence-Pairs
58,052
Sunbird SALT (text-all)
23,947
Full/uncapped
Svngoku/Inkuba-Swahili-MMT
29,991
Capped at 30k, normalized to EN→SW direction
CohereForAI/aya_dataset (Swahili)
359
Human instruction data
iamshnoo/alpaca-cleaned-swahili
14,844
Capped at 15k
Back-translation (NLLB, planned)
0
Did not run — monolingual source returned 0 usable lines in this training run
Total (post quality filter)
159,311
296 pairs dropped by a length-ratio sanity filter
Packed into 25,452 blocks of 512 tokens (~13.0M training tokens).
Configuration
Parameter
Value
Base model
google/gemma-3-1b-it (via CPT-merged checkpoint)
Method
QLoRA (4-bit NF4 base + LoRA), merged to full weights after training