{"id":483822,"date":"2018-05-07T08:30:49","date_gmt":"2018-05-07T15:30:49","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/research\/?p=483822"},"modified":"2018-05-07T08:30:49","modified_gmt":"2018-05-07T15:30:49","slug":"customized-neural-machine-translation-microsoft-translator","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/research\/blog\/customized-neural-machine-translation-microsoft-translator\/","title":{"rendered":"Customized neural machine translation with Microsoft Translator"},"content":{"rendered":"

\"\"<\/p>\n

Released in preview this week at Build 2018, the new Microsoft Translator custom feature lets users customize neural machine translation systems. These customizations can be applied to both text and speech translation workflows.<\/p>\n

Microsoft Translator released neural machine translation (NMT)<\/a> in 2016. NMT provided major advances in translation quality over the then industry-standard statistical machine translation (SMT) technology. Because NMT better captures the context of full sentences before translating them, it provides higher quality, more human-sounding and more fluent translations.<\/p>\n

There are limits to generic NMT models, however. Namely, they are not tuned to provide translations that are unique to a specific business or industry. However, it is too compute intensive, and therefore too expensive and slow, to retrain a new neural system from scratch for all languages and for every company or, even worse, for every product division within a company. Additionally, there is generally not enough parallel data available from the user to expect that the custom data alone would be sufficient to train a new good quality and appropriately adapted system.<\/p>\n

Customization is a critical component of high quality machine translations. Customization provides additional context to generic translation models so that translations can reflect a company\u2019s industry, tone and unique terminology.<\/p>\n

As a simple illustration, the word \u201ccheck\u201d could mean many different things in English depending on context: a bank check, a check engine light in your car, a check list or box, etc. The same English word will most likely not always translate into the same word in another language. By providing additional context, the new customization feature can better recognize and translate a bank processing \u201cchecks\u201d (pieces of paper) versus an auto manufacturer performing \u201cchecks\u201d (verifications).<\/p>\n

Of course, this is a simple example; generic NMT systems using the context of a sentence are generally sophisticated enough to resolve single word issues such as this. In the context of longer word sequences translation issues may become more apparent.<\/p>\n

Simple as the concept of customization may be, putting it into practice is complex.<\/p>\n

Customizing Neural Machine Translation models<\/h3>\n

To translate any word using a neural machine translation system, each word in a sentence is coded along a 500-dimensional vector representing its unique characteristics within a specific language pair (for example, English and Chinese). Based on the language pair used for training and the training data, the neural network will self-define what these dimensions represent. They could encode simple concepts like gender (feminine, masculine, neutral), politeness level (slang, casual, written, formal, and so on), type of word (verb, noun, and so on), but also any other non-obvious characteristics as derived from the training data. Once trained, the system encodes these words into higher dimensional vectors (1,000 dimensions) to embed both the word\u2019s representation and its context with the full sentence. To learn more about how Neural Machine Translation works, please check our How machine translation works<\/a> page.<\/p>\n

Because of the complexity of these systems, an NMT model will have more than 10 million unique parameters per language. Each of these parameters will be tuned during training before the system is deployed for users and developers to use. This training is not only extremely compute-intensive (days of training using multiple dedicated high-power GPUs), but requires amounts of parallel training data that are, in most cases, several orders of magnitude larger than what a typical enterprise will have access to. For this reason, simply retraining a new NMT from scratch for each new system based on customer\u2019s own data is not a technically or economically feasible option.<\/p>\n

How we do it\u2014the nuts and bolts of NMT customization<\/h3>\n

With careful design and research, using a combination of existing neural, hybrid neural and traditional as well as new techniques, we were able to build a customization feature that overcame these limitations to offer customers the possibility of creating translation models unique to their business and industry.<\/p>\n

The starting point is available training data from the user\u2019s own industry or company. To customize a system, a corpus of a minimum of 2,000 parallel sentences (human translated sentences in both the source and target language) is necessary. Working in partnership with Microsoft Translator key partners, and analyzing custom systems\u2019 quality on dozens of data sets, we found that the results are always better than generic NMT, with most of systems showing large quality improvements.<\/p>\n

Below are a few examples of BLEU score (an industry standard translation quality measure) improvements for various datasets size and content type. The improvement in quality over the default NMT system can vary from a few to more than 10 BLEU points.<\/p>\n

\"\"Before commencing training, the custom feature first preprocesses the data. For example, if versions of the same content in multiple languages in separate documents (for example, training manuals, web pages, leaflets) are the only content available, the custom feature will be able to automatically match sentences across documents to generate non-duplicated matched parallel training material. Also, if the user has monolingual data in either or both languages, this data can be used to complement the parallel data to improve the translation model.<\/p>\n

The first step the system performs is to start from the pre-existing model and to adapt the existing parameters using the new data. Conceptually, the system starts from the local minima of a general domain system (the best generic translation quality) and tunes it to the local minima relative to the custom data (the best translation quality for the user\u2019s data). From a compute perspective, using this approach has tremendous benefits. By training the custom system from an existing one, the training algorithms are starting from parameters that are already close to what they should be and include information about how to translate concepts that may be outside the small amount of data the user provides. Because of this, the computing power necessary to custom train represents less than 1% of the GPU computing power necessary if training were to start from a blank slate model.<\/p>\n

To further accelerate training, several variable learning rate techniques were tested, optimized and integrated into the process.<\/p>\n

Not only is this approach effective from a cost and duration perspective (a model can be customized in as little as a few hours on the GPU-powered Azure AI cloud), it still significantly improves translations for the given dataset.<\/p>\n

\"\"

Jonathan Clark, Principal Scientist at Microsoft Research<\/p><\/div>\n

\u201cThe key to custom training is having a good initializer for the neural network\u2019s parameters and careful, relentless management of the optimizer\u2019s learning rate,\u201d explains Jon Clark<\/a>, principal scientist on the Microsoft Translator team. \u201cTo make a golf analogy, by relying on our team-built systems as initializers, it\u2019s like we\u2019re already on the green and simply have to putt the ball into the hole with a thoughtful stroke.\u201d<\/p>\n

To further improve the custom translation quality, in addition to the neural network for translation that is optimized toward the user\u2019s data, the custom feature also builds a language model over both the user\u2019s parallel data and monolingual data. This further helps the system quickly learn and memorize key aspects of the customer\u2019s unique data.<\/p>\n

The resulting new model combines the breadth of the generic Translator NMT model with the unique terminology and tone of the customers parallel and monolingual data.<\/p>\n

How to use the Microsoft Translator custom feature<\/h3>\n

The Microsoft Translator custom feature is available now<\/a>. It can be used to customize neural text translations using the new Microsoft Translator V3 text API<\/a>. It can also be used to customize speech translation using the new preview of Cognitive Services Speech<\/a>. Both the V3 Text API and Cognitive Services Speech are available through the Azure portal<\/a> with paid and free subscriptions.<\/p>\n

The new custom portal can also be used to customize speech to text, and text to speech when used with the preview of Cognitive Services Speech. Learn more about these services<\/a>.<\/p>\n

Learn more:<\/h3>\n