Towards User-Driven Neural Machine Translation (2021)

Abstract: A good translation should not only translate the original content semantically, but also incarnate personal traits of the original text. For a real-world neural machine translation (NMT) system, these user traits (e.g., topic preference, stylistic characteristics and expression habits) can be preserved in user behavior (e.g., historical inputs). However, current NMT systems marginally consider the user behavior due to: 1) the difficulty of modeling user portraits in zero-shot scenarios, and 2) the lack of user-behavior annotated parallel dataset. To fill this gap, we introduce a novel framework called user-driven NMT. Specifically, a cache-based module and a user-driven contrastive learning method are proposed to offer NMT the ability to capture potential user traits from their historical inputs under a zero-shot learning fashion. Furthermore, we contribute the first Chinese-English parallel corpus annotated with user behavior called UDT-Corpus. Experimental results confirm that the proposed user-driven NMT can generate user-specific translations.

## introduction in recent years, neural machine translation (nmt) models @xcite @xcite have shown promising quality and thus increasingly attracted users. when drawing on a translation system, every user has his own traits, including topic preference, stylistic characteristics, and expression habits, which can be implicitly embodied in their behavior, e.g., the historical inputs of these users. a good translation should implicitly mirror user traits rather than @xcite [polite, formal, gentle] merely translate the original content, as the example shown in figure 1 . however, current nmt models are mainly designed for the semantic transformation between the source and target sentences regardless of subtle traits with respect to user behavior. it can be said that the effect of user behavior on translation modeling is still far from utilization, which, to some extent, limits the applicability of nmt models in real-world scenarios. more recently, several studies have shown that the prominent signals in terms of personal characteristics can be served as inductive biases and reflected in translation results using domain adaptation approaches, such as personality @xcite , gender @xcite , and politeness @xcite . however, previously explored signals characterize users from a single dimension, which insufficiently represent fine-grained user traits. furthermore, @xcite pay their attention to personalized ted talk translation, in which they train a speakerspecific bias to revise the prediction distribution. in contrast with these studies, our work investigates a more realistic online scenario: a real-world mt system serves extensive users, where the user-behavior annotated data covering all users is unavailable. previous methods @xcite require the users in the training set and the test set to be consistent, therefore can not deal with this zero-shot issue. starting from this concern, we explore userdriven nmt that generates personalized translations for users unseen in the training dataset according to their behavior. specifically, we choose the historical inputs to represent user behavior since they can not only be easily obtained in the real-world scenarios, but also reflect the topic preference, stylistic characteristic, and context of user. moreover, compared with pre-defined or userspecific labels, historical inputs can be updated with current source sentences, which is also in line with realistic scenario. in this work, we propose a novel framework for this task, where the nmt model is equipped with a cache module to restore and update historical inputs. besides, in order to further transfer the traits from the seen users to the unseen ones, we design a regularization framework based on contrastive learning @xcite , which forces our model to decrease the divergence between translations of similar users while increasing the diversity on dissimilar users. in order to further train and assess the proposed framework, we construct a new user-driven machine translation dataset called udt-corpus. this corpus consists of 6,550 users with totally 57,639 chinese sentences collected from a realworld online mt system. among them, 17,099 chinese sentences are annotated with their english translations by linguistic experts according to the user-specific historical inputs. experimental results demonstrate that the proposed framework facilitates the translation quality, and exactly generates diverse translations for different users. to summarize, major contributions of our work are four-fold: ## related work this section mainly includes the related studies of personalized machine translation, cache-based nmt and contrastive learning for nmt. personalized machine translation recently, some researchers have employed domain adaptation @xcite @xcite to generate personalized translations. for example, @xcite show that the translation generated by the smt model has an adverse effect on the prediction of author personalities, demonstrating the necessity of personalized machine translation. furthermore, @xcite control the politeness in the translation by adding a politeness label on the source side. @xcite explore a gender-personalized smt system that retains the original gender traits. these domain labels represent users in single dimension separately, which are insufficient to distinguish large-scale users in a fine-grained way. the most correlated work to ours is @xcite which introduces a speaker-specific bias into the conventional nmt model. however, these methods are unable to deal with users unseen at the training time. different from them, user-driven nmt can generate personalized translations for these unseen users in a zero-shot manner. cache-based machine translation inspired by the great success of cache on language modeling @xcite @xcite , @xcite propose a cache-based adaptive smt system. tiedemann (2010) explore a cache-based translation model that fills the cache with bilingual phrase pairs extracted from previous sentence pairs in a document. @xcite use a cache mechanism to achieve online learning in phrase-based smt. gong et al. (2011), kuang et al. (2018), and tu et al. (2018 ) further exploit cache-based approaches to leverage contextual information for document-level machine translation. contrast with the documentlevel nmt that learns to capture contextual information, our study aims at modeling user traits, such as, topic preference, stylistic characteristics, and expression habits. moreover, historical inputs of user has relatively fewer dependencies than the contexts used in document-level translation. contrastive learning for nmt contrastive learning has been extensively applied in the communities of computer vision and natural language processing due to its effectiveness and generality on self-supervised learning @xcite @xcite . towards raising the ability of nmt in capturing global dependencies, @xcite first introduce contrastive learning into nmt, where the ground-truth translation and the model output are considered as the positive and contrastive samples, respectively. yang et al. (2019) construct contrastive examples by deleting words from ground-truth translation to reduce word omission errors in nmt. contrast to these studies, we employ contrastive learning to create broader learning signals for our user-driven nmt model, where the prediction distribution of translations with respect to similar users and dissimilar users are considered as positive and contrastive samples, respectively. thus, our model can better transfer the knowledge of the seen users to the unseen ones. ## user-driven translation dataset in order to build a user-driven nmt system, we construct a new dataset called udt-corpus containing 57,639 inputs of 6,550 users, 17,099 among them are chinese-to-english translation examples. ## user-driven nmt framework in this section, we first give a brief description about the problem formulation of user-driven nmt, and then introduce our proposed framework in detail. we choose transformer @xcite as the basic nmt model due to its competitive performance. in fact, our framework is transparent and applicable to other nmt models. figure 2 illustrates the basic framework of the proposed user-driven nmt. most typically, we equip the nmt model with two user-specific caches to exploit user behavior for better translation (see section § 4.2). besides, we augment the conventional nmt training objective with contrastive learning, which allows the model to learn translation diversity across users (see section § 4.3). ## experiments in this section, we carry out several groups of experiments to investigate the effectiveness of our proposed framework on udt-corpus. ## conclusion we propose user-driven nmt task, which aims to leverage user behavior to generate personalized translations. with the help of cache module and contrastive estimation, we successfully build an end-to-end nmt model that is able to capture potential user traits from their historical inputs and generate diverse translations under a zero-shot learning fashion. furthermore, we contribute udt-corpus, which is the first chinese-english parallel corpus annotated with user behavior. we expect our study can attract more attention towards this topic. it is a promising direction to explore other behavior in future, such as clickthrough and editing operations. moreover, following recent advancements in domain adaptation for nmt, we plan to further improve our model via adversial training based knowledge transfer @xcite @xcite and dual knowledge transfer @xcite .