BamiBERT: A New BERT-based Language Model for Vietnamese

Dat Quoc Nguyen, Thinh Pham, Chi Tran, Linh The NguyenarXiv 2026

TL;DR

BamiBERT is a new state-of-the-art Vietnamese language model that fixes the two biggest headaches of its predecessor, PhoBERT: short context windows and mandatory word segmentation. By training from scratch on a massive 129GB corpus, it achieves top-tier performance across a wide range of tasks while supporting sequences up to 2048 tokens—an 8x increase over previous standards.

What Problem Does This Paper Address?

For years, PhoBERT has been the "de facto" choice for Vietnamese NLP. However, as the field moves toward processing longer documents and more complex reasoning, PhoBERT’s limitations have become apparent. Specifically, it supports a maximum context length of only 256 tokens, which is insufficient for many real-world applications. Furthermore, PhoBERT requires input text to be pre-processed by an external word segmenter. This adds complexity to the deployment pipeline and risks propagating errors from the segmenter into the language model.

BamiBERT was developed to provide a modern, flexible, and high-performance alternative that operates directly on raw text and handles significantly longer sequences.

Methods

BamiBERT follows the classic BERT "base" architecture, featuring 12 Transformer block layers. To train the model, the authors adopted the RoBERTa pre-training approach, which utilizes a dynamic masking strategy for the Masked Language Modeling (MLM) objective and removes the Next Sentence Prediction task.

Key technical choices include:

  • Tokenizer: They extended the Vietnamese-specific byte-level BPE tokenizer from PhoGPT, resulting in a vocabulary of 20,481 token types.
  • Context Window: The model was configured for a maximum sequence length of 2048 tokens.
  • Training Regime: The model was trained from scratch for 20 epochs on 8 A100 GPUs using a batch size of 1024.

Crucially, BamiBERT eliminates the need for word segmentation, processing subword tokens directly from raw Vietnamese text.

Datasets

The model was pre-trained on a 129GB corpus of uncompressed, general-domain Vietnamese text.

For evaluation, the authors tested BamiBERT against four strong baselines (ViDeBERTa, ViSoBERT, XLM-RoBERTa, and PhoBERT) across eight diverse benchmark datasets, ranging from general-domain text to social media and forum discussions. The statistics for these evaluation datasets are summarized below:

Statistics of the 8 experimental datasets used for evaluation.

Key Insights and Ideas

  • Raw Text is Sufficient: BamiBERT proves that a well-trained subword-level model can outperform models that rely on manual word segmentation. This simplifies NLP pipelines significantly for Vietnamese developers.
  • Cross-Domain Robustness: Despite being trained on general-domain text, BamiBERT showed remarkable performance on social media benchmarks (like ViSpamReviews and UIT-ViSFD), often beating models specifically tuned for those domains.
  • The Power of Scale: By increasing the training data to 129GB (compared to PhoBERT's 20GB), the authors achieved substantial gains in semantic understanding, particularly evident in Natural Language Inference (NLI) tasks.
  • Efficiency vs. Performance: As a "base"-sized model, BamiBERT demonstrates that specialized, high-quality monolingual models can still deliver state-of-the-art performance at a fraction of the computational cost of massive Large Language Models (LLMs).

Key Results

BamiBERT established a new state of the art for "base"-sized Vietnamese encoders, achieving the best score on 11 out of 15 evaluation metrics.

Comparison of BamiBERT against baseline models across 8 benchmarks. BamiBERT achieves SOTA on the majority of metrics.

Notable highlights include:

  • ViNLI: A massive jump in performance, gaining +3.01 in Accuracy and +3.10 in F1 score over the previous leader, PhoBERT.
  • Aspect-Based Sentiment Analysis (ABSA): BamiBERT excelled at aspect detection, outperforming all other models in the Restaurant and Hotel domains.
  • Consistency: Unlike some baselines that performed well on one task but poorly on others (e.g., ViDeBERTa), BamiBERT remained a top-tier performer across all eight benchmarks.

Limitations and Future Work

While BamiBERT is highly robust, the authors noted a few specific areas where it didn't take the top spot. In the Hotel domain for aspect-based sentiment classification, it trailed slightly behind ViSoBERT and PhoBERT. The authors suggest this might be because domain-specific nuances in hotel reviews benefit more from domain-adapted pre-training.

The paper does not explicitly detail future work, but the release of the model on HuggingFace suggests the authors intend for the community to build upon this foundation through further fine-tuning and integration into hybrid LLM systems.

Summary updated

BibTeX
@misc{nguyen2026bamibert,
  author = {Dat Quoc Nguyen and Thinh Pham and Chi Tran and Linh The Nguyen},
  title = {{BamiBERT: A New BERT-based Language Model for Vietnamese}},
  year = {2026},
  eprint = {2607.02259},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.02259},
}
Figure