FOCUS: Effective Embedding Initialization for Monolingual Specialization of Multilingual Models

Konstantin Dobler, Gerard de Melo

Abstract

Using model weights pretrained on a high-resource language as a warm start can reduce the need for data and compute to obtain high-quality language models for other, especially low-resource, languages. However, if we want to use a new tokenizer specialized for the target language, we cannot transfer the source model’s embedding matrix. In this paper, we propose FOCUS - Fast Overlapping Token Combinations Using Sparsemax, a novel embedding initialization method that effectively initializes the embedding matrix for a new tokenizer based on information in the source model’s embedding matrix. FOCUS represents newly added tokens as combinations of tokens in the overlap of the source and target vocabularies. The overlapping tokens are selected based on semantic similarity in an auxiliary static token embedding space. We focus our study on using the multilingual XLM-R as a source model and empirically show that FOCUS outperforms random initialization and previous work on language modeling and on a range of downstream tasks (NLI, QA, and NER). We publish our model checkpoints and code on GitHub.

Introduction

Adapting massive multilingual models like XLM-R to specific target languages—a process known as Language-Adaptive Pretraining (LAPT)—is a common strategy for building high-performance monolingual models. However, these base models often utilize "one-size-fits-all" tokenizers with vocabularies exceeding 250,000 tokens. This leads to significant inefficiencies: the resulting models are unnecessarily large, and training is slowed by the overhead of a massive embedding matrix.

The ideal solution is to replace the generic tokenizer with a streamlined, language-specific one. The primary challenge is that changing the tokenizer renders the original embedding matrix incompatible. While standard practice involves random initialization of the new embeddings, this discards the rich semantic knowledge captured during the original pretraining. FOCUS (Fast Overlapping Token Combinations Using Sparsemax) addresses this by providing a principled way to initialize a new embedding matrix by leveraging the semantic structure of the source model.

Methodology

FOCUS initializes a new embedding matrix by representing new tokens as weighted combinations of "anchor" tokens—tokens that exist in both the source and target vocabularies. The process is illustrated in Figure 1 and follows five primary steps:

  1. Anchor Identification: Identify overlapping tokens present in both the source (multilingual) and target (specialized) vocabularies. These typically include numbers, punctuation, and common cross-lingual terms.
  2. Direct Transfer: Copy the embeddings for these overlapping anchor tokens directly from the source model to the new matrix.
  3. Auxiliary Embedding Training: Train a computationally efficient static embedding model (e.g., fastText) on the target language data using the new tokenizer. This establishes a basic semantic map of the new vocabulary.
  4. Neighbor Selection via Sparsemax: For each new token, identify its semantically similar neighbors among the anchor tokens using the auxiliary fastText map. FOCUS employs Sparsemax to assign weights to these neighbors. Unlike Softmax, Sparsemax produces sparse probability distributions, ensuring that only a few highly relevant neighbors contribute to the initialization.
  5. Weighted Initialization: Initialize the new token's embedding as a weighted average of the original source model's embeddings for the selected neighbors.
Overview of the FOCUS initialization process, showing how target tokens are mapped to pretrained embeddings via overlapping anchor tokens.

Experimental Setup

The researchers evaluated FOCUS across a spectrum of linguistic resources using the CC100 corpus for pretraining:

  • High-resource: German.
  • Medium-resource: Arabic, Kiswahili.
  • Low-resource: Hausa, isiXhosa.
  • Unseen Languages: Scottish Gaelic, Luxembourgish, Cebuano, Samoan, and Hmong.

Downstream performance was benchmarked on XNLI (Inference), GermanQuAD/TyDiQA (Question Answering), and WikiANN/MasakhaNERv2 (Named Entity Recognition).

Key Results and Insights

FOCUS demonstrates significant advantages in both training efficiency and model performance. By replacing the 250k-token XLM-R vocabulary with a 50k language-specific one, the authors produced models that were 55% smaller and trained 40% faster without sacrificing accuracy.

Language Modeling Performance

As shown in Figure 2, FOCUS provides an immediate advantage in Masked Language Modeling (MLM) loss. Right from the start of training, FOCUS-initialized models exhibit lower loss than both random initialization and the previous state-of-the-art method, WECHSEL. This advantage persists throughout the training process across various languages, including those with different scripts or those entirely unseen by the original multilingual model.

MLM loss curves for German, Arabic, and Kiswahili. FOCUS consistently starts with lower loss and maintains a performance lead over Random and WECHSEL baselines.

Downstream Task Superiority

Beyond language modeling, FOCUS-initialized models consistently outperformed baselines on downstream tasks. For instance, in Hausa Named Entity Recognition (NER), FOCUS achieved an F1-score of 86.0, surpassing the random initialization baseline of 85.0. The method's ability to leverage "symbolic overlap" (universal characters like numbers and punctuation) allows it to bridge semantic gaps even for languages with no direct vocabulary overlap in terms of words.

Conclusion and Future Work

FOCUS offers a highly effective and computationally "cheap" method for specializing multilingual models. It eliminates the need for bilingual dictionaries or complex cross-lingual alignment, relying solely on target language data. While this study focused on encoder-only architectures, the results suggest that similar benefits could be realized for decoder-only models. Future research will explore the applicability of FOCUS to generative models and investigate further optimizations for extremely low-resource settings.

Summary updated

BibTeX
@inproceedings{dobler2023focus,
  author = {Konstantin Dobler and Gerard de Melo},
  title = {{FOCUS: Effective Embedding Initialization for Monolingual Specialization of Multilingual Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=INAECMx5dK},
}
Figure