논문 해설
Sub-Character Tokenization for Chinese Pretrained Language Models
중국어 pre-training 언어 모델을 위한 하위 문자 토큰화
- 연구 문제 기존 중국어 PLM의 문자 토크나이저와 서브워드 토크나이저는 중국어 문자 체계의 서브문자 정보를 활용하지 못합니다. 이 논문은 한자를 발음 또는 글리프 기반 시퀀스로 바꾼 뒤 서브워드 분할을 적용하는 방식을 제안합니다.
- 연구 방법 각 한자를 Pinyin 같은 발음 기호나 Wubi 같은 글리프 기반 부수 시퀀스로 인코딩하고, 그 시퀀스에 unigram 언어 모델 분할을 적용해 어휘를 구성합니다. 동음이의 인덱스 부착 여부가 강건성과 효율에 영향을 줍니다.
- 주요 결과 SubChar 토크나이저는 표준 NLU 평균 성능에서 기준선과 비슷하거나 약간 높았고, 같은 어휘 크기에서 토큰 시퀀스를 크게 줄였습니다. SubChar-Pinyin-NoIndex는 합성 동음이의 오타 설정에서 성능 하락을 보이지 않았습니다.
기존 중국어 토크나이저의 한계
중국어 pre-training 언어 모델은 보통 두 가지 토크나이저 중 하나를 사용합니다. 하나는 각 한자를 하나의 토큰으로 취급하는 CharTokenizer이고, 다른 하나는 CPM처럼 서브워드 분할을 적용하는 sub-word 토크나이저입니다. 이 논문은 두 방식 모두 중국어의 문자 체계가 가진 특성을 충분히 활용하지 못한다고 봅니다.
저자들이 든 첫 번째 특성은 중국어 표기 체계가 글자와 발음의 대응이 불규칙한 불투명 철자법이라는 점입니다. 두 번째는 중국어에 형태론적 굴절이 없어서 서브워드 분할이 접사와 어근을 나누는 장점을 제대로 살리기 어렵다는 점입니다. 또한 한자는 표의 문자이며 부수 구성, 즉 글리프에도 의미 정보가 담겨 있는데, 이는 문자 수준에서만 보이고 서브문자 수준에서 포착할 수 있다고 주장합니다. 이 문단의 주장은 저자들의 동기이며 본 논문이 이를 모든 중국어 과제에서 직접 증명한 것은 아닙니다.
이 연구는 이러한 문제를 해결하기 위해 서브문자(SubChar) 토크나이제이션을 제안합니다. 핵심 변경점은 토큰화 이전에 각 한자를 발음 또는 글리프 기반의 짧은 기호 시퀀스로 바꾸는 것입니다.
서브문자 토크나이제이션의 두 단계
SubChar 토크나이제이션은 두 단계로 구성됩니다. 첫 단계는 문자 인코딩입니다. 각 한자를 글리프 또는 발음을 나타내는 시퀀스로 바꾸고, 문자 뒤에는 구분 기호 '#'을 붙입니다. 발음 기반 인코딩에서는 Pinyin 또는 zhuyin을 사용하며, 글리프 기반 인코딩에서는 Stroke, Wubi, Zhengma, Cangjie를 사용합니다.
두 번째 단계는 인코딩된 시퀀스에 서브워드 분할을 적용하여 어휘를 구성하는 것입니다. 각 문자의 인코딩을 영어의 단어처럼 취급하고, 기본 설정에서는 SentencePiece의 unigram 언어 모델 분할을 사용합니다. 그 결과 어휘는 서브문자 토큰, 단일 문자 토큰, 문자 조합 토큰이 섞인 형태가 됩니다.

Figure 5 : Breakdown of different types of tokens in the vocabularies of various tokenizers. We observe the clear trend that in our SubChar tokenizers, a small fraction of sub-character tokens saves the space to store much more character combination tokens (e.g., words and phrases).
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.Pinyin 인코딩에서 동음이의 문자를 구분하기 위해 인덱스를 붙이는 SubChar-Pinyin과, 인덱스를 붙이지 않는 SubChar-Pinyin-NoIndex를 비교합니다. 인덱스를 제거하면 동음이의 문자가 같은 표기 시퀀스로 바뀌므로 동음이의 오타에 강건해지지만, 어휘에서 문자를 구별하는 정보는 줄어듭니다. 이 선택은 뒤의 강건성 실험에서 중요한 조작 변수입니다.

