[Paper Review] Application of Pre-training Models in Named Entity Recognition
This paper evaluates four pre-trained language models—BERT, ERNIE, ERNIE2.0-tiny, and RoBERTa—for Chinese Named Entity Recognition (NER) using fine-tuning on the MSRA-2006 dataset. RoBERTa achieved state-of-the-art performance with an F1 score of 94.17%, outperforming BERT and ERNIE, due to its dynamic masking and removal of the sentence-level NSP pre-training task, which proved detrimental for NER tasks.
Named Entity Recognition (NER) is a fundamental Natural Language Processing (NLP) task to extract entities from unstructured data. The previous methods for NER were based on machine learning or deep learning. Recently, pre-training models have significantly improved performance on multiple NLP tasks. In this paper, firstly, we introduce the architecture and pre-training tasks of four common pre-training models: BERT, ERNIE, ERNIE2.0-tiny, and RoBERTa. Then, we apply these pre-training models to a NER task by fine-tuning, and compare the effects of the different model architecture and pre-training tasks on the NER task. The experiment results showed that RoBERTa achieved state-of-the-art results on the MSRA-2006 dataset.
Motivation & Objective
- To evaluate the effectiveness of pre-trained language models in improving Chinese Named Entity Recognition (NER) performance.
- To investigate how model architecture and pre-training tasks influence NER performance.
- To compare the impact of different pre-training strategies—such as static vs. dynamic masking and entity-level masking—on NER.
- To determine whether sentence-level pre-training tasks like NSP are beneficial for sequence labeling tasks like NER.
- To provide empirical evidence for selecting optimal pre-trained models for NER based on architecture and pre-training objectives.
Proposed method
- Fine-tuned four pre-trained models—BERT, ERNIE, ERNIE2.0-tiny, and RoBERTa—on the MSRA-2006 Chinese NER dataset.
- Used a CRF layer on top of the pre-trained model’s output to model label dependencies and ensure valid tag sequences.
- Applied a fully connected layer after the pre-trained model’s final layer to project contextual representations to tag space.
- Employed static masking in BERT and ERNIE, while RoBERTa used dynamic masking, where different tokens are masked in each training epoch.
- Removed the Next Sentence Prediction (NSP) task in RoBERTa, unlike BERT and ERNIE, to assess its impact on NER performance.
- Trained models using PaddlePaddle on AI Studio with a V100 GPU, optimizing hyperparameters on a development set with 2 epochs, a 5e-5 initial learning rate, and a batch size of 16.
Experimental results
Research questions
- RQ1How do different pre-trained model architectures (e.g., number of layers, hidden size) affect NER performance on the MSRA-2006 dataset?
- RQ2What is the impact of pre-training tasks—specifically MLM, NSP, and entity/phrase-level masking—on NER performance?
- RQ3Does the removal of the NSP pre-training task in RoBERTa improve or degrade performance on the NER task compared to BERT and ERNIE?
- RQ4Why does ERNIE2.0-tiny underperform despite having more hidden units and continual pre-training, and how does its shallow architecture affect performance?
- RQ5To what extent does dynamic masking in RoBERTa enhance semantic representation compared to static masking in BERT and ERNIE?
Key findings
- RoBERTa achieved the highest F1 score of 94.17% on the MSRA-2006 dataset, outperforming BERT (93.30%), ERNIE (93.37%), and ERNIE2.0-tiny (86.52%).
- The removal of the Next Sentence Prediction (NSP) task in RoBERTa led to improved performance, indicating that sentence-level pre-training is not beneficial for NER and may hinder long-range dependency learning.
- Dynamic masking in RoBERTa enhanced model generalization and semantic representation, contributing to its superior performance compared to BERT and ERNIE, which use static masking.
- ERNIE2.0-tiny, despite having more hidden units and continual pre-training, achieved only 86.52% F1, significantly lower than the baseline BiGRU+CRF model (90.32%), due to its shallow 3-layer architecture limiting semantic feature extraction.
- ERNIE’s entity-level and phrase-level masking strategy slightly reduced performance compared to BERT, possibly due to segmentation errors during masking.
- The deeper architecture of RoBERTa (12 layers) and its optimized pre-training objectives made it more effective for sequence labeling tasks like NER than models with fewer layers or suboptimal pre-training tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.