HYPEROFA: Expanding LLM Vocabulary to New Languages via Hypernetwork-Based Embedding Initialization

Enes Özeren, Yihong Liu, Hinrich Schütze · DOI

Abstract

Adapting Pre-trained Language Models (PLMs) to new languages typically involves expanding the model's vocabulary and initializing new token embeddings. Traditional methods rely on random initialization or linear heuristics, which often fail to capture the complex semantic relationships between different embedding spaces. This paper introduces HYPEROFA, a hypernetwork-based approach that learns a non-linear mapping from external multilingual word vectors to a model's internal embedding space. By providing a semantically informed "smart start," HYPEROFA achieves faster convergence and superior performance across diverse downstream tasks, particularly for low-resource languages and monolingual model adaptation.

1. Introduction

When extending a Pre-trained Language Model (PLM) like RoBERTa to a new language, the standard procedure involves adding language-specific tokens to the tokenizer. However, these new tokens lack pre-existing semantic information. The conventional approach—random initialization—is computationally expensive, as the model must learn basic semantic relationships from scratch during continual pre-training.

Recent advancements, such as the One-For-All (OFA) method, attempt to initialize these embeddings using a weighted average of existing source tokens. While OFA improves upon random noise, it is constrained by a linear assumption: it treats the relationship between external linguistic data and internal model representations as flat and simple. HYPEROFA addresses this limitation by utilizing a hypernetwork to model the non-linear complexities inherent in high-dimensional embedding spaces.

2. Methodology

2.1 Hypernetwork Mapping

The core of HYPEROFA is a hypernetwork ($HN_\theta$) designed to generate embeddings for new tokens. Instead of relying on internal model heuristics, the system maps vectors from an external, well-aligned multilingual space (ColexNet+) into the PLM’s internal token space.

2.2 Training and Architecture

The hypernetwork is trained using "source tokens"—vocabulary items already present in the PLM. During training, the network takes the external ColexNet+ vectors for these known words and attempts to predict the model's actual internal embeddings.

Interestingly, the authors found that a BiLSTM architecture outperformed Transformer-based alternatives (such as Setformer). Because a single token may correspond to multiple external word vectors, the BiLSTM processes these as sets. To maintain permutation invariance—ensuring the order of matched external words does not bias the output—the training process incorporates random shuffling of these input sets. This inductive bias proved more effective than the data-intensive requirements of Transformers given the relatively small scale of available token pairs (22k to 103k).

2.3 Efficient Factorization

To manage the expansion to a 401k-token vocabulary without a prohibitive increase in parameters, the authors employed Singular Value Decomposition (SVD). This factorization of the embedding matrix allows the model to handle massive vocabularies while maintaining computational efficiency.

3. Experimental Setup

3.1 Data and Tokenization

  • External Vectors: ColexNet+, featuring static word vectors for over 4 million words across 1,000+ languages.
  • Tokenizer: The Glot500-m tokenizer, covering 500+ languages with a 401k vocabulary size.
  • Pre-training Data: A 1.1-billion-token subset of Glot500-c, spanning 22 diverse languages across various resource levels.

3.2 Evaluation Benchmarks

The framework was evaluated on several cross-lingual tasks:

  • Sentence Retrieval: Tatoeba (SR-T) and the Bible corpus (SR-B).
  • Sequence Labeling: WikiANN for Named Entity Recognition (NER) and Universal Dependencies for Part-of-Speech (POS) tagging.

4. Key Results and Insights

4.1 Superior Initialization

HYPEROFA consistently outperformed random initialization across all benchmarks. On the SR-B retrieval task using a monolingual model, HYPEROFA achieved a score of 5.0 prior to any pre-training, compared to 4.5 for OFA and 3.5 for random initialization. This suggests that the non-linear mapping captures semantic nuances that linear heuristics miss.

4.2 Impact on Monolingual vs. Multilingual Models

The performance gains were most significant when adapting monolingual models (e.g., English RoBERTa). While multilingual models like XLM-R possess some inherent robustness to new tokens due to their diverse training data, monolingual models benefit immensely from the "smart start" provided by the hypernetwork, effectively bridging the gap between isolated language spaces.

4.3 Training Efficiency

Analysis of training loss curves indicated that HYPEROFA-initialized models start at a significantly lower loss and converge more rapidly. This efficiency translates to reduced compute requirements for language adaptation, as the model requires fewer steps to reach peak performance.

5. Conclusion and Limitations

HYPEROFA demonstrates that hypernetworks are a powerful tool for vocabulary expansion, offering a more sophisticated alternative to linear embedding initialization. By leveraging external multilingual knowledge through a non-linear lens, it facilitates the rapid adaptation of LLMs to new languages.

However, several areas remain for future exploration. This study focused exclusively on encoder-only architectures; the applicability to decoder-only models (like GPT) is yet to be determined. Additionally, the use of SVD factorization limited embedding dimensions to 400; further research is needed to see if these advantages scale to the much larger dimensions used in state-of-the-art LLMs. Finally, while initial convergence is faster, long-term multi-epoch training is required to see if the initialization advantage persists indefinitely or eventually plateaus.

Summary updated

BibTeX
@inproceedings{ozeren2025hyperofa,
  author = {Enes Özeren and Yihong Liu and Hinrich Schütze},
  title = {{HYPEROFA: Expanding LLM Vocabulary to New Languages via Hypernetwork-Based Embedding Initialization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=Gv2wWcd78g},
}
Figure