What is mT5? Google AI Open-source Multilingual Model Trained Over 101 Languages

  • Neelam Tyagi
  • Nov 12, 2020
  • Artificial Intelligence
  • NLP
What is mT5? Google AI Open-source Multilingual Model Trained Over 101 Languages title banner

From Google Open Source, Google believes that open source is good for everyone. By being open and freely available, it enables and encourages collaboration and the development of technology, solving real-world problems. 


Google has launched a model, named mT5, a multilingual model of Google’s T5 model. The massively pre-trained multilingual model has schemed in the research paper “mT5: A massively multilingual pre-trained text-to-text transformer” and is presented by the group of researchers/ authors including Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. 


In the course of this blog, a glimpse into the mT5, a multilingual language model, is pitched. Further, starting from explaining natural language processing briefly, the blog will explain the notion and specification of mT5, and comparison amidst various language models. 


Briefing Natural Language Processing


Basically, Natural Language Processing, or NLP, is the branch of Artificial Intelligence that enables the machine to read, understand, learn and drive meaning from human language. It works as the communicating medium among machine and human natural language, incorporating computers (machines) programming to successfully interpret diverse natural language.


“Apart from common word processor operations that treat text as a mere sequence of symbols, NLP considers the hierarchical structure of language: several words make a phrase, several phrases make a sentence and, ultimately, sentences convey ideas,” John Rehling, an NLP expert at Meltwater Group


Despite the complexity of diverse language data provided, NLP is broadly adopted for the various tasks involving sentiment analysis, spam detection in emails, voice-driven interfaces, healthcare data analysis, identifying fake news, virtual assistants, chatbots,  etc.


Specifying its applicability for language models, some existing NLP pipelines often adopt transfer learning where a model gets pre-trained across an extreme data-rich task before getting tweaked on a downstream task of interest. 


A Short Overview to T5 and C4


T5 is the pre-trained language model that deploys a consolidated “text-to-text” format for all text-based NLP issues. Having a customized approach for generative tasks, like machine translation or abstractive summarization, where the formatting of tasks demands the models for producing text practised on some input.  


Sometimes it is highly remarkable for the fundamental tasks such as classification problems, in those conditions T5 is trained to yield the output of the authentic text of the label, for example, positive or negative for sentiment analysis, in place of the class index. Its advantage includes allowing the implementation of accurately the same training objective as the teacher-forced maximum-likelihood for each task, i.e, a specific set of hyperparameters could be employed for efficiently fine adjustment on any downstream task.


T5 gets pre-trained over a masked language modelling, called “span-corruption” objective, where continuous measures of input tokens are substituted with a mask token, and after that, the model is trained to reproduce the masked tokens out. In addition to that, T5 embraces a distinctive factor that is its “scale”, along with the pre-trained sizes of models available from 60 million to 11 billion parameters. However, these models were pre-trained across 1 trillion data tokens.


For the training of models, unlabeled data originates from the C4 dataset, it the huge accumulation of about 750GB of English-language text derived from the public Common Crawl web scrape. C4 incorporates examining and extricating natural language only along with comprehensive deduplication. 


What is Google Open Source mT5?


With the aim to produce mT5 as a massively multilingual model that diverges as low as possible from the recipe adopted for creating T5.


The mT5 is a multilingual variant of Google’s T5 model that was pre-trained over a dataset of more than 101 languages and contains between 300 million and 13 billion parameters. The architecture and training of the model followed for mT5 closely emulates that of T5. This AI model contributes various sorts of information amid identical languages that favour low-resource languages and concedes for zero-shot language processing.  


As the models expand in size, the necessity of extensive dataset, that can be arduous and hard to prepare, is demanded by models, and motivated researchers to concentrate on web-scraped material.


As expressed by the Google researcher in a paper describing mT5, “at its entirety, our outcomes reflect the significance and necessity of model capacity for cross-lingual representation understanding and recommend that scaling up an easy pretraining recipe could be a workable option depending upon... … filtering, parallel data, or intermediate tasks, however, we explained the T5 recipe is precisely applied to the multilingual setting, and a strong SOTA performance could be obtained over a varied set of benchmarks.”


