Investigating Self-Attention Network for Chinese Word Segmentation

Leilei Gan, Yue Zhang

Abstract

Chinese Word Segmentation (CWS) is a fundamental task in Chinese natural language processing, traditionally dominated by BiLSTM-CRF architectures. This paper investigates the application of Self-Attention Networks (SAN) for CWS, proposing a SAN-CRF model that incorporates local self-attention and contextualized BERT embeddings. Furthermore, a novel "type-supervised" method is introduced to integrate external lexicons, addressing the Out-of-Vocabulary (OOV) challenge in cross-domain scenarios. Experimental results demonstrate that the proposed model achieves state-of-the-art performance across multiple benchmarks, with a significant 30.32% average error reduction in cross-domain tasks.

Introduction

Unlike many Western languages, Chinese text lacks explicit word delimiters like spaces. Consequently, Chinese Word Segmentation (CWS) is typically framed as a character-level sequence labeling problem. For years, the BiLSTM-CRF architecture has been the standard approach. However, the sequential nature of LSTMs limits training efficiency and parallelization.

While Transformers and Self-Attention Networks (SANs) have revolutionized tasks like machine translation, their specific utility for CWS—particularly in handling long-distance dependencies and domain adaptation—remains an area of active research. This study explores whether SANs can effectively replace LSTMs while improving performance and robustness across different text domains.

Proposed Architecture

The authors propose a SAN-CRF architecture designed to capture both local and global dependencies efficiently. The model consists of several key components:

  1. Local Self-Attention (L-SAN): Standard self-attention mechanisms attend to every character in a sentence. The authors argue that for segmentation, excessive global context can introduce noise. They propose a local variant that restricts attention to a fixed window of surrounding characters, focusing the model on immediate lexical cues.
  2. BERT Integration: The model leverages contextualized character embeddings from a fine-tuned BERT model, replacing traditional static embeddings like Word2Vec to provide richer semantic representations.
  3. Type-Supervised Domain Adaptation: To bridge the gap between domains (e.g., news vs. web novels), the model integrates external lexicons. Instead of simple string matching, an attention mechanism weights word information and maps it to Part-of-Speech (POS) tags. This allows the model to generalize based on word categories (e.g., identifying a sequence as a "name") even for words not seen during training.
Architecture of the proposed SAN-CRF model with lexicon integration.

Experimental Setup

The model was evaluated on a diverse set of benchmarks to test both in-domain and cross-domain capabilities:

  • In-Domain (News): CTB6 (Chinese Treebank 6.0), PKU, and MSR (SIGHAN Bakeoff 2005).
  • Cross-Domain (Web Novels): Models trained on the PKU dataset were tested on three novel-based datasets: ZX (ZhuXian), FR (FanRenXiuXianZhuan), and DL (DouLuoDaLu).

Key Results and Discussion

The proposed L-SAN + CRF + BERT + Lexicon model achieved state-of-the-art results across all six benchmarks. Several critical insights emerged from the data:

  • Locality is Beneficial: Local SAN consistently outperformed Global SAN. Restricting the attention window helps the model focus on the most relevant local features for determining word boundaries.
  • BERT's Impact: The inclusion of BERT provided a substantial performance boost and increased the model's stability, particularly as sentence length increased.
  • Cross-Domain Robustness: The neural type-supervised method proved highly effective for domain adaptation, reducing the error rate by an average of 30.32% on web novel datasets by leveraging POS-tag generalizations.
F1-value performance across training iterations for various model configurations.

As shown in the performance curves, models utilizing BERT embeddings reach significantly higher F1-values and stabilize faster than those using standard bigram features. Furthermore, the Local SAN (L-SAN) variants demonstrate a clear advantage over standard SAN and BiLSTM baselines in terms of peak performance.

Conclusion

This research confirms that Self-Attention Networks are a powerful alternative to BiLSTMs for Chinese Word Segmentation. By emphasizing local context and integrating contextualized embeddings with type-supervised lexicon information, the proposed model achieves superior accuracy and domain generalizability. Future work may explore the sensitivity of performance to varying window sizes and methods to reduce the computational overhead of the BERT layer during inference.

Summary updated

BibTeX
@article{gan2020investigating,
  author = {Leilei Gan and Yue Zhang},
  title = {{Investigating Self-Attention Network for Chinese Word Segmentation}},
  journal = {IEEE ACM Trans. Audio Speech Lang. Process.},
  year = {2020},
  doi = {10.1109/taslp.2020.3030487},
}
Figure