Réduction des répétitions dans la Traduction Automatique Neuronale (2024)

Abstract: Actuellement, de nombreux systèmes TAL utilisent des décodeurs neuronaux pour la génération de textes, qui font preuve d’une capacité impressionnante à générer des textes approchant les niveaux de fluidité humaine. Toutefois, dans le cas des réseaux de traduction automatique, ils sont souvent confrontés à la production de contenu répétitif, également connu sous le nom de diction répétitive ou de répétition de mots, un aspect pour lequel ils n’ont pas été explicitement entraînés. Bien que cela ne soit pas intrinsèquement négatif, cette répétition peut rendre l’écriture monotone ou maladroite si elle n’est pas utilisée intentionnellement pour l’emphase ou des fins stylistiques. La répétition de mots a été traitée par des méthodes post-hoc pendant l’inférence, contraignant le réseau à examiner des hypothèses auxquelles le système avait initialement attribué une plus faible probabilité. Dans cet article, nous implémentons une méthode qui consiste à pénaliser les répétitions lors de l’apprentissage et qui s’inspire des principes du label smoothing. Conformément à cette méthode, nous modifions la distribution de la vérité terrain afin d’orienter le modèle de manière à décourager ces répétitions. Les résultats de nos expériences montrent que les méthodes proposées permettent de contrôler le problème de la répétition dans les moteurs neuronaux de traduction automatique sans compromis en termes d’efficacité ou de qualité des traductions.

