Skip to main content
QUICK REVIEW

[Paper Review] ZEN: Pre-training Chinese Text Encoder Enhanced by N-gram Representations

Shizhe Diao, Jiaxin Bai|arXiv (Cornell University)|Nov 2, 2019
Topic ModelingComputer Science35 references14 citations
TL;DR

ZEN proposes a BERT-based Chinese text encoder enhanced by explicit n-gram representations to improve semantic understanding by incorporating word and phrase-level information during pre-training. By integrating n-gram encodings via a secondary Transformer encoder and fusing them with character-level representations, ZEN achieves state-of-the-art performance on multiple Chinese NLP tasks using less data and no external knowledge compared to prior models.

ABSTRACT

The pre-training of text encoders normally processes text as a sequence of tokens corresponding to small text units, such as word pieces in English and characters in Chinese. It omits information carried by larger text granularity, and thus the encoders cannot easily adapt to certain combinations of characters. This leads to a loss of important semantic information, which is especially problematic for Chinese because the language does not have explicit word boundaries. In this paper, we propose ZEN, a BERT-based Chinese (Z) text encoder Enhanced by N-gram representations, where different combinations of characters are considered during training. As a result, potential word or phase boundaries are explicitly pre-trained and fine-tuned with the character encoder (BERT). Therefore ZEN incorporates the comprehensive information of both the character sequence and words or phrases it contains. Experimental results illustrated the effectiveness of ZEN on a series of Chinese NLP tasks. We show that ZEN, using less resource than other published encoders, can achieve state-of-the-art performance on most tasks. Moreover, it is shown that reasonable performance can be obtained when ZEN is trained on a small corpus, which is important for applying pre-training techniques to scenarios with limited data. The code and pre-trained models of ZEN are available at https://github.com/sinovation/zen.

Motivation & Objective

  • To address the limitation of character-level encoders like BERT in capturing meaningful word and phrase boundaries in Chinese, where word segmentation is ambiguous.
  • To improve semantic representation in Chinese pre-training by explicitly incorporating n-gram information during model training.
  • To develop a method that enhances BERT without altering its character-level output format, ensuring compatibility with downstream tasks.
  • To enable effective pre-training on small or limited corpora by leveraging automatically learned n-grams.
  • To provide a complementary alternative to whole-word masking and weakly supervised methods for incorporating subword-level semantics.

Proposed method

  • ZEN uses a two-branch architecture: a standard BERT-based character encoder and a separate n-gram encoder built with a Transformer encoder to process extracted n-grams.
  • N-grams are extracted from input text using a lexicon derived from unsupervised or dictionary-based methods, capturing valid and frequent character combinations.
  • The n-gram encoder generates contextual representations for each detected n-gram, which are then added element-wise to the corresponding character representations in the BERT encoder.
  • The model is pre-trained using both masked language modeling (MLM) and next sentence prediction (NSP) objectives, with the n-gram information integrated during the forward pass.
  • During fine-tuning, the model continues to leverage n-gram representations, allowing task-specific adaptation while preserving character-level output compatibility.
  • The integration mechanism is differentiable and does not require modifying the BERT architecture, enabling end-to-end training.

Experimental results

Research questions

  • RQ1Can explicit incorporation of n-gram representations improve the performance of character-level pre-trained models in Chinese NLP tasks?
  • RQ2How does ZEN’s method of integrating n-gram information compare to whole-word masking or weak supervision in terms of performance and data efficiency?
  • RQ3Does ZEN maintain compatibility with downstream tasks that expect character-level outputs, despite using higher-level n-gram representations?
  • RQ4Can ZEN achieve state-of-the-art results using less training data than existing models that rely on larger corpora?
  • RQ5How do n-gram representations evolve across layers in ZEN, and what do they reveal about semantic vs. morphological encoding?

Key findings

  • ZEN achieves state-of-the-art performance on multiple Chinese NLP benchmarks, including CLUE and CCLUE, outperforming models trained on larger corpora.
  • ZEN achieves strong results even when pre-trained on a small corpus, demonstrating high data efficiency and suitability for low-resource scenarios.
  • The model shows improved performance on tasks requiring phrase-level understanding, such as text classification and sequence labeling, due to explicit n-gram encoding.
  • Analysis reveals that longer, valid n-grams like 提高速度 (speed up) and 波士顿咨询 (Boston consulting group) receive higher attention weights in deeper layers, indicating semantic encoding.
  • The integration of n-gram representations enhances the model’s ability to learn meaningful text chunks, suggesting potential for use in downstream tasks like keyphrase extraction and chunking.
  • ZEN’s performance is competitive with or better than models using external knowledge or complex pre-processing, despite relying solely on self-supervised n-gram learning from the training data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.