We discuss two core models for addressing sequence labeling problems and describe, for each, training them in a single-model multilingual setting: (1) the Meta-LSTM BIBREF0 , an extremely strong baseline for our tasks, and (2) a multilingual BERT-based model BIBREF1 .The Meta-LSTM is the best-performing model of the CoNLL 2018 Shared Task BIBREF2 for universal part-of-speech tagging and morphological features. The model is composed of 3 LSTMs: a character-BiLSTM, a word-BiLSTM and a single joint BiLSTM which takes the output of the character and word-BiLSTMs as input. The entire model structure is referred to as Meta-LSTM.To set up multilingual Meta-LSTM training, we take the union of all the word embeddings from the bojanowski2017enriching embeddings model on Wikipedia in all languages. For out-of-vocabulary words, a special unknown token is used in place of the word.The model is then trained as usual with cross-entropy loss. The char-BiLSTM and word-biLSTM are first trained independently. And finally we train the entire Meta-LSTM.BERT is a transformer-based model BIBREF3 pretrained with a masked-LM task on millions of words of text. In this paper our BERT-based experiments make use of the cased multilingual BERT model available on GitHub and pretrained on 104 languages.Models fine-tuned on top of BERT models achieve state-of-the-art results on a variety of benchmark and real-world tasks.To train a multilingual BERT model for our sequence prediction tasks, we add a softmax layer on top of the the first wordpiece BIBREF4 of each token and finetune on data from all languages combined. During training, we concatenate examples from all treebanks and randomly shuffle the examples.The results in Table TABREF1 make it clear that the BERT-based model for each task is a solid win over a Meta-LSTM model in both the per-language and multilingual settings. However, the number of parameters of the BERT model is very large (179M parameters), making deploying memory intensive and inference slow: 230ms on an Intel Xeon CPU. Our goal is to produce a model fast enough to run on a single CPU while maintaining the modeling capability of the large model on our tasks.We choose a three-layer BERT, we call MiniBERT, that has the same number of layers as the Meta-LSTM and has fewer embedding parameters and hidden units than both models. Table TABREF7 shows the parameters of each model. The Meta-LSTM has the largest number of parameters dominated by the large embeddings. BERT's parameters are mostly in the hidden units. The MiniBERT has the fewest total parameters.The inference-speed bottleneck for Meta-LSTM is the sequential character-LSTM-unrolling and for BERT is the large feedforward layers and attention computation that has time complexity quadratic to the sequence length. Table TABREF8 compares the model speeds.BERT is much slower than both MetaLSTM and MiniBERT on CPU. However, it is faster than Meta-LSTM on GPU due to the parallel computation of the transformer. The MiniBERT is significantly faster than the other models on both GPU and CPU.For model distillation BIBREF6 , we extract sentences from Wikipedia in languages for which public multilingual is pretrained. For each sentence, we use the open-source BERT wordpiece tokenizer BIBREF4 , BIBREF1 and compute cross-entropy loss for each wordpiece: INLINEFORM0 where INLINEFORM0 is the cross-entropy function, INLINEFORM1 is the softmax function, INLINEFORM2 is the BERT model's logit of the current wordpiece, INLINEFORM3 is the small BERT model's logits and INLINEFORM4 is a temperature hyperparameter, explained in Section SECREF11 .To train the distilled multilingual model mMiniBERT, we first use the distillation loss above to train the student from scratch using the teacher's logits on unlabeled data. Afterwards, we finetune the student model on the labeled data the teacher is trained on.We use universal part-of-speech tagging and morphology data from the The CoNLL 2018 Shared Task BIBREF7 , BIBREF8 . For comparison simplicity, we remove the languages that the multilingual BERT public checkpoint is not pretrained on.For segmentation, we use a baseline segmenter (UDPipe v2.2) provided by the shared task organizer to segment raw text. We train and tune the models on gold-segmented data and apply the segmenter on the raw test of test data before applying our models.The part-of-speech tagging task has 17 labels for all languages. For morphology, we treat each morphological group as a class and union all classes as a output of 18334 labels.For Meta-LSTM, we use the public repository's hyperparameters.Following devlin2019, we use a smaller learning rate of 3e-5 for fine-tuning and a larger learning rate of 1e-4 when training from scratch and during distillation. Training batch size is set to 16 for finetuning and 256 for distillation.For distillation, we try temperatures INLINEFORM0 and use the teacher-student accuracy for evaluation. We observe BERT is very confident on its predictions, and using a large temperature INLINEFORM1 to soften the distribution consistently yields the best result.We compare per-language models trained on single language treebanks with multilingual models in Table TABREF1 and Table TABREF14 . In the experimental results we use a prefix INLINEFORM0 to denote the model is a single multilingual model. We compare Meta-LSTM, BERT, and MiniBERT.mBERT performs the best among all multilingual models. The smallest and fastest model, mMiniBERT, performs comparably to mBERT, and outperforms mMeta-LSTM, a state-of-the-art model for this task.When comparing with per-language models, the multilingual models have lower F1. DBLP:journals/corr/abs-1904-02099 shows similar results. Meta-LSTM, when trained in a multilingual fashion, has bigger drops than BERT in general. Most of the Meta-LSTM drop is due to the character-LSTM, which drops by more than 4 points F1.We pick languages with fewer than 500 training examples to investigate the performance of low-resource languages: Tamil (ta), Marathi (mr), Belarusian (be), Lithuanian (lt), Armenian (hy), Kazakh (kk). Table TABREF15 shows the performance of the models.While DBLP:journals/corr/abs-1904-09077 shows effective zero-shot crosslingual transfer from English to other high-resource languages, we show that cross-lingual transfer is even effective on low-resource languages when we train on all languages as mBERT is significantly better than BERT when we have fewer than 50 examples. In these cases, the mMiniBERT distilled from the multilingual mBERT yields results better than training individual BERT models. The gains becomes less significant when we have more training data.The multilingual baseline mMeta-LSTM does not do well on low-resource languages. On the contrary, mMiniBERT performs well and outperforms the state-of-the-art Meta-LSTM on the POS tagging task and on four out of size languages of the Morphology task.We use the Universal Dependencies' Hindi-English codemixed data set BIBREF9 to test the model's ability to label code-mixed data. This dataset is based on code-switching tweets of Hindi and English multilingual speakers. We use the Devanagari script provided by the data set as input tokens.In the Universal Dependency labeling guidelines, code-switched or foreign-word tokens are labeled as X along with other tokens that cannot be labeled. The trained model learns to partition the languages in a codemixed input by labeling tokens in one language with X, and tokens in the other language with any of the other POS tags. It turns out that the 2nd-most likely label is usually the correct label in this case; we evaluate on this label when the 1-best is X.Table TABREF25 shows that all multilingual models handle codemixed data reasonably well without supervised codemixed traininig data.We have described the benefits of multilingual models over models trained on a single language for a single task, and have shown that it is possible to resolve a major concern of deploying large BERT-based models by distilling our multilingual model into one that maintains the quality wins with performance fast enough to run on a single CPU. Our distilled model outperforms a multilingual version of a very strong baseline model, and for most languages yields comparable or better performance to a large BERT model.We use exactly the same hyperparameters as the public multilingual BERT for finetuning our models. We train the part-of-speech tagging task for 10 epochs and the morphology task for 50 epochs.For distillation, we use the following hyperparameters for all tasks.learning rate: 1e-4temperature: 3batch size: 256num epochs: 24We take the Wikipedia pretraining data as is and drop sentences with fewer than 10 characters.We use the vocab and wordpiece model included with the cased public multilingual model on GitHub.We use the BERT configuration of the public multilingual BERT with the following modifications for mMiniBERT.Hidden size = 256Intermediate layer size = 1024Num attention heads = 4Layers = 3To understand the importance of distillation in training mMiniBERT, we compare it to a model with the MiniBERT structure trained from scratch using only labeled multilingual data the teacher is trained on. Table TABREF37 shows that distillation plays an important role in closing the accuracy gap between teacher and student.We show per-language F1 results of each model in Table SECREF38 and Table SECREF38 . For per-language models, no models are trained for treebanks without tuning data, and metrics of those languages are not reported. All macro-averaged results reported exclude those languages.lccccc treebankBERTMeta-LSTMmBERT mMeta-LSTM mMiniBERTaf_afribooms97.6297.6397.4993.1696.08am_att3.285.63.16ar_padt90.4690.5590.328990.06ar_pud71.5968.9671.06be_hse94.8191.0595.0287.5994.95bg_btb99.0198.7798.7296.4398.19ca_ancora98.8498.6298.7797.5798.45cs_cac99.1799.4399.398.4698.48cs_cltt87.4887.2587.6787.6287.53cs_fictree98.6298.6398.2597.297.18cs_pdt99.0699.0798.9998.2298.61cs_pud97.1396.5397da_ddt97.5997.4797.1892.3695.93de_gsd94.8194.1794.5391.9493.82de_pud88.7687.4288.7el_gdt97.9797.497.9194.8797.16en_ewt95.8295.4595.292.2494.19en_gum96.2295.0294.7992.3394.24en_lines97.2296.8195.7993.9695.25en_partut96.1195.995.0293.2994.61es_ancora98.8798.7898.1796.2797.8es_gsd93.793.989.6590.6189.58es_pud85.8786.185.71et_edt97.2797.1797.0294.3295.64eu_bdt96.296.195.5191.5394.15fa_seraji97.5797.1797.1795.2996.92fi_ftb96.2696.1293.1587.2389.79fi_pud95.5593.2395.01fi_tdt96.8197.0293.991.5892.6fr_gsd96.6296.4596.2395.3796.05fr_partut96.189695.4394.3594.93fr_pud90.7790.190.64fr_sequoia96.7797.5997.0795.9196.75fr_spoken97.5595.7896.190.0793.25ga_idt91.9291.5590.8384.1685.72gl_ctg96.9997.2196.592.8795.84gl_treegal93.491.2891.9he_htb82.7682.4982.6980.9381.93hi_hdtb97.3197.3997.196.296.43hi_pud86.4885.3385.68hr_set97.7997.9497.4796.2497.2hu_szeged96.5194.7195.9985.595.47hy_armtdp84.4286.6263.8286.98id_gsd93.0693.3793.390.8193.35id_pud63.5263.563.33it_isdt98.3398.0698.2796.797.8it_partut98.1298.1798.0996.9998.06it_postwita95.6695.8695.694.1793.2it_pud93.8492.7293.67ja_gsd88.6388.7388.5487.0388.43ja_modern41.5551.2621.61ja_pud89.1587.9689.3kk_ktb75.9361.781.3652.9180.06ko_gsd95.9295.6490.386.3988.62ko_kaist95.5695.4293.8687.4693.43ko_pud41.9346.1131.96la_ittb98.3498.4298.397.1897.65la_perseus89.9183.8585.23la_proiel96.3496.3795.9792.0293.78lt_hse88.8881.4390.0165.686.9lv_lvtb94.7994.4793.7188.2591.3mr_ufal77.4572.175.9265.4875.41nl_alpino97.196.1697.3393.7896.19nl_lassysmall95.5495.9295.7294.495.47no_bokmaal989897.9595.2797.04no_nynorsklia94.0888.2792.55no_nynorsk97.9497.9297.6994.9196.59pl_lfg98.798.598.3995.2197.48pl_sz98.5697.9198.0594.7397.29pt_bosque96.7496.7396.1695.5395.85pt_gsd95.8395.4493.8493.0794.44pt_pud89.4889.6689.29ro_nonstandard94.6794.489492.0591.9ro_rrt97.6397.5297.4795.7896.71ru_gsd92.2391.3990.8488.1390.14ru_pud89.788.9289.52ru_syntagrus98.398.6598.3297.1398.03ru_taiga93.6292.7593.18sa_ufal32.4729.5827.11sk_snk97.0896.3296.9893.6196.35sl_ssj97.0796.6896.8994.2495.58sl_sst94.5190.3491.79sr_set98.6398.3398.3194.7997.36sv_lines97.2196.5996.9993.6495.57sv_pud94.5292.0694.32sv_talbanken98.0397.3497.7794.9196.76ta_ttb75.7172.774.2861.5174.6te_mtg94.2592.7293.4287.3293.42th_pud2.372.731.54tl_trg70.6928.6268.28tr_imst93.9694.0393.184.6491.8tr_pud73.168.3672.47uk_iu97.2996.697.289396.88ur_udtb93.8393.8793.699393.05vi_vtb77.6776.4277.4472.0177.06yo_ytb43.4830.8534.59zh_cfl49.8339.7749.42zh_gsd87.685.785.9682.7686.08zh_hk66.2957.8865.86zh_pud83.373.382.95POS tagging F1 of all models.lccccc treebankBERT F1Meta-LSTM F1mBERT F1mMeta-LSTM F1mMiniBERT F1af_afribooms97.1197.3696.5388.9893.75am_att32.3632.36ar_padt88.2688.2487.7683.1485.34ar_pud36.3334.2836.08be_hse82.8374.0387.5259.1681.82bg_btb97.5497.5897.4791.4195.4ca_ancora98.3798.2198.2896.0497.67cs_cac96.3396.4996.5488.1193.47cs_cltt81.6179.8983.8678.8280.61cs_fictree96.3996.494.0983.3787.59cs_pdt97.1896.9197.1589.7794.63cs_pud93.8887.4491.81da_ddt97.2297.0895.6289.8294.08de_gsd90.8490.5890.480.6988.99de_pud30.4130.5530.4el_gdt94.5793.9594.8387.692.07en_gum96.879693.7990.1193.71en_lines97.3296.6893.1187.4992.07en_partut94.8895.3890.7679.9990.18en_pud93.2591.2393.1es_ancora98.4598.4297.695.1797es_gsd93.5293.7288.7289.2688.78es_pud52.752.852.73et_edt96.1496.1195.7890.5192.14eu_bdt93.2792.5692.6776.7284.53fa_seraji97.3597.2596.9193.8296.28fi_ftb96.3496.4892.3277.8986.47fi_pud93.5891.1291.65fi_tdt95.0395.5890.9688.4487.48fr_gsd96.0596.1194.6786.9794.51fr_partut93.3292.9388.987.4887.05fr_pud59.1557.558.94fr_sequoia97.0997.1391.5485.2390.74fr_spoken10010098.6280.6796.67ga_idt82.281.7881.263.4466.82gl_ctg98.9898.9595.2789.9895.1gl_treegal80.0568.7375.97he_htb81.2780.8580.7976.8978.74hi_hdtb93.3293.8592.9189.0990.65hi_pud22.122.3722.03hr_set91.9991.8591.2481.6287.81hu_szeged93.6591.2892.9371.2587.36hy_armtdp41.1354.4551.0836.5946.43id_gsd94.849694.8591.6294.39id_pud39.8342.7939.79it_isdt97.797.8297.8795.4797.37it_partut97.3597.7398.0196.3397.9it_postwita95.6296.0595.0391.5293.17it_pud57.8257.4157.6ja_gsd90.2990.4590.2990.3990.41ja_modern63.961.1763.99ja_pud57.457.2657.27kk_ktb64.625.5559.49ko_gsd99.6299.5599.498.9999.37ko_kaist10010099.9499.2499.93ko_pud38.3338.6638.27la_ittb96.796.9497.1590.7893.91la_perseus82.0964.7372.24la_proiel90.8291.0191.5179.0883.99lt_hse75.2169.6573.6142.5165.22lv_lvtb88.6191.3488.179.1181.91mr_ufal63.9559.1164.233.6354.01nl_alpino96.2296.1396.5391.995.67nl_lassysmall96.4696.0295.5592.1695.28no_bokmaal96.8597.1396.4891.1795.31no_nynorsklia94.2289.5691.08no_nynorsk96.797.0496.4992.1294.79pl_lfg95.8594.6884.9647.9984.56pl_sz93.991.9371.473.0265.36pt_bosque96.2796.1687.0483.1385.72pt_gsd97.295.3367.7276.0171.88pt_pud52.0649.7950.95ro_nonstandard88.5288.9186.8982.182.14ro_rrt97.0297.2396.5893.294.85ru_gsd88.8386.7381.4464.278.93ru_pud37.9735.2637.49ru_syntagrus97.0296.995.9991.9694.33ru_taiga88.5684.0286.01sa_ufal15.916.1416.33sk_snk92.0689.6391.5868.2585.29sl_ssj94.3993.7894.4182.6989.23sl_sst88.4691.8978.2285.59sr_set94.8394.7192.7973.5190.48sv_lines89.5489.5588.6683.2786.4sv_pud77.3973.9476.79sv_talbanken96.9296.5696.1390.2394.49ta_ttb72.9171.0173.7546.970.22te_mtg98.9698.9698.5498.6898.54th_pud8.2708.43tl_trg29.3128.6225.17tr_imst89.59188.6373.2381.99tr_pud23.7223.8423.46uk_iu92.490.9892.6479.4988.79ur_udtb82.2483.7282.6481.8982.48vi_vtb83.748483.9383.5883.94yo_ytb58.7886.8261.88zh_cfl46.5543.5545.73zh_gsd87.6488.3888.3187.0588.5zh_hk66.3364.9766.23zh_pud86.3583.686.14Morphology F1 of all models.

Q: What codemixed language pairs are evaluated?

Q: How do they compress the model?

Q: What is the multilingual baseline?