Meta-Learning for Few-Shot NMT Adaptation (2020)

Abstract: We present META-MT, a meta-learning approach to adapt Neural Machine Translation (NMT) systems in a few-shot setting. META-MT provides a new approach to make NMT models easily adaptable to many target do- mains with the minimal amount of in-domain data. We frame the adaptation of NMT systems as a meta-learning problem, where we learn to adapt to new unseen domains based on simulated offline meta-training domain adaptation tasks. We evaluate the proposed meta-learning strategy on ten domains with general large scale NMT systems. We show that META-MT significantly outperforms classical domain adaptation when very few in- domain examples are available. Our experiments shows that META-MT can outperform classical fine-tuning by up to 2.5 BLEU points after seeing only 4, 000 translated words (300 parallel sentences).

## introduction neural machine translation (nmt) systems @xcite are usually trained on large general-domain parallel corpora to achieve state-of-the-art results @xcite . unfortunately, these generic corpora are often qualitatively different from the target domain of the translation system. moreover, nmt models trained on one domain tend to perform poorly when translating sentences in a significantly different domain @xcite . a widely used approach for adapting nmt is domain adaptation by fine-tuning @xcite @xcite , where a model is first trained on general-domain data and then adapted by continuing the training on a smaller amount of in-domain data. this approach often leads to empirical improvements in the targeted domain; however, it falls short when the amount of in-domain training data is insufficient, leading to model over-fitting and catastrophic forgetting, where adapting to a new domain leads to degradation on the general-domain @xcite . ideally, we would like to have a model that is easily adaptable to many target domains with minimal amount of in-domain data. we present a meta-learning approach that learns to adapt neural machine translation systems to new domains given only a small amount of training data in that domain. to achieve this, we simulate many domain adaptation tasks, on which we use a metalearning strategy to learn how to adapt. specifically, based on these simulations, our proposed approach, meta-mt (meta-learning for machine translation), learns model parameters that should generalize to future (real) adaptation tasks ( §3.1). at training time ( § 3.2), meta-mt simulates many small-data domain adaptation tasks from a large pool of data. using these tasks, meta-mt simulates what would happen after fine-tuning the model parameters to each such task. it then uses this information to compute parameter updates that will lead to efficient adaptation during deployment. we optimize this using the model agnostic meta-learning algorithm (maml) @xcite . the contribution of this paper is as follows: first, we propose a new approach that enables nmt systems to effectively adapt to a new domain using few-shots learning. second, we show what models and conditions enable meta-learning to be useful for nmt adaptation. finally, we evaluate meta-mt on ten different domains, showing the efficacy of our approach. to the best of our knowledge, this is the first work on adapting large scale nmt systems in a few-shot learning setup foot_0 . ## related work our goal for few-shot nmt adaptation is to adapt a pre-trained nmt model (e.g. trained on general domain data) to new domains (e.g. medical domain) with a small amount of training examples. @xcite surveyed several recent approaches that address the shortcomings of traditional fine-tuning when applied to domain adaptation. our work distinguishes itself from prior work by learning to fine-tune with tiny amounts of training examples. most recently, @xcite proposed a simple approach for adaptation in nmt. the approach consists of injecting task specific adapter layers into a pre-trained model. these adapters enable the model to adapt to new tasks as it introduces a bottleneck in the architecture that makes it easier to adapt. our approach uses a similar model architecture, however, instead of injecting a new adapter for each task separately, meta-mt uses a single adapter layer, and meta-learns a better initialization for this layer that can easily be fine-tuned to new domains with very few training examples. similar to our goal, michel and neubig (2018) proposed a space efficient approach to adaptation that learns domain specific biases to the output vocabulary. this enables large-scale personalization for nmt models when small amounts of data are available for a lot of different domains. however, this approach assumes that these domains are static and known at training time, while meta-mt can dynamically generalize to totally new domains, previously unseen at meta-training time. several approaches have been proposed for lightweight adaptation of nmt systems. @xcite introduced domain specific gates to control the contribution of hidden units feeding into the next layer. however, @xcite showed that this introduced a limited amount of per-domain capacity; in addition, the learned gates are not guaranteed to be easily adaptable to unseen domains. @xcite proposed a lattice search algorithm for nmt adaptation, however, this algorithm assumes access to lattices generated from a phrase based machine translation system. our meta-learning strategy mirrors that of @xcite in the low resource translation setting, as well as @xcite for cross-lingual named entity recognition with minimal resources, @xcite for low-resource natural language generation in task-oriented dialogue systems, and @xcite for low-resource natural language un-derstanding tasks. to the best of our knowledge, this is the first work using meta-learning for fewshot nmt adaptation. ## approach: meta-learning for few-shot nmt adaptation neural machine translation systems are not robust to domain shifts @xcite . it is a highly desirable characteristic of the system to be adaptive to any domain shift using weak supervision without degrading the performance on the general domain. this dynamic adaptation task can be viewed naturally as a learning-to-learn (metalearning) problem: how can we train a global model that is capable of using its previous experience in adaptation to learn to adapt faster to unseen domains? a particularly simple and effective strategy for adaptation is fine-tuning: the global model is adapted by training on in-domain data. one would hope to improve on such a strategy by decreasing the amount of required in-domain data. meta-mt takes into account information from previous adaptation tasks, and aims at learning how to update the global model parameters, so that the resulting learned parameters after meta-learning can be adapted faster and better to previously unseen domains via a weakly supervised fine-tuning approach on a tiny amount of data. our goal in this paper is to learn how to adapt a neural machine translation system from experience. the training procedure for meta-mt uses offline simulated adaptation problems to learn model parameters θ which can adapt faster to previously unseen domains. in this section, we describe meta-mt, first by describing how it operates at test time when applied to a new domain adaptation task ( §3.1), and then by describing how to train it using offline simulated adaptation tasks ( §3.2). ## experimental setup and results we seek to answer the following questions experimentally: we train and evaluate meta-mt on a collection of ten different datasets. all of these datasets are collected from the open parallel corpus (opus) @xcite , and are publicly available online. the datasets cover a variety of diverse domains that should enable us to evaluate our proposed approach. the datasets we consider are: we simulate the few-shot nmt adaptation scenarios by randomly sub-sampling these datasets with different sizes. we sample different data sets with sizes ranging from 4k to 64k training words (i.e. ∼ 200 to 3200 sentences). this data is the only data used for any given domain across all adaptation setups. it is worth noting that different datasets have a wide range of sentence lengths. we opted to sample using number of words instead of number of sentences to avoid introducing any advantages for domains with longer sentences. ## conclusion we presented meta-mt, a meta-learning approach for few shot nmt adaptation. we formulated few shot nmt adaptation as a meta-learning problem, and presented a strategy that learns better parameters for nmt systems that can be easily adapted to new domains. we validated the superiority of meta-mt to alternative domain adaptation approaches. meta-mt outperforms alternative strategies in most domains using only a small fraction of fine-tuning data.