Bridging Subword Gaps in Pretrain-Finetune Paradigm for Natural Language Generation

Xin Liu, Baosong Yang, Dayiheng Liu, Haibo Zhang, Weihua Luo, Min Zhang, Haiying Zhang, Jinsong Su

Abstract

Pre-trained language models typically utilize a fixed vocabulary derived from general-purpose corpora, which often results in excessive subword fragmentation when applied to specialized downstream domains. This "one-size-fits-all" approach introduces exposure bias and increases computational overhead. This paper introduces a "plug-and-play" embedding generator designed to bridge the gap between pre-training and fine-tuning. By leveraging morphological similarities to initialize embeddings for task-specific tokens, the proposed method enables the use of optimal downstream vocabularies. Experimental results across multiple natural language generation tasks demonstrate significant improvements in both translation quality (BLEU scores) and inference efficiency.

Introduction

The prevailing "pretrain-finetune" paradigm in NLP relies on subword tokenization methods like BPE or WordPiece to handle large-scale corpora. However, the resulting fixed vocabularies often fail to represent domain-specific terminology efficiently. For instance, a geology-specific term like "Cenozoic" might be fragmented into "Ce no zo ic" by a general-purpose model like M-BERT. This over-segmentation leads to three primary issues: exposure bias, where the model struggles with the compositionality of fragments; increased computational cost due to longer sequence lengths; and poor representation of frequent downstream terms that were rare during pre-training.

Methodology

To address these bottlenecks, we propose an embedding transfer step situated between pre-training and fine-tuning. This allows downstream tasks to adopt their own optimal vocabularies. The core of this approach is an Embedding Generator that initializes embeddings for "new" tokens by mapping them to morphologically related subwords and hyperwords already present in the pre-trained vocabulary.

Overview of the Pretrain-Finetune paradigm with the proposed Embedding Generator.

We explored several generator architectures:

  • AVG-EG: Computes a simple average of embeddings from morphologically similar tokens.
  • ATT-EG: Utilizes an attention mechanism to fuse information from related tokens.
  • PATT-EG: A position-aware attention generator that distinguishes between prefixes, infixes, and suffixes, capturing nuanced linguistic meaning more effectively.

To ensure these generated embeddings align with the pre-trained model's latent space, we employ knowledge distillation, training the generator to minimize the divergence between the model's hidden states when processing original versus generated tokens.

Experimental Setup

The strategy was evaluated on several Natural Language Generation (NLG) tasks, including domain adaptation (English to Chinese) using the UM-Corpus (Thesis and Laws domains), machine translation (English to German) on WMT14, and question generation on SQuAD v1.1. The experiments utilized M-BERT and M-BART as the underlying pre-trained models.

Results and Discussion

The proposed PATT-EG model, combined with knowledge distillation, consistently outperformed standard baselines. In the Thesis domain adaptation task, our method achieved a BLEU score of 37.90, a substantial improvement over the 30.21 achieved by the standard pretrain-finetune baseline.

Comparison of BLEU scores across different vocabulary and embedding strategies.

Beyond performance gains, the use of task-specific vocabularies reduced average sequence lengths, leading to significant efficiency improvements. For the En⇒De task, inference speed nearly doubled, increasing from approximately 26 to 50 sentences per second. Furthermore, the embedding generator is highly efficient, requiring only about two hours of training compared to the forty hours typically needed for full model fine-tuning.

Conclusion

This work demonstrates that vocabulary flexibility is a critical yet often overlooked factor in model performance. By treating vocabulary as a dynamic architectural component rather than a static constraint, we can significantly improve the adaptation of pre-trained models to specialized domains. Future work will explore the applicability of this method to other tasks such as code generation and abstractive summarization, as well as its effectiveness across diverse language families.

Summary updated

BibTeX
@inproceedings{liu2021bridging,
  author = {Xin Liu and Baosong Yang and Dayiheng Liu and Haibo Zhang and Weihua Luo and Min Zhang and Haiying Zhang and Jinsong Su},
  title = {{Bridging Subword Gaps in Pretrain-Finetune Paradigm for Natural Language Generation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.468},
}
Figure