Fixing Rogue Memorization in Many-to-One Multilingual Translators of Extremely-Low-Resource Languages by Rephrasing Training Samples (2024)

Abstract: In this paper we study the fine-tuning of pre-trained large high-resource language models (LLMs) into many-to-one multilingual machine translators for extremely-low-resource languages such as endangered Indigenous languages. We explore those issues using datasets created from pseudo-parallel translations to English of The Bible written in 39 Brazilian Indigenous languages using mBART50 and WMT19 as pre-trained models and multiple translation metrics. We examine bilingual and multilingual models and show that, according to machine translation metrics, same-linguistic family models tend to perform best. However, we also found that many-to-one multilingual systems have a tendency to learn a “rogue” strategy of storing output strings from the training data in the LLM structure and retrieving them instead of performing actual translations. We show that rephrasing the output of the training samples seems to solve the problem.

## introduction with the explosion in popularity of large language models (llms), there is currently a de facto standard to create machine translators (mts) for lowresource languages: take one llm pre-trained on a large corpus with self-supervised techniques and fine-tune it using a much smaller parallel downstream corpus in that language @xcite . that usually results in better translation accuracy than with a model trained from scratch but with limited data @xcite . for underresourced languages, it is also common to improve translation quality even further by the use of data from multiple languages and large multilingual models @xcite . in this work we show experimentally that the reality of creating translators for extremely lowresource languages is, unfortunately, much more difficult. notably, we show that when performing such "standard" fine-tuning of multilingual llms, we have to be very careful on interpreting results which rely only on average scores of referencebased translation quality metrics. we present a case where improved averaged measurements, instead of signifying better machine translators, are in fact the result of a "rogue" model which stores outputs from the training data and retrieves them as canned outputs. in other words, the fine-tuned model hallucinates translations by generating texts which are disconnected to the input: they are perfectlymemorized reproductions of training samples. because the mt sometimes succeeds in producing a "perfect", high-score with a memorized answer, the average score of the model is inflated, higher than other approaches, although the model is, in fact, totally inappropriate for the actual task. we present strong evidence that the memorization side-effect is a result of the inclusion of repetitions of target texts in training set, which is an artifact of many-to-one translators, since the memorization effect directly increases with the number of languages in the multilingual model. we then show that rephrasing the target text helps to avoid memorization without affecting translation quality and that is a viable solution for many other applications since now is feasible to create rephrasings of texts with llms. our findings come in a context where multilingual fine-tuning of llms is often used when extremely-low-resource languages are involved. in our experiments we fine-tuned pre-trained llms to make mts from 39 brazilian indigenous languages (bils) to english 1 . those languages are typical of scenarios where there is almost no data available for training but we can find translations of official documents or religious texts to fine-tune existing models, that is, often with many-to-one or one-to-many mappings of the same texts to a higher-resourced language such as english. for our experimental study, we compiled a parallel corpus with pseudo-alignments of verses from the bible, and fine-tuned two commonly-used llms, i.e. mbart50 and wmt19, relying on one bilingual and two multilingual fine-tuning strategies. the results are evaluated with three standard reference-based metrics for machine translation, i.e. the n-gram based bleu score and the trained neural metrics named bleurt and bertscore. to quantify the memorization behavior and to provide evidence that our many-to-one multilingual mts became content retrievers, we implement a memorization metric based on finding the smallest distance of the generated text to target sentences in the training set, in this case the verses from the bible in english. our metric suggests that the problem worsens as more languages are added to the training set. we then show that, by using rephrases of the output verses from 10 different versions of ghe bible in english, we can build a multilingual translator for 10 bils of the same linguistic family in which the memorization issues virtually disappear. the main contribution of this paper is to show that automatic evaluation metrics can be deceiving in extremely-low-resource scenarios and how important it is to perform different forms of evaluation of the outputs, including qualitative inspections. this paper also shows that strictly following well-known approaches from the nlp literature, such as multilingual training, can result in models with undesired memorization effects. we also propose and demonstrate that such undesired behaviour can be fixed with rephrasings which can be easily generated with current days' llms. ## related work most of the recent impressive results of nlp have been observed with english and a few other languages. despite efforts in expanding such research for other languages @xcite @xcite , results have been limited, covering at best about 200 languages @xcite , leaving behind almost 7,000 other languages. in brazil, none of the about 200 indigenous languages spoken in the country are covered by llms. many of the brazilian indigenous languages (bils), sim-ilarly to other extremely-low-resource languages languages in the world, are endangered, facing the challenge of disappearing in just a few decades from today. @xcite provide a good discussion on why and how ai can contribute to the survival of such languages, and at same, the benefits to ai of working with endangered languages. one big challenge in scaling up the current ai progress to more languages is the data-hunger needs of current nlp models. since the vast majority of the languages in the world are lowresourced or extremely-low-resourced, one hope to overcoming this data-scarcity issue is the use of self-supervised pre-trained models and fine-tune such models to downstream tasks such as mt. in that case, the general-purpose language knowledge of the pre-trained model is transferred and reused in a context of a much smaller training set through fine-tuning of its parameters @xcite . another way to circumvent the lack-of-data problem is to use multilingual models, where data from several languages are combined @xcite . the main assumption is that multilingual models can leverage the shared linguistic characteristics of related languages, expanding the utility of very small datasets. but the non-deliberated use of extra languages may worsen the performance, a phenomenon usually called negative transfer @xcite . a more particular approach, common in some extremely-low-resource languages such as indigenous languages, is to rely on multi-way multilingual corpora, in either many-to-one or one-to-many directions @xcite . the same monolingual text, translated to many languages, is used in the training set multiple times as either source or target text @xcite . typically those texts are official documents and religious texts, such as the bible @xcite @xcite @xcite . one effect of such approach is that samples appear repeatedly in the training set, either as source or target texts, what can trigger a known problem in llms: memorization @xcite . memorization in llms consists of generating identical or nearly-identical reproduction of training samples during inference time. notice that memorization can be beneficial for some applications, such as closed-book q&a, and it is not necessarily a type of overfitting @xcite . but in terms of machine translation, given that it has been shown that removing duplications is beneficial in terms of improving translation quality of mt systems @xcite , we explore here whether the negative impact of duplications on translation quality is due to the memorization of duplicated training samples. together with other factors such as model size and vocabulary size @xcite , duplication of examples in the training set is known to sometimes produce memorization @xcite . ## translating indigenous languages creating machine translators and other nlp tools with extremely-low data resources is of key importance for indigenous languages and in particular for the about 2,800 languages which are in danger of disappearing in the world @xcite . modern nlp technology tools may not only be a way to contribute to the vitalization of those languages but also paths to propagate the culture and support the political rights of their communities @xcite @xcite . in this paper we explore particular issues and difficulties faced by the construction of machine translators for languages which are spoken by hundreds or at most thousands of people, often in semiisolated conditions and with extremely low presence in the web, making web crawling and crowdsourcing unfeasible ways to gather data. our main source of data are the many translations to indigenous languages of the the bible. since it is structured in numbered verses, it is relatively easy to create quasi-parallel datasets (that is, the translations may differ in style), as done in other works @xcite . it is possible to use the bible as data for many of the bils, since it has been translated into many of those languages by christian churches @xcite . we understand that there are important ethical, historical, and cultural issues around the use of the bible as a source of data for indigenous languages, which we discuss in detail in section 9 at the end of the paper. ## experimental study in this section we describe the methodology and results of fine-tuning llms into machine translators for the 39 bils presented in ## memorization issues another issue we could see in this qualitative analysis was that there were many exact copies of output sentences. translation from different languages of sentences with the same meaning and structure is expected to generate very diverse outputs. we saw the occurrence of repetitions as evidence of rogue memorization. the extent of the problem is evidenced by the results of the analysis presented in to more precisely quantify the extent of the memorization by the models, we implemented a metric to quantify memorization, based on computing the smallest distance of a generated output to a sample from the training. the assumption is that, when memorization occurs, the decoder reproduces a training sample, which in this case is one verse of the bible, even when the translation-quality metric presents a low value. for that, we compute the euclidean distance between the output and the references of all training samples, and return the smallest distance as the measured value. the distance is computed on a semantic representation of the texts, using the sentence transformers python library foot_7 , using the all-minilm-l6-v2 model foot_8 . with that we are computing even soft memorization effects since we are not relying on a exact match as usually employed in previous works @xcite . in figure 2 we present the distribution of our memorization metric considering a training examples as inputs. in those plots, the further the distribution is shifted to the left, the stronger is the production of memorized literal verses. the results with *-al39 (mbart50-al39 and wmt19-al39) and *-al10 evaluations, compared with *-bl39 and *-bl10, clearly show that the multilingual model strongly memorized the training set. (a) mbart-bl39 (b) mbart-al39 (c) mbart-bl10 (d) mbart-tf10 (e) mbart-al10 (f) wmt19-bl39 (g) wmt19-al39 (h) wmt19-bl10 (i) wmt19-tf10 (j) wmt19-al10 figure 3: histograms with the frequency of the minimum distance of a generated translations of test samples to examples in the training set. with the bilingual models, the mean minimum distance ranges from 0.62 with mbart50-bl10 to 0.66 with wmt19-bl39, while with the all language models, the mean distance falls to a range between 0.14 with mbart50-al10 to 0.16 with wmt19-al10. with tf10 models, the memorization effect gradually increases with the number of languages in the training set, since this model presents mean values of 0.58 and 0.36 for wmt19-tf10 and mbart-tf10, respectively. interestingly, with the latter we also observe a slightly bimodal distribution, indicating that the peak of the distribution is in the middle of a shifting process between the mbart50-bl10 and mbart50-al10. we conducted a similar evaluation considering the outputs generated from inputs of the test set. the results are displayed in figure 3 . surprisingly, we observe quite similar results to what we observed with the training set. that is, the results with the all languages models present strong evidence of producing memorized verses, with mean minimum distances to an output from the training set ranging from 0.14 with mbart50-al39 to 0.17 with wmt19-al39, while the bilingual models presents a much higher range of mean values, from 0.62 with mbart50-bl39 to 0.64 with wmt19-bl39. once again, both mbart50-tf10 and wmt19-tf10 present some in-between tomemorization transition, with mean values of 0.59 and 0.47, respectively. what is impressive, from these results on the test set, is that it seems that the memorization occurs in the decoder side of the transformer architecture. and when the models are doing heavy memorization, there is some disconnection to the encoders. that is, no matter the input sentence, the model simply generates one of the sentences it had memorized. ## using rephrasings to overcome memorization issues in this section we investigate whether the use of rephrasings instead of the repeated outputs can al-leviate the memorization issue. as we saw, the inclusion of repeated outputs results in models that memorize those outputs as the number of repetitions increase, i.e. as the number of languages in the multilingual training set increase. thus, by using outputs that are similar in semantics but which are not exact duplicates, we evaluate the impact on mt quality metrics and on memorization. for this investigation we rely on rephrasings of the bible in english written by different authors. although we could have used an llm such as chatgpt and the like to generate as much rephrasings as possible, we relied on different versions of the bible translated only by humans to avoid errors which could be introduced by llms. given that translations of the bible are not so abundant, we were able to collect 10 rephrasings which were then used to evaluate the impact on the mbart50-tf10 model, which is based on 10 different languages. the results were very positive. the scores (and respective standard deviations) achieved by this model are of 0.408 (±0.085), 0.887 (±0.029), and 10.432 (±10.123), for bleurt, bertscore, and bleu, respectively. that represent gains of 6% and 1% with bleurt and bertscore (compared with 0.385 and 0.879, respectively, without rephrasing), and a loss of 15% with bleu (12.325 without rephrasing). notice that, despite the loss in bleu, we see a decrease of 38% in the standard deviation with that metric (from 16.218 to 10.432), and of 27% and 20% with bleurt and bertscore (from 0.116 and 0.036, respectively, to 0.085 and 0.029). we strongly believe that those decreases in standard deviations are directly related to the decrease of memorization, as we show next. to show the reduction in memorization, we present in figure 4 the plots of the memorizationeffect metric comparing the outputs generated by the mbart50-tf10r model and the previous mbart50-tf10, considering both training and test samples as input sentences. considering the test samples, as shown in figure 4d , this evaluation resulted in a mean distance of 0.61 from a generated output to a training sample. the same evaluation considering the non-rephrased related model, i.e. mbart50-tf10, presented in figure 4c , resulted in a mean distance of 0.47. with the outputs generated from training inputs, the difference is even more drastic. the mean distance for the non-rephrased model is of 0.36 (fig. 4a ), while the model trained on rephrased sentences presents a mean distance of 0.90 (fig. 4b ). we can see in the latter a very clear peak towards the right side of the plot, evidence that memorization is not happening. another evidence of decrease in memorization was obtained by computing the number of distinct outputs using the same methodology used to produce ## final discussion the first main contribution of this work is to present a clear case of fine-tuning llms to many-to-one translators where high scores in metrics such as bleu can be misleading, since high values come, in fact, from a rogue strategy of retrieving verses stored from the training set. we also show that common symptoms of this problem are high standard deviations of the metrics (which, therefore, should be always reported), bimodal distributions of results, and low numbers of distinct outputs. we also present a method to compute how close the output is to translations identical to the output texts of the training sets which can also be used to identify the undesirable fine-tuning of translators into rogue retrievers of stored training data. the second contribution is to present a case where an llm, solely due to fine-tuning, was able to memorize complex parts of the outputs of the training set and reconstruct them with high accuracy. although memorization has been seen in the training of llms, we show here a case where there is reasonable evidence that it happened during the fine-tuning process with very low amounts of data. the third contribution is a method to reduce the memorization effect relying on rephasings of training samples. using 10 different versions of the bible in english, instead of identical output verses, we show that the model presents very low memorization levels together with improved translation quality and more diversity of outputs. although we did this study with real rephrasings, we notice that llm-generated rephrasings is a viable alternative when rephrasings are not available. evaluating how successful the use of commercial-grade, readily available llms is to avoid memorization issues in many-to-one scenarios is an important part of our future work. we also wonder if similar memorization issues may be present in some of previous research on multilingual translators for low-resource languages and, if so, whether they have compromised their findings. the belief that multilingual models are usually better than bilingual ones seems to be based on a reliance on averages of sample-level translation quality metrics which, as shown here, may hide the use of incorrect strategies. it seems essential not only that research in this area reports the standard deviation of all results but also that efforts are made to detect potential disguise of memorization strategies when fine-tuning llms, possibly by using some of the methods suggested in this paper. lastly, we believe the issues described in this paper are not exclusive to bibles and multilingual translations. in tasks such as fine-tuning conversation llms using question answering data from traditional chatbots, when several questions are mapped to the same answer, we might face similar issues. investigating that issue is outside the scope of this work but it is an interesting future direction. ## limitations the main limitation of this work is the use of the bible as the main source of data. not only it is limiting in terms of domain, it is also likely that this type of data was used in the pre-training of llms. also, the bible itself contains intrinsic repetitions of texts which can contribute to memorization. another limitation is the lack of a more in-depth analysis of the loss curves in the fine-tuning of the llms and not using the memorization-effect metric as a way to mitigate the memorization effects. that is, our proposed metric could be used as an alternative to model selection or early stopping. with that, we believe we could reduce the negative effects of memorization but the resulting impact on translation accuracy is unknown. ## ethical considerations it is essential to consider the ethical aspects of the goals and methods of any work with indigenous languages. first, we abide to the belief that the decision of whether to create or not a mt for an indigenous language has to be done by the people who speak the language, fully informed and, whenever possible, as a participant of the process @xcite @xcite . moreover, we understand the complex political and ideological choices involved in the process of language vitalization @xcite @xcite and the use technologies to support it @xcite . this was made clear by the indigenous communities in the los pinos declaration foot_9 , which enshrines that language-related efforts have be done by and with indigenous peoples: "nothing for us without us." however, the main goal of the research described in this paper is to determine technically feasible paths to construct mts given the restrictions imposed by extremely-low-resource languages to current technologies. therefore, even if the results of our work were extremely positive, we would refrain to make the mts available without express consent of the corresponding community. we are also aware that one of the unfortunate aspects of past and present colonial history of indigenous peoples is related to different forms of christianism. as a consequence, the bible is one of the most commonly found document translated to several of those languages, by jesuits in the early days of colonization and in the last 100 years often by evangelical churches @xcite . as such, the translations of the bible are often associated to different forms of cultural abuse and violence and to the establishment of orthographies of domination @xcite . however, the reality is that such texts are one of the few available sources of parallel multilingual datasets for many indigenous languages. we thus take the use of the bible in this work as an "exceptional" first step, as a sort of "toxic" data which should not be used, in principle, for any actually deployed system unless with explicit agreement of the indigenous community. nevertheless we believe such kind of data can be used carefully for inlaboratory technical experiments in well-contained contexts such as the study described in this paper. to mitigate some of those risks, we implemented in this study some of the protocols suggested in @xcite , including the adoption of containment procedures.