[Paper Review] WangchanBERTa: Pretraining transformer-based Thai Language Models
This paper introduces WangchanBERTa, a RoBERTa-base-based Thai language model pre-trained on 78GB of curated, deduplicated, and cleaned Thai text from diverse sources including social media, news, and public datasets. By preserving spaces as sentence and chunk boundaries and using SentencePiece tokenization, WangchanBERTa-base-att-spm-uncased outperforms strong baselines (NBSVM, CRF, ULMFit) and multilingual models (XLM-R, mBERT) on both sequence and token classification tasks in monolingual Thai contexts.
Transformer-based language models, more specifically BERT-based architectures have achieved state-of-the-art performance in many downstream tasks. However, for a relatively low-resource language such as Thai, the choices of models are limited to training a BERT-based model based on a much smaller dataset or finetuning multi-lingual models, both of which yield suboptimal downstream performance. Moreover, large-scale multi-lingual pretraining does not take into account language-specific features for Thai. To overcome these limitations, we pretrain a language model based on RoBERTa-base architecture on a large, deduplicated, cleaned training set (78GB in total size), curated from diverse domains of social media posts, news articles and other publicly available datasets. We apply text processing rules that are specific to Thai most importantly preserving spaces, which are important chunk and sentence boundaries in Thai before subword tokenization. We also experiment with word-level, syllable-level and SentencePiece tokenization with a smaller dataset to explore the effects on tokenization on downstream performance. Our model wangchanberta-base-att-spm-uncased trained on the 78.5GB dataset outperforms strong baselines (NBSVM, CRF and ULMFit) and multi-lingual models (XLMR and mBERT) on both sequence classification and token classification tasks in human-annotated, mono-lingual contexts.
Motivation & Objective
- To address the limited availability of high-performing, monolingual Thai language models by creating a large-scale, domain-diverse pretraining dataset.
- To overcome suboptimal performance of multilingual models (e.g., mBERT, XLM-R) on Thai NLP tasks by training a dedicated, monolingual model.
- To investigate the impact of different tokenization strategies—word-level, syllable-level, and SentencePiece—on downstream performance in Thai NLP.
- To improve Thai NLP by preserving spaces as syntactic boundaries during subword tokenization, a key linguistic feature in Thai.
- To establish a new SOTA benchmark for Thai NLP by pretraining on a large-scale, curated dataset and releasing the model publicly.
Proposed method
- Pretraining a RoBERTa-base architecture on 78GB of cleaned, deduplicated Thai text from social media (Wisesight, Pantip), news (Thairath, Prachathai), and Wikipedia.
- Applying Thai-specific text preprocessing that preserves spaces as sentence and chunk boundaries before subword tokenization.
- Using SentencePiece subword tokenization with a learnable vocabulary to handle OOV words and improve robustness.
- Training and comparing five variants: one on the full 78GB dataset (WangchanBERTa-base-att-spm-uncased) and four on Wikipedia-only data using different tokenizers (SentencePiece, word-level, syllable-level, SEFR).
- Evaluating performance on sequence classification (multi-class and multi-label) and token classification (named entity recognition) using human-annotated datasets.
- Releasing the pretrained and fine-tuned models on Hugging Face and open-sourcing training code on GitHub.
Experimental results
Research questions
- RQ1Does pretraining a monolingual Thai BERT model on a large, diverse, and cleaned dataset improve performance on downstream NLP tasks compared to existing baselines and multilingual models?
- RQ2How does preserving spaces as syntactic boundaries during tokenization affect the performance of Thai language models?
- RQ3What is the relative impact of different tokenization strategies—word-level, syllable-level, and SentencePiece—on sequence and token classification performance in Thai?
- RQ4Can a large-scale, monolingual Thai language model outperform multilingual models like mBERT and XLM-R on Thai-specific benchmarks?
- RQ5How does the choice of tokenizer affect the model's ability to generalize across diverse Thai text domains?
Key findings
- WangchanBERTa-base-att-spm-uncased outperforms NBSVM, CRF, and ULMFit on both multi-class and multi-label sequence classification tasks, achieving a macro F1-score of 0.8155 on the ThaiNER LST20 dataset.
- On the same dataset, the model achieves a macro F1-score of 0.8586 on POS tagging and 0.7519 on NER, significantly outperforming mBERT and XLM-R.
- The model trained with SentencePiece tokenization on the full 78GB dataset achieves the highest performance, demonstrating the effectiveness of large-scale, domain-diverse pretraining.
- Compared to mBERT and XLM-R, WangchanBERTa achieves higher F1-scores across all named entity types in ThaiNER LST20, including 0.9132 for PER and 0.9682 for TITL.
- The ablation study shows that word-level and syllable-level tokenizers underperform SentencePiece, especially on OOV and rare words, highlighting the importance of subword modeling in low-resource settings.
- The model’s performance is robust across diverse domains, with strong results on both social media and formal news text, indicating effective generalization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.