Neural Machine Translation through Active Learning on low-resource languages: The case of Spanish to Mapudungun
Year: 2023

Abstract:
Active learning is an algorithmic approach that strategically selects a subset of examples for labeling, with the goal of reducing workload and required resources. Previous research has applied active learning to Neural Machine Translation (NMT) for high-resource or wellrepresented languages, achieving significant reductions in manual labor. In this study, we explore the application of active learning for NMT in the context of Mapudungun, a lowresource language spoken by the Mapuche community in South America. Mapudungun was chosen due to the limited number of fluent speakers and the pressing need to provide access to content predominantly available in widely represented languages. We assess both model-dependent and model-agnostic active learning strategies for NMT between Spanish and Mapudungun in both directions, demonstrating that we can achieve over 40% reduction in manual translation workload in both cases.

heading: 1 Introduction
text: Over the course of history, South America has been home to numerous indigenous cultures and languages (Campbell et al., 2012), reflecting the region’s rich linguistic diversity and heritage. Unfortunately, the dominance of the Spanish language in this region has threatened many indigenous languages, often leading to their decline or even extinction. This has resulted in an immeasurable cultural and historical loss for humanity, as language diversity vanishes (Ostler, 1999). Among the last remaining native languages is Mapudungun, spoken in Chile and Argentina by nearly 1.8 million people (Mapuches), but only 10% of them handle the language correctly and barely another 10% understand it. In the same spirit, the Conadi Indigenous Languages Program1 predicts that this
1https://www.conadi.gob.cl/noticias/conadi-lanzoaplicaciones-y-realizara-cursos-online-de-mapuzungun-paraque-miles-de-indigenas-aprend
language will become extinct in a few generations, mainly due to the lack of individuals that can speak this language. Despite this, there are still groups within Chile that only speak Mapudungun, leaving them sometimes excluded from the rest of society. Furthermore, the social tension over the past few years has raised native indigenous people to the forefront of discussion, attracting high interest in the community to find ways to include them in society as equals. Unfortunately, the availability of human translators fluent in those languages is minimal, and no automated translators exist today supporting those languages. In this work, we present an active learning setting to improve the efficiency and efficacy of machine translation for low-resource languages, in this case, Mapudungun. In other words, we aim to reduce the effort made by human translators given that the quantity of people fluent in Mapudungun is scarce. Given this, the task of translating and reviewing large amounts of text is unattainable. One of the main tasks of active learning is choosing the appropriate data points (texts) to be translated by human translators to train a neural machine translation (NMT) model with as few examples as possible. To evaluate our approach, we utilized an open-source corpus from the AVENUE project (Levin et al., 2000) and supplemented it by scraping the web for Spanish-Mapudungun sentence pairs. We assembled a dataset of approximately 30,000 pairs, creating a comprehensive corpus for our research. We simulate an offline active learning setting to measure the amount of work that can be reduced by using different active learning strategies. The main contributions of this paper are: (1) Proposing active learning training strategies to reduce low-resource language speaker translators workload by more than 40%, (2) Finetuning a Mapudungun NMT model capable of obtaining competitive results and (3) Sharing our code for research reproducibility2.
2https://github.com/OpenCENIA/al4mt
6

heading: 2 Related work

heading: Active learning
text: Active learning is an effective machine learning training approach where the algorithm actively selects informative data to learn from, resulting in improved performance with fewer labeled instances (Settles, 2009). While initially applied to text classification, information retrieval, classification, and regression tasks (Tong and Koller, 2001; Zhang and Chen, 2002; Carvallo et al., 2020; Carvallo and Parra, 2019; Houlsby et al., 2011), active learning has recently been extended to tasks such as Named Entity Recognition, Text Summarization, and Machine Translation (Shen et al., 2017; Zhang and Fung, 2012; Zhao et al., 2020; Zhang et al., 2018). This study investigates unexplored potential of active learning in machine translation for untranslated examples in Mapudungun, a low-resource language.
Machine translation for low-resource languages Efforts to overcome resource scarcity in lowresource language translation have proposed pretraining strategies for data generation and performance improvement. Methods include crosslingual language model pretraining on highresource languages data, then finetuning on lowresource languages (Zheng et al., 2021), multilingual sequence-to-sequence pretraining (Song et al., 2019; Xue et al., 2020; Liu et al., 2020), dictionary and monolingual data augmentation (Reid et al., 2021), and back-translation data augmentation (Sugiyama and Yoshinaga, 2019). However, these strategies lack human-in-the-loop components and don’t guarantee human approval of the model’s iterative translations under active learning.