According to Google, the biggest model mT5 contains 13 billion parameters, has topped every benchmark tested corresponding to it as of October 2020. To validate the performance of the model, the model is examined on six tasks from the Xtreme multilingual benchmark, i.e.;


  • The XNLI entailment task embracing14 languages,

  • The XQuAD, MLQA, and TyDi QA reading comprehension benchmarks with 10, 7, and 11 languages respectively; 

  • The Named Entity Recognition (NER) dataset of WikiAnn with the 40 languages from Xtreme, and 

  • The PAWS-X  paraphrase identification dataset with 7 languages.


Specification of mT5


The specification of the mT5 are discussed below;


  • In terms with Google claims,  the model has attained the state-of-the-art outcomes over a broad range of English natural processing tasks.

  • The fundamental aim of the model includes constructing a model that is able to understand more than 7000 languages across the world. 

  • The model mT5 was trained on mC4 which is a subset of C4 that contains an assemblage of around 750GB of the text of English language and sourced from the public Common Crawl repository. While explicitly-designed C4 dataset for English only, mC4 includes 107 languages along with 10,000 and more web pages over 71 monthly scrapes till date.

  • While Google researchers have tried to decrease the bias in mT5 by relocating lines in mC4 documents and refined out pages containing a wrong set of words. Also, they have identified the primary language of each page via a tool and eliminate the pages where the confidence is lower than 70%.


The Approach Used


While pre-training multilingual models, one of the significant factor is how to sample data from every language, and for that one of the choices is a zero-sum game, i.e., if low-resource languages are sampled excessively, the model may get overfit, and if the high-resource languages are not trained excessively, then the model will underfit.  


Therefore the approach used for enhancing the low-resource languages by sampling examples in terms of the probability, the formula is p(L) ∝ |L| α, where p(L) is the probability of sampling text out of a language provided at pre-training and |L| denotes the number of examples in the language. The hyperparameter α (typically with α < 1) permits us to regulate how much to enhance the probability of training on low-resource languages. 


Comparison With Similar Language Models


In order to inspect mT5 model, a brief comparison with existing heavily multilingual pre-trained language models is presented; also the models, that support more than a few dozen languages, are considered for compactness. The short glimpse of a high-level comparison of mT5 is provided in the image below;  

The image is highlighting the high comparison of mT5 with similar models.

Comparison of mT5 to existing massively multilingual pre-trained language models, image source

  1. mBERT, a multilingual version of BERT, mBERT adopts the BERT recipe as strictly as possible in terms of the same architecture, objective, etc., but the main difference is the training set. Rather than get trained on English Wikipedia and the Toronto Books Corpus, mBERT is trained over 104 languages from Wikipedia. 


  1. XLM is again dependent on BERT and involves enhanced methods for pre-training multilingual language models. Instead of various released variants of pre-trained versions of XLM, the most massively-multilingual variant was trained upon 100 languages taken from Wikipedia. 


  1. XLM-R is the latest and an improved version of XLM which relies on the RoBERTa model. XLM-R is trained, with a cross-lingual masked language modelling purpose, over the dataset of 100 languages from Common Crawl. In order to boost the essence of the pre-training data, first, an n-gram language model is trained on Wikipedia and then a page from Common Crawl is maintained only if it is specified with a large likelihood by the n-gram model. 


  1. mBART is a multilingual encoder-decoder model based on BART. mBART is trained, with an aggregation of extent masking and sentence rearranging goals, across a subset of 25 languages from the same data as XLM-R. 


  1. MARGE is a multilingual encoder-decoder model trained to build a document in one language via recapturing documents in distinct languages. However, it accepts data in 26 languages from Wikipedia and CC-News.




In conclusion, we can say that the mT5 is the massively pre-trained multilingual language model that is trained over a common crawl-based dataset of 101 languages. It is the multilingual variant of Google’s T5 model. You have seen in the blog a short explanation of Natural Language Processing is provided. 


“We want to help open-source projects and communities be successful and sustainable.”-Jen Phillips, Program Manager


Starting from a brief description over Google’s T5 model and C4 dataset to describing in detail about the Google Open Source mT5 model, its specification and approach used along with the high-level comparison of mT5 with other massively trained languages models are summarized.