Figure 3 : An actual interface of the popular pinyin input method. The first line yi yi is the user input of the roman- ization sequence, all words with this same pronunciation are listed below for users to choose from.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.선택적 중국어 단어 분할의 결합
CWS는 선택적 전처리 단계입니다. 먼저 pre-training 말뭉치를 단어로 분할하고 빈도가 높은 단어를 골라 조합 토큰 부분의 어휘로 씁니다. 이후 텍스트는 발음 또는 글리프 기반 인코딩과 서브워드 분할을 거쳐 서브문자와 문자 토큰을 얻습니다. 입력에서는 단어가 어휘에 있으면 단어 토큰으로 처리하고, 없으면 SubChar 토크나이저가 다시 처리합니다.

Figure 2 : Illustration of the tokenization pipeline when incorporating CWS. After the first step of CWS, high- frequency words (words in the dashed box) directly be- come part of the final output sequence, the other words then go through SubChar tokenization.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.저자들은 단어 토큰 비율을 80%로 맞추었다고 밝히며, 이는 예비 튜닝에 따른 설정입니다. 이 설정은 CWS 결합 실험의 고정 조건이며 모든 SubChar 변형의 일반 설정으로 볼 수 없습니다.
비교 기준과 pre-training 설정
비교 대상은 CharTokenizer와 sub-word 토크나이저입니다. 공정한 비교를 위해 모든 토크나이저의 어휘 크기를 22,675로 맞추었습니다. pre-training 말뭉치는 Baidu Baike에서 얻은 2.3GB 중국어 텍스트입니다. 모든 모델은 같은 말뭉치와 하이퍼파라미터를 사용하며, 문자 토크나이저 모델도 기존 체크포인트 대신 같은 말뭉치로 새로 사전학습했습니다.
주된 실험은 6층 Transformer BERT이며, 모델 크기 영향을 보기 위해 12층 모델도 학습했습니다. 다음 문장 예측 목적은 제거하고 나머지 BERT 학습 절차를 따랐습니다. 미세조정은 배치 크기 32, 최대 24 에폭으로 수행하고, 최고 dev 체크포인트의 test 성능을 보고합니다. 결과는 세 개의 무작위 시드 평균입니다. 여기서 말하는 조건은 이 실험 설정에 한정됩니다.
표준 NLU 과제에서의 성능
표준 NLU 평가에서 6층 BERT 설정은 대체로 기준선과 비슷한 성능을 보였습니다. 평균 성능은 CharTokenizer 70.75, sub-word 70.83, SubChar-Wubi 71.36, SubChar-Pinyin 71.42로 보고됩니다. 여러 데이터셋에서 차이는 작고 표준편차 범위 안에 있는 경우가 많습니다.

Table 2 : Results on downstream datasets of different tokenizers. The last column indicates average performance. The subscript is the standard deviation. Models trained with sub-character tokenizers can match the performance of baseline models across all datasets. Ablation shows that increasing the model size or pretraining corpus size can slightly improve downstream task performance. These ablation results support our overall conclusion that models trained with SubChar tokenizers can closely match or slightly outperform the baselines.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.12층 설정에서는 CharTokenizer 평균이 72.23이고 SubChar-Pinyin 평균이 72.87입니다. 이 결과는 12층 모델이 평균 성능을 조금 높인다는 관찰이며, 두 토크나이저 사이의 차이를 모든 과제에 일반화하지는 않습니다.
또한 22.1GB 웹 텍스트로 추가 사전학습한 실험에서도 SubChar-Pinyin 평균은 73.42로 CharTokenizer 72.81보다 높았습니다. 이 추가 pre-training은 2.3GB 말뭉치에서 이어 학습한 체크포인트에 적용된 것이며 처음부터 학습한 설정과 구분해야 합니다.
동음이의 오타와 음성 입력 잡음 평가
강건성 평가는 두 종류입니다. 첫째는 합성 동음이의 오타입니다. 테스트 문장의 일정 비율 문자를 같은 발음의 다른 문자로 바꾸어 평가합니다. SubChar-Pinyin-NoIndex는 동음이의 문자를 같은 표기로 매핑하므로, 이 합성 오타 설정에서 성능 하락이 관찰되지 않았습니다. 반면 CharTokenizer, sub-word, SubChar-Pinyin은 오타 비율이 높아질수록 성능이 크게 떨어졌습니다.