heading: Data selection in NMT
text: The data selection problem in NMT has received attention from several authors. Some propose weighted sampling methods to improve performance and accelerate training (Van Der Wees et al., 2017; Wang et al., 2018a), while others focus on filtering noisy data (Wang et al., 2018b; Pham et al., 2018) or selecting domain-specific data for back-translation (Fadaee and Monz, 2018; Poncelas et al., 2023; Dou et al., 2020). Furthermore, Wang et al proposed a method to select relevant sentences from other languages to enhance lowresource NMT performance (Wang and Neubig, 2019). As in using data augmentation the task of
selecting data for training a NMT model do not include a user in the feedback loop.

heading: 3 Methodology
text: In this section we describe in detail the active learning framework proposed for NMT on low-resource languages and the type of active learning strategies depending if there is or not a machine learning model involved in the selection of examples for being labeled. In Figure 1, we show the active learning setting used in this work. In the first step, we initialize an NMT model, then given a monolingual corpus in Spanish and an active learning strategy, it chooses examples for being translated by an oracle to Mapudungun. After obtaining the translated sentences, we fine-tune the NMT model, update its parameters, and then use this updated version to select new sentences for labeling. We use four active learning strategies to select sentences for an oracle’s translation: entropy sampling, margin sampling, confidence sampling, and decay logarithm frequency. The strategies chosen are pertinent to both Spanish to Mapudungun and Mapudungun to Spanish translations in low-resource scenarios. They address key issues such as uncertainty, data diversity, and model reliance, thus optimizing translation models and aiding language preservation. The strategy’s reliance on the model varies; model-agnostic strategies don’t need it for selecting sentences, while model-related ones use its certainty level. The number of active learning iterations and oracle translation requests is userdetermined at the start of training.

heading: 3.1 Model-related strategies
text: These strategies use the model to choose the examples for being labeled and rely on the model’s confidence level in untranslated examples.

