ChineseBERT
BERT for Chinese whose input embedding fuses each character's token, glyph and pinyin embeddings.
Language · 315 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Language
- Parameters
- 147.3M
- Operations
- 315
- Framework
- PyTorch
- Recurrent
- No
- Published
- ACL 2021
- Cited by
- 7 (as of 30 October 2026)
- Authors
- Zijun Sun, Xiaoya Li, Xiaofei Sun and others
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m15290
- Graph hash
- 3f7e2c6b72a621985396ff0d67d2231fb7b457e10d474f5413545547d97e5862
- Skeleton hash
- 3b6820d31ec072249d0de16655de807bfa2fc01467be76054e56a7f35339dca3
- Architecture hash
- af1c036031d7c3a8cc96c3a34f2da2dbc691b08d0f987c9a0c50bd1254389de2
- Diagram SHA-256
- 2f01faa494eabaf67a0e38c854e847f8181f83a04d61b64eab62d254f08515ae
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
ChineseBERT is a BERT-based language model for Chinese that brings the glyph and pinyin information of each character, its written form and its pronunciation, into pretraining. The paper argues that earlier Chinese pretraining models neglected these two aspects, which it says carry significant syntax and semantic information for language understanding.
Each character gets three embeddings: a char embedding that is the same as the original BERT token embedding, a glyph embedding that captures visual features from different fonts of the character, and a pinyin embedding that captures phonetic features from its pinyin sequence. The three are concatenated and mapped by a fully connected layer to a single fusion embedding, which is added to the position embedding and fed to the BERT model. The pinyin embedding is meant to handle heteronyms, where the same character has different pronunciations with different meanings.
Two sizes were released: ChineseBERT-base with 12 layers, 768 hidden units and 12 heads, and ChineseBERT-large with 24 layers, 1024 hidden units and 16 heads, for which the repository reports 147M and 374M parameters. The paper reports a performance boost over baseline models with fewer training steps, and results on machine reading comprehension, natural language inference, text classification and sentence pair matching that were the best reported at the time, with competitive results in named entity recognition.
Key idea. ChineseBERT fuses glyph and pinyin embeddings with the character embedding before a BERT encoder, bringing the visual form and pronunciation of Chinese characters into language model pretraining.
- ChineseBERT
- GlyceBert
- Chinese BERT
- ChineseBERT-base
- ChineseBERT-large
- glyph embedding
- pinyin embedding
- Chinese pretrained language model
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{sun2026chinesebertchinesepretrainingenhanced,
title={ChineseBERT: Chinese Pretraining Enhanced by Glyph and Pinyin Information},
author={Zijun Sun and Xiaoya Li and Xiaofei Sun and Yuxian Meng and Guoyin Wang and Xiang Ao and Qing He and Fei Wu and Jiwei Li},
year={2026},
eprint={2106.16038},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2106.16038},
}