Glyce: Glyph-vectors for Chinese Character Representations

Yuxian Meng, Wei Wu, Fei Wang, Xiaoya Li, Ping Nie, Fan Yin, Muyu Li, Guoyin Wang, Qinghong Han, Xiaofei Sun, Jiwei Li

TL;DR

Glyce introduces a novel way to incorporate visual character information (glyphs) into Chinese Natural Language Processing by treating characters as images. By leveraging historical scripts, a customized "Tianzege-CNN" architecture, and multi-task learning, Glyce overcomes previous generalization challenges and consistently outperforms character-ID and BERT baselines across a wide range of NLP tasks.

What Problem Does This Paper Address?

Unlike alphabetic languages, Chinese is logographic: its character shapes (glyphs) evolved from pictograms and inherently encode semantic meaning. Intuitively, NLP models should benefit from seeing these shapes. However, previous attempts to use Convolutional Neural Networks (CNNs) on Chinese character images often resulted in worse performance.

The authors identify three major reasons for these past failures:

  1. Loss of Pictographic Information: Modern Simplified Chinese has been optimized for ease of writing, stripping away historical pictographic clues. Characters with completely different meanings (like "人" for human and "入" for enter) look confusingly similar in modern fonts.
  2. Poor Architectural Fit: Standard computer vision models (like ResNet or VGG) are designed for large natural images (e.g., $800 \times 600$). Chinese character logos are tiny ($12 \times 12$), causing deep CNNs to overfit or fail to capture local graphic features.
  3. Data Scarcity: While ImageNet contains millions of images, the Chinese vocabulary consists of only around 10,000 distinct characters, leading to severe overfitting without proper regularization.

Methods

Glyce addresses these challenges through three core innovations:

  • Historical Script Ensembles: To restore lost semantic clues, Glyce uses an ensemble of characters across eight different historical scripts and writing styles, spanning from ancient Bronzeware and Seal scripts to modern Traditional and Cursive styles. This acts as a powerful form of data augmentation.
  • Tianzege-CNN: The authors design a shallow CNN architecture tailored to the structure of Chinese characters. Named after the traditional $2 \times 2$ grid used by beginners to practice calligraphy, the Tianzege-CNN uses a kernel size of 5, followed by max-pooling to a $2 \times 2$ feature map. This structure naturally captures how radicals are arranged. It then employs group convolutions to map these grids to the final output while minimizing parameters to prevent overfitting.
Figure 1: Illustration of the Tianzege-CNN used in Glyce.
  • Auxiliary Image Classification Task: To improve generalization, the model is trained using multi-task learning. The network must simultaneously solve the target NLP task and correctly predict the character's ID from its glyph embedding. The influence of this auxiliary loss is dynamically decayed over time.

For modern architectures, Glyce embeddings can be directly integrated with pretrained language models like BERT by adding position embeddings and passing the combined representations through a multi-layer Transformer.

Figure 2: Combing glyph information with BERT.

Datasets

The authors evaluated Glyce across a massive suite of 23 datasets spanning 7 distinct Chinese NLP tasks:

  • Named Entity Recognition (NER): OntoNotes, MSRA, Weibo, Resume.
  • Chinese Word Segmentation (CWS): PKU, MSR, CITYU, AS.
  • Part-of-Speech (POS) Tagging: CTB5, CTB6, CTB9, UD1.
  • Sentence Pair Classification: BQ, LCQMC, XNLI, NLPCC-DBQA.
  • Single Sentence Classification: ChnSentiCorp, Fudan corpus, iFeng.
  • Dependency Parsing: Chinese Penn Treebank 5.1.
  • Semantic Role Labeling (SRL): CoNLL-2009.

Key Insights and Ideas

  • Evolutionary Context Matters: Treating language evolution as a data source is a powerful concept. By looking at ancient scripts, the model gains access to the structural "intent" of a character that modern simplification obscured.
  • Inductive Biases for Text-as-Images: You cannot treat a character image like a photo of a cat. The success of the Tianzege-CNN highlights that incorporating domain-specific structural priors (like the $2 \times 2$ calligraphy grid) is vital when applying computer vision to logographic text.
  • The "BERT-Glyce-Joint" Training Strategy: Ablation studies revealed that when combining glyphs with BERT, it is crucial to freeze BERT initially while training the randomly initialized glyph layer. Tuning them jointly from the start misleads the pretrained BERT weights due to early-stage noise from the glyph network.

Key Results

Glyce achieved new state-of-the-art (SOTA) results across all evaluated tasks, outperforming both traditional deep learning baselines and standard BERT:

  • NER: Achieved an F1 score of 80.6 on the OntoNotes dataset, a +1.5 improvement over BERT.
  • Text Classification: Reached an almost perfect 99.8% accuracy on the Fudan corpus.
  • Sentence Pair Tasks: On the LCQMC dataset, Glyce+BERT improved accuracy to 88.7% (+1.2% over BERT).
  • Parsing & SRL: Glyce-word embeddings pushed SOTA performance up by +0.9 UAS and +0.8 LAS in dependency parsing, and +0.9 F1 in Semantic Role Labeling.

Limitations and Future Work

The authors do not explicitly detail limitations in the paper. However, potential areas for future exploration include extending this glyph-based approach to other logographic or logosyllabic writing systems (such as Japanese Kanji or ancient Egyptian hieroglyphs) and optimizing the computational overhead introduced by processing multi-script image tensors alongside large language models.

Summary updated

Abstract

It is intuitive that NLP tasks for logographic languages like Chinese should benefit from the use of the glyph information in those languages. However, due to the lack of rich pictographic evidence in glyphs and the weak generalization ability of standard computer vision models on character data, an effective way to utilize the glyph information remains to be found. In this paper, we address this gap by presenting Glyce, the glyph-vectors for Chinese character representations. We make three major innovations: (1) We use historical Chinese scripts (e.g., bronzeware script, seal script, traditional Chinese, etc) to enrich the pictographic evidence in characters; (2) We design CNN structures (called tianzege-CNN) tailored to Chinese character image processing; and (3) We use image-classification as an auxiliary task in a multi-task learning setup to increase the model's ability to generalize. We show that glyph-based models are able to consistently outperform word/char ID-based models in a wide range of Chinese NLP tasks. We are able to set new state-of-the-art results for a variety of Chinese NLP tasks, including tagging (NER, CWS, POS), sentence pair classification, single sentence classification tasks, dependency parsing, and semantic role labeling. For example, the proposed model achieves an F1 score of 80.6 on the OntoNotes dataset of NER, +1.5 over BERT; it achieves an almost perfect accuracy of 99.8\% on the Fudan corpus for text classification. Code found at https://github.com/ShannonAI/glyce.
BibTeX
@inproceedings{meng2019glyce,
  author = {Yuxian Meng and Wei Wu and Fei Wang and Xiaoya Li and Ping Nie and Fan Yin and Muyu Li and Guoyin Wang and Qinghong Han and Xiaofei Sun and Jiwei Li},
  title = {{Glyce: Glyph-vectors for Chinese Character Representations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=ZWlFgFD1vcr},
}
Figure