DEV Community

iradukunda annet
iradukunda annet

Posted on

Improving Our English-to-Kinyarwanda Translation Project this was done in group 3

During our NLP studies, we worked on a project to translate English into Kinyarwanda using GPT-2. We used a dataset from Hugging Face with around 3,000 English–Kinyarwanda sentence pairs.

However, GPT-2 sometimes gave us incorrect translations, and some sentences did not make sense. This made us want to research other models that could help improve our project.

After learning about Large Language Models (LLMs), I understood that choosing a model is not just about how big it is. We also need to consider what it was trained to do, its language abilities, its memory requirements, and whether we can run it with the resources we have.

In this blog, I will compare four open-weight LLMs and explain which one I would choose to test in our project.

  1. The Models We Researched

Qwen3-4B-Instruct-2507

Qwen3-4B-Instruct-2507 was developed by the Qwen team. It has 4 billion parameters and a context window of 262,144 tokens. It uses the Apache 2.0 licence.

This model is designed for instruction following, reasoning, coding, and text generation. I find it interesting because it has multilingual capabilities and can follow instructions about how to format its answers.

For our project, we could ask it to translate English sentences into Kinyarwanda and return only the translation. However, we would still need to test how accurately it handles Kinyarwanda.

Llama 3.2 3B Instruct

Llama 3.2 3B Instruct was developed by Meta. It has approximately 3.21 billion parameters and a context window of 128K tokens. It uses the Llama 3.2 Community Licence, which has its own conditions.

It is designed for tasks such as conversation, summarisation, and following instructions. It could help us experiment with different translation prompts.

One limitation is that Kinyarwanda is not among its officially supported languages. This means we should not assume that it will produce accurate translations without testing it.

SmolLM3-3B

SmolLM3-3B was developed by Hugging Face. It has 3 billion parameters and supports long-context processing, with a documented context length of up to 128K tokens. It uses the Apache 2.0 licence.

This model focuses on text generation, reasoning, and instruction following. Its relatively small size makes it interesting for people who want to experiment with LLMs using limited computing resources.

However, its language support is limited compared with some multilingual models. We would need to evaluate its Kinyarwanda translation quality before deciding whether it is suitable.

Phi-4-mini-instruct

Phi-4-mini-instruct was developed by Microsoft. It has 3.8 billion parameters and supports a context window of 128K tokens. It uses the MIT licence.

It is designed for reasoning, coding, and following instructions. It could help us test different prompts and compare the translations it generates.

However, Kinyarwanda is not listed among its officially supported languages. Although it may be useful for general text tasks, its translation ability for our project needs to be evaluated.

  1. Comparing the Models

Model | Parameters | Context window | Licence | Main

strengths

Qwen3-4B-Instruct-2507 4B 262K tokens Apache 2.0

                                                     Multilingual                              
                                                   text,instructions
                                                       ,reasoning
Enter fullscreen mode Exit fullscreen mode

Llama 3.2 3B Instruct 3.21B 128K tokens Llama
CommunitLicence
Conversation,
summarisation,

instructions

SmolLM3-3B 3B Up to 128K tokens Apache 2.0 Text generation,

reasoning,

compacsize

Phi-4-mini-instruct 3.8B 128K tokens MIT Reasoning, coding,

instructions

The context windows above are the models' documented maximums. We do not need such large context windows to translate individual sentences.

  1. Can We Run These Models on Free Google Colab?

One important thing we learned is that model size affects memory use. A free Google Colab T4 GPU has 16 GB of GPU memory, although access and availability can vary.

When using FP16 precision, the approximate memory required just to store the model weights is:

Qwen3-4B: around 8 GB.

Llama 3.2 3B: around 6.4 GB.

SmolLM3-3B: around 6 GB.

Phi-4-mini: around 7.6 GB.

These are estimates, not the total memory needed to run a model. We also need memory for the inputs, generated tokens, and other calculations. All four could be reasonable candidates for testing with short sentences, but we would need to monitor GPU memory and generation time.

Another advantage is that we can download these models and run them using tools such as Hugging Face Transformers without paying for a hosted model API. We must still follow each model's licence and check any access requirements. For example, Llama has specific community licence terms.

I have not tested the actual speed or memory usage of these four models on Colab yet, so I would measure those during our experiments instead of guessing which is fastest.

  1. What I Learned About LLMs Today

Today, we learned that LLMs generate text by predicting the next token. We also studied tokenization, embeddings, Transformers, context windows, and how models generate responses.

This helped me understand why GPT-2 could generate text but still give us poor translations. GPT-2 is trained to predict the next token, but that does not automatically make it the best model for every translation task.

I also learned that different models have different strengths. Some are better suited for general conversations and reasoning, while others are designed specifically for translation. This is why we need to choose a model based on our project's needs rather than its name or size alone.

  1. Which Model Would I Choose?

For our LLM experiment, I would choose Qwen3-4B-Instruct-2507 as the first model to test.

I chose it because of its multilingual capabilities, instruction-following improvements, and manageable parameter count. Its Apache 2.0 licence also makes it a practical option for experimentation, provided we follow the licence terms.

We could give Qwen3 clear instructions to translate English sentences into Kinyarwanda and return only the translated sentence. Then we could compare its results with the translations from GPT-2 using the same test sentences.

We would check whether the translations preserve the original meaning, sound natural in Kinyarwanda, and avoid adding or removing important information. We could also use an automatic evaluation metric such as chrF or BLEU and ask Kinyarwanda speakers to review some results.

However, I would not claim that Qwen3 is already better than GPT-2 because we have not completed that comparison. Since our project is specifically about translation, we should also consider a translation-focused model such as NLLB-200 as another baseline.

Our final decision should depend on the results, not only on the model's advertised features.

Conclusion

This research helped me understand that choosing the right model is an important part of building an NLP project. GPT-2 helped us start our English-to-Kinyarwanda translation project, but its incorrect translations showed us that we needed to explore other options.

I would start by testing Qwen3-4B-Instruct-2507 because of its multilingual capabilities and instruction-following features. After testing it against GPT-2, we would have a better idea of whether it improves our translations.

I learned that understanding how LLMs work is useful, but testing them on our actual project is what helps us make a better decision.

Top comments (0)