Table 3 : Results for noisy evaluation with homophone typos. Different columns correspond to different percentages of typos in the test data. The BERT model with our SubChar-Pinyin-NoIndex tokenizer (results in bold) suffers no performance drop on noisy test data since it is robust to all homophone typos.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.
Figure 4 : Illustration of how our SubChar-Pinyin- NoIndex tokenizer is robust to any homophone typos. The possible homophone typos (characters in purple dashed boxes) are mapped into the same romanization sequence as the intended correct characters, and hence the resultant tokenization based on the romanized se- quences would be the same.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.둘째는 음성 입력에서 생긴 실제 잡음입니다. AFQMC 잡음 테스트셋은 세 명의 주석자가 원문을 읽은 음성을 상용 ASR로 텍스트화한 것입니다. 이 평가는 양성 예제의 성능을 중심으로 N-Average와 N-Worst를 보고합니다. 저자들은 잡음 입력에서 SubChar-Pinyin이 기준선보다 나은 성능을 보였다고 보고합니다.

Table 4 : Results on the real-world AFQMC noisy test set. Each clean test instance is annotated by three dif- ferent annotators, we report both the macro-average on these noisy annotations (N-Average) as well as the average of the worst-case performance across all test examples (N-Worst). SubChar-Pinyin outperforms base- lines on the challenging noisy test set (best results on the noisy test set are in bold).
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.다만 실제 잡음 평가의 문자 단위 오류율은 평균 30%이며, 여러 오류 유형이 섞여 있습니다. 따라서 이 결과를 동음이의 오타 전체에 대한 강건성으로 확대하면 안 됩니다.
토큰 시퀀스 길이와 학습 효율
SubChar 토크나이저의 효율 주장은 토큰 시퀀스 길이에서 나옵니다. iFLYTEK 데이터셋에서 평균 토큰화 길이는 CharTokenizer 289.0, sub-word 255.2, SubChar-Pinyin 185.2, SubChar-Pinyin-NoIndex 175.4입니다. TNEWS에서도 SubChar 변형이 기준선보다 짧았습니다. 이는 같은 어휘 크기에서 조합 토큰이 더 많이 저장되기 때문입니다.

Table 7 : Comparison of average length of tokenized sequences with different tokenizers. SubChar tokeniz- ers produce much shorter tokenized sequences than the baselines. SubChar-Pinyin-NoIndex tokenizer achieves the most length reduction. BPE and Unigram LM coun- terparts achieve similar speedup improvement.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 10쪽에서 그림 영역을 추출했습니다.미세조정 시간은 CharTokenizer를 100%로 두었을 때 iFLYTEK에서 SubChar-Pinyin-NoIndex가 68.9%입니다. pre-training 말뭉치의 토큰화 결과 크기는 SubChar-Pinyin-NoIndex가 CharTokenizer의 74.7%입니다. 이 값은 디스크 메모리 기준이며 하드웨어에 따른 실행 속도 차이와 구분해야 합니다.

Table 8 : Finetuning time of models with different tok- enizers. Numbers indicate time relative to the CharTok- enizer baseline model. Models with SubChar tokenizers take much shorter time to finish finetuning. SubChar- Pinyin-NoIndex brings the most speedup.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 10쪽에서 그림 영역을 추출했습니다.어휘 크기를 60000까지 늘리면 효율 이점은 줄지만 여전히 기준선보다 짧은 시퀀스를 만들었다고 보고됩니다.

Table 10 : Comparison of average length of tokenized sequences with different tokenizers and different vocab- ulary sizes.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 11쪽에서 그림 영역을 추출했습니다.CWS와 인코딩 방식의 절제 결과
CWS를 추가하면 downstream 평균 성능이 뚜렷하게 나아지지 않았습니다. Sub-word와 SubChar-Wubi에서는 CWS 추가 시 평균이 낮아졌고, SubChar-Pinyin에서는 0.16 높아졌지만 저자들은 유의미한 향상은 아니라고 해석합니다.

