AVocaDo: Strategy for Adapting Vocabulary to Downstream Domain

Jimin Hong, Taehee Kim, Hyesu Lim, Jaegul Choo

Abstract

Pretrained language models typically utilize a static vocabulary during fine-tuning, leading to suboptimal tokenization in specialized downstream domains. We present AVocaDo (Adapt the Vocabulary to downstream Domain), a novel strategy that treats vocabulary as an optimizable component during the fine-tuning phase. By expanding the vocabulary with domain-specific terms and employing contrastive regularization to anchor new embeddings to pretrained knowledge, AVocaDo achieves significant performance improvements—up to +13.01 F1 points—across diverse fields like medicine and computer science without requiring massive additional corpora.

Introduction: The Frozen Vocabulary Problem

In the standard transfer learning pipeline, a model pretrained on a massive general corpus (e.g., Wikipedia) is fine-tuned on a smaller, specialized dataset. While researchers routinely update the model's parameters, the vocabulary is almost always left frozen.

This creates a significant "domain discrepancy." Pretrained models use subword tokenization (like WordPiece) to handle rare words. When a general-purpose model encounters a technical term like "sulfhydration" or "otterbox," it breaks them into semantically disconnected fragments (e.g., blue + ##tooth). While building domain-specific models from scratch (like SciBERT) can solve this, it requires billions of words of data and massive compute resources.

Comparison between standard fine-tuning and the AVocaDo approach which adapts the vocabulary.

The AVocaDo Methodology

AVocaDo shifts the paradigm by treating the vocabulary as a dynamic, optimizable component during fine-tuning. The strategy consists of three core pillars:

1. Vocabulary Expansion via Fragment Score

The authors introduce a "fragment score" ($f_C(V)$), measuring the average number of subwords produced per word in the downstream corpus. A high score indicates unnatural tokenization. AVocaDo iteratively adds the most frequent subword pairs from the downstream data to the vocabulary until the fragment score drops below a predefined threshold ($\gamma$).

2. Smart Initialization

To avoid starting from scratch, new word embeddings are initialized intelligently. For instance, when "bluetooth" is added, its initial embedding is the mean of the embeddings of its original fragments (blue and ##tooth). This preserves the semantic starting point provided by the pretrained model.

3. Contrastive Regularization

To prevent new embeddings from overfitting to small downstream datasets, AVocaDo uses a contrastive learning framework. The model processes the same sentence twice: once using the original vocabulary and once with the adapted vocabulary. The training objective maximizes the agreement between these two representations, effectively "anchoring" new domain-specific words to the rich knowledge already present in the pretrained model.

The AVocaDo architecture showing dual-path encoding for contrastive regularization and embedding initialization.

Experimental Results

The researchers evaluated AVocaDo across four distinct domains: Biomedical (CHEMPROT), Computer Science (ACL-ARC), News (HYPERPARTISAN), and Reviews (AMAZON).

Key Performance Gains

AVocaDo consistently outperformed standard fine-tuning across all tested domains:

  • Computer Science: On the ACL-ARC dataset, BERT-base + AVocaDo saw a +10.46 F1 point improvement.
  • Reviews: On the AMAZON dataset, the performance jump was a staggering +13.01 points.
  • Biomedical: BERT-base + AVocaDo (81.07 F1) outperformed exBERT (74.63 F1), despite exBERT being adapted using nearly a billion words of medical text.

Qualitative Impact

The adapted vocabularies produce much more meaningful subwords. For the term "glucuronidation," the original BERT vocabulary produced 6 fragments; AVocaDo reduced this to 3 semantically relevant chunks, preserving the core meaning of technical terminology.

Conclusion

AVocaDo demonstrates that vocabulary adaptation is a highly efficient alternative to large-scale domain pretraining. By making the vocabulary a first-class citizen of the fine-tuning process, the model can "learn" the language of a specific domain more naturally. While the process adds some computational overhead during fine-tuning due to the dual-path encoding, the massive gains in performance and data efficiency make it a compelling strategy for specialized NLP tasks.

Summary updated

BibTeX
@inproceedings{hong2021avocado,
  author = {Jimin Hong and Taehee Kim and Hyesu Lim and Jaegul Choo},
  title = {{AVocaDo: Strategy for Adapting Vocabulary to Downstream Domain}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.385},
}
Figure