heading: Entropy sampling
text: In this strategy we consider entropy as a measure of uncertainty, where the higher entropy indicates higher uncertainty and more chaos. Therefore this strategy consists in sampling examples with higher average entropy given by equation 1.
1
m
m∑
i=1
entropy(Pθ(.|x, ŷ<i) (1)

heading: Minimum margin sampling
text: This strategy calculates the average probability gap between the model’s most confident word (y∗i,1)
and the second most confident word (y∗i,2). If the margin is small, the model cannot identify the best translation from an inferior one, so we sample sentences with a lower margin as shown in the equation 2.
1
m
m∑
i=1
[Pθ(y ∗ i,1|x, ŷ<i)− Pθ(y∗i,2|x, ŷ<i)] (2)

heading: Least Confidence sampling
text: This strategy estimates the model uncertainty by averaging the predicted probability of each word the translator generates. We sample those sentences with a lower level of confidence to force the model to learn harder sentences, as shown in equation 3.
1
m
m∑
i=1
[1− Pθ(ŷi|x, y<i)] (3)

heading: 3.2 Model-agnostic strategy
text: In this case, we use the decay logarithm frequency strategy (Zhao et al., 2020) that does not require a NMT model to choose examples for being labeled by an oracle. The intuition behind this strategy is to choose sentences different from the ones that have already been translated in terms of linguistic features.

heading: Decay logarithm frequency
text: We define two sets of sentences: U that are untranslated and L translated sentences on the current active learning iteration. In the first step, we define the logarithm frequency of a word w in U , namely F (w|U) shown in equations 4 and 5.
G(w|U) = log(C(w|U) + 1) (4)
F (w|U) = G(w|U)∑ w′∈U G(w′|U) (5)
Where C(w|.) measures the frequency of a word w in a given sentence set that can be U or L. Then we add a decay factor that favors the diversity of words and includes two hiper-parameters (λ1 and
λ2) that allow giving more or less importance to words from the labeled (L) or the unlabeled sets (U ). Also, we normalize by dividing the obtained score over the sentence length (K).
fy(s) =
K∑ i=1 F (si|U)× e−λ1C(si|L)
K (6)
Equation 6 if used as threshold to obtain Û(s) that is the set of all sentences that have a higher lf score than s. In this way, we tend to discard repetitive sentences and filter out insignificant function words. The obtention of the final delfy score is shown in equations 7 and 8.
delfy(s) =
K∑ i=1 F (si|U)×Decay(si)
K (7)
Decay(si) = e −λ1C(si|L) × e−λ2C(si|Û(s)) (8)

heading: 4 Experiments

heading: 4.1 Dataset, preprocessing and NMT model
text: The dataset consists of 29,829 Spanish to Mapudungun sentence pairs considering only sentences length higher than five words, with 50,840 unique words in Spanish, 67,757 unique words in Mapudungun, and a vocabulary size of 118,597. We do not remove stopwords, lemmatization, or low-case texts, since we aim to capture both languages’ peculiarities, including punctuation and idioms. We used a MarianMT (Junczys-Dowmunt et al., 2018) translation model based on a transformer architecture consisting of 12 encoder layers, 16 encoder attention heads, 12 decoder layers, and 16 attention heads. For training on active learning, we use a learning rate of 0.0002 and a weight decay of 0.01. We train the necessary epochs in each active training round until the validation perplexity remains the same. λ1 and λ2 in the delfy are set to 1.0 each. For training on active learning, we
finetune a MarianMT translator from Spanish to Deutsch. Despite the apparent oddity of linking an Indo-European language, Deutsch with Mapudungun, our approach harnesses shared agglutinative traits to enhance translation.

heading: 4.2 Active Learning for NMT
text: Concerning the active learning setting, we run ten iterations using the 10% of the train set. For evaluating active learning strategies, we used the SacreBLEU3 library and evaluated the model’s outputs with BLEU (Papineni et al., 2002). As we run an offline experiment, we assume the oracle is continuously right, extracting the correct translation each time and adding those examples to the train set. In our offline experiment, we used existing labeled training data to eliminate the need for human annotators. Our goal was to assess which strategy efficiently utilizes a smaller data proportion, reducing manual translation effort while preserving model performance. This approach enables optimization of active learning strategies without added annotation costs.

heading: 4.3 Results
text: The results of this study suggest that for Spanish to Mapudungun translation, the most effective active learning strategy is Delfy, which achieved a BLEU score of 65.45 when trained on 60% of the corpus. Margin and entropy sampling were also effective strategies, achieving BLEU scores of 62.92 and 62.72, respectively. For Mapudungun to Spanish translation, margin sampling was the most effective active learning strategy, achieving a BLEU
3https://github.com/mjpost/sacrebleu
score of 59.378. Both settings showed benefits of training on active learning, with a reduction in the workload of approximately 40%. However, there is space for improvement in further reducing workload, as other studies on high-resource or well-represented languages have reduced over 80% (Zhao et al., 2020) of manual translation work. This work demonstrated significant progress in translating a low-resource language such as Mapudungun, with both active learning strategies outperforming the baseline strategy of random sampling.

heading: 5 Conclusion
text: In conclusion, this study revealed that Delfy was the most effective active learning strategy for Spanish to Mapudungun translation, while margin sampling outperformed in Mapudungun to Spanish. In both cases, training with active learning strategies reduced workload by over 40%. Our comparative analysis, driven by the diverse approaches of the chosen strategies, identifies the most efficient methods for low-resource translation tasks. This research is crucial for languages particularly Mapudungun, as it fosters information access and reduces language barriers for indigenous communities. Future work will focus on designing active learning strategies specifically for low-resource languages.

heading: Acknowledgements
text: National Center for Artificial Intelligence CENIA FB210017, Basal ANID.

heading: Future Work
text: Future work will focus on designing active learning strategies specifically for low-resource languages