## introduction this study addresses the issue of word repetition in machine translation, which involves the repeated occurrence of words, phrases, or ideas throughout the translation process. more specifically, we focus on repetitions that typically occur when translating synonyms or semantically equivalent phrases found in the source sentence. these repetitions lead to diminished readability of the text, potentially causing boredom or confusion for the reader and creating the perception of verbose or awkward writing. consider, for instance, the following french sentence : in neural machine translation, repetition often arises when the model faces input sentences containing synonyms, leading these synonymous terms to be translated into identical words. although lacking numerical support for our observation, the repetition issue becomes more salient when utilizing a model trained across multiple domains, highlighting the dearth of lexical diversity. we attribute this phenomenon to a lack of diversity in the decoder module. although this type of repetition may occur with low frequency, it is highly concerning as it vividly illustrates the lack of fluency in translations. however, repetitions do not always have a negative impact on readability. without aiming to be exhaustive : i) repetitions play a role when summarizing information or reinforcing a concept ; ii) common expressions are formed using word repetitions, and altering them to eliminate repetition would alter their intended meaning ; iii) in highly specialized domains, expressions convey precise meanings that disallow being reformulated. the following examples illustrate these observations : i) once closed, the door stays closed ii) over and over ; to be or not to be ; step by step iii) the congenital muscular dystrophy in newborns presenting with muscular hypotonia as previously introduced, finding suitable alternatives without altering the meaning of a sentence can be a challenging task. in this work, we propose a method applied in training designed to teach the model to discourage certain repetitions, thereby alleviating the need for difficult decisions during inference. next, we summarize the main contributions of this work : repetitions can manifest in various forms, including single words, phrases, and larger segments of content. however, this work concentrates on repetitions manifested through the repetition of linguistic words, which are more commonly observed in machine translations. note that linguistic words are typically decomposed into multiple tokens as taken into account by neural networks. ## related work the fluency levels achieved by llms are widely acknowledged to be high, primarily owing to the extensive availability of monolingual datasets, which surpasses that of standard neural machine translation (nmt) models trained solely on parallel texts. to the best of our knowledge, no dedicated research has been conducted on addressing the repetition issue tackled in this work within nmt systems. closely related, @xcite describe a method to train neural language models that in addition to maximizing likelihood to model the overall sequence probability distribution, also includes an unlikelihood term in the loss function to correct known biases such as repeated tokens. (li et al., 2020) use the same approach to control copy effect and repetitions observed in dialogue tasks. @xcite present a contrastive solution to encourage diversity while maintaining coherence in the generated text. various studies have addressed diversity in neural mt systems, which is a closely related topic. sampling predictions from the output distribution can be an effective decoding strategy for backtranslation, as described by @xcite , or sampling from less likely tokens @xcite . results show that such techniques enlarge diversity and richness of the generated translations when compared to data generated by beam or greedy search, but introduce semantic inconsistency in translations. in @xcite is proposed a multi-candidate optimization framework for augmenting diversity. the authors propose to guide an nmt model to learn more diverse translations from its candidate translations based on reinforcement learning. during training, the model generates multiple candidate translations, of which rewards are quantified according to their diversity and quality. a different approach attempts to condition the decoding procedure with diverse signals. typically, (shu et al., 2019) use syntactic codes to condition the translation process. (lachaux et al., 2020) replace the syntactic codes with latent domain variables derived from target sentences. similarly, (schioppa et al., 2021) use prefix-based control tokens and vector-based interventions for controlling output translations from a nmt system. in the context of paraphrase generation (vahtola et al., 2023) propose a translation-based guided paraphrase generation model that learns useful features for promoting surface form variation in generated paraphrases. ## adjusting the ground-truth distribution throughout the training process, at every time-step t, neural machine translation networks generate predictions over the target-side vocabulary based on the input x and previous predictions @xmath0: for the ground-truth @xmath1.'. rows t and r represent respectively the time-step and the corresponding ground-truth token. a reduced model vocabulary (matrix rows) is used to facilitate reading. note that the vector q t is a one-hot encoding representation of r t , with all entries set to 0 except for the token indicated by r t , which is set to 1. addressing the over-fitting risk illustrated by the previous q t distribution, label smoothing @xcite (ls) is widely employed to achieve a smoother distribution : with ϵ being a commonly small hyper-parameter. 2 ls can be interpreted as penalizing the probability of the ground-truth class by a factor of 1ϵ, while evenly distributing the removed probability mass among all classes, ϵ/v . building upon a strategy akin to label smoothing, we make additional adjustments to the ground-truth distribution and reduce the likelihood of repeated tokens, with the goal of enabling the model to learn to predict repetitions with lower probability. we introduce a matrix, denoted as m v ×t , which indicates whether the ground-truth token r t is also present in the preceding time-steps. foot_2 figure 1 illustrates an example of matrix m with ground-truth i like cookies and cookies. as translation of the french sentence j'aime les cookies et les biscuits. with a model vocabulary of 5 tokens (matrix rows). both french terms cookies and biscuits are correctly translated into english as cookies, yet this choice clearly reduces the fluency and clarity of the translation. as it can be seen, only m [@xmath2,@xmath3. we consequently update the ground-truth distribution following : where α is a hyper-parameter, and αm is used as a penalty, much like ϵ in the case of ls. note that only the label smoothing probabilities discounted are distributed among all classes. as a result, time-steps with repeated tokens (such as @xmath4, as their sum does not add to 1. figure 2 illustrates ground-truth distributions for our example at time-step @xmath5: the original one-hot encoding q ; the original distribution adjusted using label smoothing q ϵls , and further adjusted using repetitions q ϵlsαm . 4 a significant challenge with the aforementioned techniques that modify q distribution with repetitions is their limited impact on the training process, primarily caused by the scarcity of repeated tokens in datasets. in the following section, we present alternative approaches to address this challenge. ## gathering examples with repetitions as previously depicted, our intention is to instruct the model to minimize certain repetitions while preserving others deemed necessary for an accurate translation. to achieve this, we must compile a relatively large dataset of examples that demonstrate this behavior to the model. we initially focus on repetitions of content words such as nouns, adjectives, verbs, and adverbs. function words, which serve a distinct grammatical role in a sentence, are excluded from this analysis. current mt networks reliably generate these words based on their understanding of grammatical correctness. given that training corpora contain a relatively small number of repetitions, and these are manually curated, often comprising only acceptable repetitions, we opt to focus solely on repetitions found in machine translations. accordingly, we translate the source sentences (src) of our training examples to generate synthetic translations (hyp). repetitions that detrimentally impact fluency are only considered if they appear in such translation. identifying examples containing repetitions following the previous morpho-syntactic patterns is straightforward. however, the challenge lies in discerning which repetitions degrade the fluency of translations and which do not. we follow the next filtering steps to select repetitions degrading fluency : degrading acceptable src the home was modest and frugal i want to know what you mean hyp la maison était modeste et modeste je veux savoir ce que tu veux dire tgt la maison était modeste et économe je veux savoir ce que tu veux dire the same previous rationale remains consistent, now encompassing examples of common expressions that necessitate word repetitions. the resulting set of examples with repetitions from src/hyp training pairs will be regarded as instances that the model needs to learn to discourage. consequently, we utilize them for training after annotating the repeated words in their respective m matrices. the repeated word on the left-side example is the french adjective modeste while the verb veux is repeated in the right-side example. once word alignments are computed between synthetic translations and their respective source and target sentences, the example on the right is not classified as a repetition degrading fluency. this is because both instances of veux are aligned with repeated words in the target reference translation, suggesting that the repetition is motivated. concerning the example on the left side, neither the source nor the reference target sentences contain repeated words, suggesting that the repetition stems from a lack of diversity when translating modest and frugal, thus hindering fluency. we employ the left-side example to train the model to identify it as a repetition to be avoided. the corresponding matrix m marks the second occurrence of the word modeste with a 1, thereby incurring in a significant loss if the model predicts it with high probability. the example on the right is used without penalization, thus instructing the model to reproduce the repetition. it's worth noting that the presented approach does not require any alterations to the network architecture and maintains the same training and inference efficiency. ## experimental framework we evaluate the proposed methods in an english-to-french translation task. thus, we utilize english-french parallel corpora freely obtained from the opus website 6 . we strive for balanced utilization across various domains and ensure the inclusion of clean parallel data whenever possible. due to the extensive volume of french-english parallel sentences accessible we randomly choose a subset exceeding 7 million examples that we employ as training set. for testing, we make use of english-french news-test (2008 to 2013) datasets made available 6. http://opus.nlpl.eu we translate the english side of the training and repetition-test sets following the procedure detailed in section 4 to identify repetitions which hinder fluency (degrading) and those which do not (acceptable ). our nmt model is built using an in-house implementation of the state-of-the-art transformer architecture @xcite . details of the network and training work are given in appendix b. ## results and analysis to evaluate the methods presented in this paper we consider the previous baseline model that we update with 15k additional iterations for two different configurations of the ground-truth distribution : note that for both configurations, we use 7.6m reference sentence pairs detailed in configuration beam employs the baseline model and performs inference following two strategies to reduce repetitions and improve diversity : we also assess the effectiveness of two large language models (llm) with translation capabilities to overcome the repetition issue : gp t 3.5 consists of the gpt3.5-turbo version of the openai llm. built upon the generative pre-trained transformer architecture @xcite which employs only a transformer decoder. following an auto-regressive approach, the model ensures that the generated text maintains coherence and relevance to the context provided by the input text. translations are conducted using the openai api, while emphasizing the importance of minimizing word repetitions through the provided prompt 10 . n llb is a family of machine translation models based on the transformer encoder-decoder architecture, enabling translation between any of the 202 language varieties @xcite . we use the nllb-200-distilled-600m 11 version and perform translations with the efficient ctranslate2 12 inference toolkit. to evaluate the presented methods, we report bleu and comet results computed by sacrebleu 13 @xcite and comet-score 14 (rei et al., 2020) respectively over both test sets. concerning repetitiontest, we also report the number of word repetitions that hinder fluency, degrading, and those deemed acceptable, acceptable, measured in translation hypotheses. regarding inference-based configurations, beam with β = 0 effectively eliminates all repetitions but at the expense of a notable decrease in translation quality, in the case of @xmath6. results from both llms demonstrate a reduced number of repetitions, suggesting an elevated level of diversity and fluency of such models. however, the translation quality scores of llms do not align with those achieved by the models presented in this study in either of the test sets, especially translations obtained by gpt-3.5. these findings are consistent with those presented by @xcite where the authors note the challenge of controlling translations performed by bloom foot_3 , a multilingual llm. ## conclusions and further work we have introduced a method to reduce the occurrence of repetitions in translation hypotheses, which significantly affects the readability of the generated texts. additionally, we have proposed a straightforward approach to identify repetitions in machine translations that detract from fluency. the method is solely implemented during fine-tuning at the conclusion of the training phase, without any modifications to the inference process. experiments indicate the ability of our proposed methods in reducing the repetition problem. additional experiments are necessary to confirm the applicability of the proposed methods across various language pairs and dataset conditions. we aim to further study the impact of the ratio between the number of reference sentences and synthetic translations that include repetitions during the training process. additionally, we plan to analyze the influence of the distance (measured in number of words) between repetitions and explore the possibility of replacing the binary penalty in matrix m with a softer approach.