Table 5 : Results of models trained with different tokenizers. Numbers in brackets indicate the difference between adding and not adding the CWS step in tokenization. Adding CWS brings no significant improvement in performance.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 10쪽에서 그림 영역을 추출했습니다.인코딩 방식 비교에서는 Pinyin, Zhuyin, Stroke, Wubi, Zhengma, Cangjie, Byte, RandomIndex를 함께 비교했습니다. 비언어적인 Byte 인코딩과 RandomIndex 인코딩도 경쟁력 있는 평균 성능을 보였습니다. 이는 언어 정보가 성능의 필수 조건이라기보다, 저자들의 해석에 따르면 강건성과 효율에서 언어 정보가 가치를 가진다는 뜻입니다. 같은 절에서 BPE 기반 SubChar-Pinyin도 unigram 버전과 비슷한 평균을 보였습니다.

Table 11 : Results of SubChar tokenizers when using different encoding methods. The last row is a model with SubChar-Pinyin tokenizer using BPE as the subword tokenization algorithm, all previous rows are using unigram LM as the subword tokenization implementation. All models have 6-layers with the same hyper-parameters. The impact of different encoding methods on downstream performance is small, and the ULM and BPE versions of SubChar-Pinyin also achieve similar results.
원문 · CC BY 4.0 · Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun · Sub-Character Tokenization for Chinese Pretrained Language Models · 원문 그림 인용 · 원본 PDF 12쪽에서 그림 영역을 추출했습니다.적용 범위와 한계
저자들이 밝힌 주요 한계는 실험이 주로 자연어 이해 과제에 집중되어 있다는 점입니다. 언어 생성 과제에 적용하려면 예측 대상이 완전한 문자가 되도록 하는 등 추가 작업이 필요하다고 설명합니다.
또한 이 방법은 중국어에 특화되어 설계되었습니다. 일본어 간지처럼 표의 문자를 사용하는 다른 언어에 효과가 있을 것이라는 가설은 제시되었지만, 본 연구에서 검증되지 않았습니다.
마지막으로 AFQMC의 실제 잡음 평가는 여러 잡음 원인이 섞여 있으므로 동음이의 오타의 효과를 분리하지 못합니다. 이 결과는 실제 음성 입력에서의 한 평가 결과로 읽어야 합니다.
논문 정보
- 저자
- Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2021년 6월 1일
- 등록일
- 2026년 11월 6일
- 수정일
- 2023년 2월 14일
- 버전
- v3
- arXiv
- 2106.00400
- 분류
- cs.CL
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
Tokenization is fundamental to pretrained language models (PLMs). Existing tokenization methods for Chinese PLMs typically treat each character as an indivisible token. However, they ignore the unique feature of the Chinese writing system where additional linguistic information exists below the character level, i.e., at the sub-character level. To utilize such information, we propose sub-character (SubChar for short) tokenization. Specifically, we first encode the input text by converting each Chinese character into a short sequence based on its glyph or pronunciation, and then construct the vocabulary based on the encoded text with sub-word segmentation. Experimental results show that SubChar tokenizers have two main advantages over existing tokenizers: 1) They can tokenize inputs into much shorter sequences, thus improving the computational efficiency. 2) Pronunciation-based SubChar tokenizers can encode Chinese homophones into the same transliteration sequences and produce the same tokenization output, hence being robust to homophone typos. At the same time, models trained with SubChar tokenizers perform competitively on downstream tasks. We release our code and models at https://github.com/thunlp/SubCharTokenization to facilitate future work.
원문 인용
Chenglei Si, Zhengyan Zhang, Yingfa Chen, Fanchao Qi, Xiaozhi Wang, Zhiyuan Liu, Yasheng Wang, Qun Liu, Maosong Sun (2021). Sub-Character Tokenization for Chinese Pretrained Language Models. arXiv:2106.00400v3. https://arxiv.org/abs/2106.00400v3
BibTeX
@misc{si2021character,
title = {{Sub-Character Tokenization for Chinese Pretrained Language Models}},
author = {Chenglei Si and Zhengyan Zhang and Yingfa Chen and Fanchao Qi and Xiaozhi Wang and Zhiyuan Liu and Yasheng Wang and Qun Liu and Maosong Sun},
year = {2021},
eprint = {2106.00400},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2106.00400v3}
}