arXiv(opens in a new tab)Computer ScienceApr 2020

Manuscript Offprint

arXiv:2004.13922

Revisiting Pre-Trained Models for Chinese Natural Language Processing

Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Shijin Wang, Guoping Hu

Abstract

Bidirectional Encoder Representations from Transformers (BERT) has shown marvelous improvements across various NLP tasks, and consecutive variants have been proposed to further improve the performance of the pre-trained language models. In this paper, we target on revisiting Chinese pre-trained language models to examine their effectiveness in a non-English language and release the Chinese pre-trained language model series to the community. We also propose a simple but effective model called MacBERT, which improves upon RoBERTa in several ways, especially the masking strategy that adopts MLM as correction (Mac). We carried out extensive experiments on eight Chinese NLP tasks to revisit the existing pre-trained language models as well as the proposed MacBERT. Experimental results show that MacBERT could achieve state-of-the-art performances on many NLP tasks, and we also ablate details with several findings that may help future research.

1 Introduction

Bidirectional Encoder Representations from Transformers (BERT) (Devlin et al., 2019) has become enormously popular and has proven to be effective in recent natural language processing studies, which utilizes large-scale unlabeled training data and generates enriched contextual representations. As we traverse several popular machine reading comprehension benchmarks, such as SQuAD (Rajpurkar et al., 2018), CoQA (Reddy et al., 2019), QuAC (Choi et al., 2018), NaturalQuestions (Kwiatkowski et al., 2019), RACE (Lai et al., 2017), we can see that most of the top-performing models are based on BERT and its variants (Dai et al., 2019; Zhang et al., 2019; Ran et al., 2019), demonstrating that the pre-trained language models have become new fundamental components in natural language processing field.

Starting from BERT, the community have made great and rapid progress on optimizing the pre-trained language models, such as ERNIE (Sun et al., 2019a), XLNet (Yang et al., 2019), RoBERTa (Liu et al., 2019), SpanBERT (Joshi et al., 2019), ALBERT (Lan et al., 2019), ELECTRA (Clark et al., 2020), etc. However, training Transformer-based (Vaswani et al., 2017) pre-trained language models are not as easy as we used to train word embeddings or other traditional neural networks. Typically, training a powerful BERT-large model, which has 24-layer Transformer with 330 million parameters, to convergence needs high-memory computing devices, such as TPU, which is very expensive. On the other hand, though various pre-trained language models have been released, most of them are based on English, and there are few efforts on building powerful pre-trained language models on other languages.

BERTERNIEXLNetRoBERTaALBERTELECTRAMacBERT
TypeAEAEARAEAEAEAE
EmbeddingsT/S/PT/S/PT/S/PT/S/PT/S/PT/S/PT/S/P
MaskingTT/E/Ph-TTTWWM/NM
LM TaskMLMMLMPLMMLMMLMGen-DisMac
Paired TaskNSPNSP--SOP-SOP

Table 1: Comparisons of the pre-trained language models. (AE: Auto-Encoder, AR: Auto-Regressive, T: Token, S: Segment, P: Position, W: Word, E: Entity, Ph: Phrase, WWM: Whole Word Masking, NM: N-gram Masking, NSP: Next Sentence Prediction, SOP: Sentence Order Prediction, MLM: Masked LM, PLM: Permutation LM, Mac: MLM as correction)

In this paper, we aim to build Chinese pre-trained language model series and release them to the public for facilitating the research community, as Chinese and English are among the most spoken languages in the world. We revisit the existing popular pre-trained language models and adjust them to the Chinese language to see if these models generalize well in the language other than English. Besides, we also propose a new pre-trained language model called MacBERT, which replaces the original MLM task into MLM as correction (Mac) task and mitigates the discrepancy of the pre-training and fine-tuning stage. Extensive experiments are conducted on eight popular Chinese NLP datasets, ranging from sentence-level to document-level, such as machine reading comprehension, text classification, etc. The results show that the proposed MacBERT could give significant gains in most of the tasks against other pre-trained language models, and detailed ablations are given to better examine the composition of the improvements. The contributions of this paper are listed as follows.

  • Extensive empirical studies are carried out to revisit the performance of Chinese pre-trained language models on various tasks with careful analyses.
  • We propose a new pre-trained language model called MacBERT that mitigates the gap between the pre-training and fine-tuning stage by masking the word with its similar word, which has proven to be effective on down-stream tasks.
  • To further accelerate future research on Chinese NLP, we create and release the Chinese pre-trained language model series to the community.

References (17)