Back to search

University of Pretoria

Optimizing translation for low-resource languages : efficient fine-tuning with custom prompt engineering in large language models

Abstract

dc:description.abstract

Training large language models (LLMs) can be prohibitively expensive. However, the emergence of new Parameter-Efficient Fine-Tuning (PEFT) strategies provides a cost-effective approach to unlocking the potential of LLMs across a variety of natural language processing (NLP) tasks. In this thesis, we selected the Mistral 7B LLM as our primary model due to its superior performance, which exceeds that of LLAMA 2 13B on multiple benchmarks. Using PEFT methods, we aim to significantly reduce the cost of fine-tuning while maintaining high levels of performance. Despite their advancements, LLMs often struggle with translation tasks for low-resource languages, particularly morphologically rich African languages. To address this, we employ customized prompt engineering techniques to enhance LLM translation capabilities for these languages. Our experimentation focused on fine tuning the Mistral 7B model to identify the best-performing ensemble using a custom prompt strategy. The results obtained from the fine-tuned Mistral 7B model were compared with several models: Serengeti, Gemma, Google Translate API, and No Language Left Behind (NLLB). Specifically, Serengeti and Gemma were fine-tuned using the same custom prompt strategy as the Mistral 7B model, while Google Translate API, NLLB and Gemma which are pre-trained to handle English-to-Zulu and English-to-Xhosa translations, were evaluated directly on the test data set. This comparative analysis allowed us to assess the efficacy of the main experimental model against both custom-tuned and pre-trained translation models. LLMs have traditionally struggled to produce high-quality translations, especially for morphologically rich low-resource languages. Our experiments revealed that the key to improving translation performance lies in using the correct prompt during fine-tuning. We developed a custom prompt that significantly improved translation quality for English-to-Zulu and English-to Xhosa language pairs. We fine-tuned the Mistral 7B model for 30 GPU days, we compared its performance to the NLLB model and Google Translate API on the same test dataset. Although NLLB achieved the highest scores across BLEU,G-Eval (cosinesimilarity), and Chrf++(F1score), our main model’s results still performed competitively against it. Furthermore, we showed that our custom prompt template can improve the translation accuracy of other models, such as Gemma and Serengeti, when applied to high-quality bilingual datasets. Thus, demonstrated that our custom prompt strategy is adaptable across different LLMs architectures, bilingual settings, and is highly effective in accelerating learning for low-resource language translation.

Degree

thesis:*
Department dc:contributor.department
Computer Science
Grantor dc:publisher
University of Pretoria
Year dc:date.issued
2025

Author and committee

dc:creator, dc:contributor.*
Advisors dc:contributor.advisor
  • Marivate, Vukosi
  • Sefara, Joseph

Subjects

dc:subject × 7

Rights

dc:rights.accessrights
Statement dc:rights.accessrights
  • Unrestricted
  • © 2024 University of Pretoria. All rights reserved. The copyright in this work vests in the University of Pretoria. No part of this work may be reproduced or transmitted in any form or by any means, without the prior written permission of the University of Pretoria.
Language dc:language.iso
en

Identifiers

dc:identifier.*
Dc Identifier Citation
*
Dc Identifier Other
A2026

Chain of custody

source
Harvested from
University of Pretoria
Base URL
repository.up.ac.za/server/oai/request
Last updated
2026-12-01
Source record
OAI-PMH GetRecord
citation

Optimizing translation for low-resource languages : efficient fine-tuning with custom prompt engineering in large language models. University of Pretoria, 2025. https://doi.org/10.25403/UPresearchdata.30278812