# Multilingual Health QA — Low-Resource African Languages
**Public leaderboard score: 0.481518**
## The problem
Answer health-related questions in Akan (Twi), Amharic, Luganda, and Swahili, plus English variants from Uganda, Ghana, Kenya, and Ethiopia. Eight language-country subsets, ~30K training examples, scored on a mix of ROUGE-1, ROUGE-L, and an LLM judge.
## How I approached it
Two models, combined:
1. **TF-IDF retrieval** — find the most similar question in the training set (per language, using character n-grams so it works across scripts) and return its answer.
2. **Fine-tuned mT5-small** — generates answers from scratch, with a language-aware prompt telling it which language to answer in.
A per-subset ensemble checks both models on the validation set and picks whichever one actually scores higher, language by language, instead of betting on one approach everywhere.
## A real constraint that shaped this
I wanted to fine-tune `mt5-base`, but it threw a CUDA out-of-memory error on Kaggle's GPU even at batch size 1. So I switched to `mt5-small`, cut the per-device batch size to 2 and leaned on gradient accumulation (8 steps) to keep the same effective batch size of 16, and shortened the max sequence length to 128 tokens to fit the available memory. I also lost real GPU quota to Kaggle session timeouts mid-training. None of this is the setup I'd pick with unlimited resources — it's the one that actually ran, and I wrote about that honestly in the report instead of glossing over it.
## Results
| Approach | Outcome |
|---|---|
| Global TF-IDF (one index for everything) | Mixed-language answers — broken |
| Per-subset TF-IDF | Solid baseline, strong on English subsets |
| mt5-base fine-tuning | OOM crash |
| mt5-small fine-tuning (3 epochs) | Trains successfully, decent on harder subsets |
| **Per-subset ensemble (final)** | **0.481518 on the public leaderboard** |
Retrieval wins on subsets with more repetitive question patterns. Generation wins where p …