Controlling Machine Translation for Multiple Attributes with Additive Interventions (2021)

Abstract: Fine-grained control of machine translation (MT) outputs along multiple attributes is critical for many modern MT applications and is a requirement for gaining users’ trust. A standard approach for exerting control in MT is to prepend the input with a special tag to signal the desired output attribute. Despite its simplicity, attribute tagging has several drawbacks: continuous values must be binned into discrete categories, which is unnatural for certain applications; interference between multiple tags is poorly understood. We address these problems by introducing vector-valued interventions which allow for fine-grained control over multiple attributes simultaneously via a weighted linear combination of the corresponding vectors. For some attributes, our approach even allows for fine-tuning a model trained without annotations to support such interventions. In experiments with three attributes (length, politeness and monotonicity) and two language pairs (English to German and Japanese) our models achieve better control over a wider range of tasks compared to tagging, and translation quality does not degrade when no control is requested. Finally, we demonstrate how to enable control in an already trained model after a relatively cheap fine-tuning stage.

## introduction some modern machine translation (mt) applications require fine-grained control along multiple attributes, and such mechanisms also increase the users' trust in scenarios when the system speaks on their behalf @xcite . for example, mt applications like video subtitling in streaming, video conferencing, online education and speech mt require that one can control the length and monotonicity of the translation, setting clear constraints on the output. in open-domain mt, it is unlikely that such constraints are known or can be inferred from the source to generate an appropriate translation. however, the uncertainty around the desired register, style or politeness level of the translation could be resolved by providing users with an explicit option to control such attributes. this in turns increases the mt system's trustworthiness by providing an explicit contract @xcite , formulated as "whenever there is an ambiguity, we enable users' agency". a standard method to exert control over mt outputs is the tagging approach, where an explicit token is prepended to the source sentence or output hypothesis to signal the desired attribute of the output @xcite @xcite . while such tags do enable certain level of control, discrete tags, by their nature, allow only for coarse-grained control and require that attributes with continuous values, like monotonicity or length ratio, are binned. for example, @xcite used only three tags to control translation length, which would arguably be too coarse for many practical applications. also, chaining multiple tags may become cumbersome and, more importantly, the interference between tags and the effect of their ordering have not yet been extensively studied. an additional desideratum for systems enabling attribute control is how efficiently they can be realized. for deployed mt engines, (re-)training a model for every attribute is unrealistic, due to the associated costs in time and computational power. therefore, having a light-weight intervention, materialized as a small number of tunable parameters, would considerably improve the practicality of attribute-enabled systems. in this paper we introduce additive vector-valued interventions which allow for fine-grained, combinable and fine-tunable control of translations, addressing all of the points above. we propose two implementations of vector-valued control: 1) one attribute embedding vector with the control direction and strength regulated by a multiplicative scalar factor, appropriate for continuous attributes, and 2) separate embedding vectors for each discrete attribute value, each with tunable multiplicative strengths. the attributes' embeddings are additively combined with the encoder's last layer representation and are used by a subset of the decoder layers through the source-attention mechanism. compared with the tagging approach, the control intervention residing in vector spaces has three advantages: 1) it avoids the coarse binning inherent to tagging and enables a more fine-grained, widerrange and precise control of translations, especially around bin boundaries. 2) it simplifies simultaneous control for multiple attributes via a linear combination of control interventions for each attribute, with control strength defined by multiplicative scaling factors. 3) for some attributes it allows for enhancing neural mt models trained without controllability via fine-tuning of intervention vectors. our contributions are as follows: ## related work the tagging approach for controlling translations has been used for multiple purposes: to indicate the target language in multilingual nmt @xcite ; to produce translations in more natural language by tagging data provenance, backtranslated or natural @xcite ; to control gender @xcite ; elaraby @xcite ; to indicate source domains in multi-domain nmt @xcite . closer to our applications, tags can control length @xcite , and formality of translations from english to german @xcite and to japanese @xcite , as well as from french to english @xcite . stergiadis et al. (2021) experimented with a pair of tags to control domain and provenance. closely related to controllable generation is work on monolingual style transfer: krishna et al. (2020), riley et al. (2021) and @xcite . in contrast to these papers, we use a classifier of the target side for labelling the controlling attribute. ## experiments we evaluate our control approach on two language pairs (english-to-german and english-to-japanese), and three different attributes (length, politeness and monotonicity of the generated translations). we verify the validity of the approach regarding the general translation quality and for each controlled attribute individually. we end this section with experiments on fine-tuning additive control models from pretrained baseline models that were trained without any attribute annotation. for reproducibility, we include setup details in §a.4. ## conclusions we propose a novel approach for controlling nmt system with respect to multiple attributes. this approach has several advantages: first, it uses interpretable additive interventions, where each attribute has a "control" subspace in latent space; second, it allows to control any subset of attributes while still generating good quality translations in the absence of any attribute intervention; third, it results in a more fine-grained and robust control of continuous attributes compared to the common tagging approach without the necessity of committing to a choice of buckets for continuous features; finally, it allows for a more efficient fine-tuning procedure where attribute control can be introduced by affecting a smaller subset of the original model parameters. we show-cased the flexibility of the approach by controlling length, politeness and monotonicity of generated translations from english into german and japanese. future directions of work include: 1) learning latent attribute embeddings in an unsupervised way, 2) application to other attributes like translation domain or target language in multi-lingual systems, 3) optimizing the finetuning to affect even less model parameters, 4) an investigation of which attributes are "easier" and "harder" to learn. linear warm-up and square-root decay afterwards. we used the default adam optimizer and a dropout rate of 0.1. for en ⇒ de we trained for a minimum of 100k steps and after that used early stopping, evaluating every 10k steps, on the dev's set bleu score with a patience of 5; results were evaluated on the best checkpoint for the dev set. for en ⇒ ja we used a patience of 10 and we used two separate embeddings on top of the separate bpe vocabularies following the configuration reported in @xcite . for en ⇒ de we used beam search with beam size 4 and lengthpenalty 0.6. for en ⇒ ja we used beam search with beam size 10 and length-penalty 0.9; these parameters having been fine-tuned for the base on the dev set. we were unable to replicate the performance score of 18.8 for the base model in @xcite even though the improvements we saw for controlling politeness are consistent with their results. we conjecture these might be due to a mismatch of some model configuration or to a different setup for evaluating the bleu score.