ChineseBERT: Chinese Pretraining Enhanced by Glyph and Pinyin Information

Zijun Sun, Xiaoya Li, Xiaofei Sun, Yuxian Meng, Xiang Ao, Qing He, Fei Wu, Jiwei Li

Introduction

ChineseBERT represents a significant advancement in Chinese natural language understanding (NLU) by integrating the visual and phonetic characteristics of the language directly into the pretraining process. Unlike traditional models that treat Chinese characters as arbitrary IDs, ChineseBERT leverages glyphs (visual "look") and pinyin (phonetic "sound") to capture deeper semantic and syntactic nuances. This approach achieves state-of-the-art (SOTA) performance across diverse benchmarks while demonstrating superior training efficiency.

Problem Statement

Standard pretrained models like BERT were originally optimized for alphabetic languages. When applied to Chinese, they typically treat each character as an opaque token ID. This ignores two critical linguistic features:

  1. Logographic Information: The visual structure of Chinese characters (glyphs) often contains semantic clues. For instance, characters sharing the "water" radical (氵) are frequently related to liquids or bodies of water.
  2. Phonetic Information: Chinese contains many heteronyms—characters with identical forms but different pronunciations and meanings based on context (e.g., "乐" meaning "music" or "happy").

By neglecting these features, standard models must learn complex relationships solely through statistical co-occurrence, missing out on the inherent richness of the Chinese writing system.

Methodology: The Fusion Embedding

The core of ChineseBERT is the Fusion Embedding layer, which synthesizes three distinct information streams for each character:

  • Char Embedding: The standard ID-based embedding used in vanilla BERT models.
  • Glyph Embedding: To capture visual semantics, characters are rendered in three historical and modern fonts (FangSong, XingKai, and LiShu) as 24x24 images. These are processed through a fully connected layer to create a visual vector.
  • Pinyin Embedding: To address phonetic ambiguity, the model uses the pypinyin package to identify context-appropriate pronunciations. This Romanized sequence is then processed by a CNN to generate a phonetic vector.
The overall architecture of ChineseBERT, illustrating the integration of Char, Glyph, and Pinyin embeddings through a Fusion Layer before entering the BERT backbone.

These embeddings are merged in a fusion layer and mapped to the model's hidden dimension. The model is pretrained from scratch using Masked Language Modeling (MLM) with Whole Word Masking (WWM) and Char Masking (CM) strategies.

Experimental Setup

ChineseBERT was pretrained on a high-quality 10% subset of Common Crawl (approx. 4 billion characters). Evaluation spanned a comprehensive suite of Chinese NLU tasks, including Machine Reading Comprehension (MRC), Natural Language Inference (NLI), Text Classification (TC), Named Entity Recognition (NER), and Chinese Word Segmentation (CWS).

Results and Discussion

ChineseBERT established new SOTA benchmarks across nearly all tested categories. In MRC, the Large model achieved an F1 score of 78.05 on CMRC 2018. In NER, significant gains were observed in recall, particularly for rare entities, suggesting that visual and phonetic cues provide crucial context where token-based statistics fail.

Test F1-score vs. Training Size, demonstrating that ChineseBERT consistently outperforms BERT and RoBERTa, especially when training data is limited.

A key finding is the role of glyph and pinyin information as strong regularizers. As shown in the performance analysis, ChineseBERT reaches higher performance levels with fewer training steps and less data compared to vanilla models. Ablation studies confirmed that removing either the glyph or pinyin components leads to a measurable drop in performance (1.2 to 1.5 points on NER tasks).

Conclusion

By explicitly modeling the visual and phonetic dimensions of Chinese characters, ChineseBERT overcomes the limitations of character-ID-only models. While training from scratch presents a higher initial computational cost, the resulting model is more efficient and robust. Future work may explore radical-level decompositions or larger-scale pretraining to further enhance these linguistic representations.

Summary updated

BibTeX
@inproceedings{sun2021chinesebert,
  author = {Zijun Sun and Xiaoya Li and Xiaofei Sun and Yuxian Meng and Xiang Ao and Qing He and Fei Wu and Jiwei Li},
  title = {{ChineseBERT: Chinese Pretraining Enhanced by Glyph and Pinyin Information}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.161},
}
Figure