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

Enes Özeren, Yihong Liu, Hinrich Schuetze

Abstract

Many pre-trained language models (PLMs) exhibit suboptimal performance on mid- and low-resource languages, largely due to limited exposure to these languages during pre-training. A common strategy to address this is to introduce new tokens specific to the target languages, initialize their embeddings, and apply continual pre-training on target-language data. Among such methods, OFA proposes a similarity-based subword embedding initialization heuristic that is both effective and efficient. However, OFA restricts target-language token embeddings to be convex combinations of a fixed number of source-language embeddings, which may limit expressiveness. To overcome this limitation, we propose HYPEROFA, a hypernetwork-based approach for more adaptive token embedding initialization. The hypernetwork is trained to map from an external multilingual word vector space to the PLM’s token embedding space using source-language tokens. Once trained, it can generate flexible embeddings for target-language tokens, serving as a good starting point for continual pretraining. Experiments demonstrate that HYPEROFA consistently outperforms random initialization baseline and matches or exceeds the performance of OFA in both continual pre-training convergence and downstream task performance.

Introduction

Pre-trained language models like RoBERTa or XLM-R are incredibly powerful, but they suffer from a "vocabulary bottleneck." If a language wasn't well-represented during the initial pre-training, the model lacks the specific tokens (subwords) and embeddings needed to understand it. The standard fix is to expand the vocabulary and perform continual pre-training. However, initialization matters: naive random initialization forces the model to learn from scratch, leading to slow convergence. While recent methods like OFA use linear combinations of existing words to guess new ones, language is non-linear and complex. HYPEROFA addresses this by using a non-linear hypernetwork to provide a superior "warm start."

Methodology

The core innovation of HYPEROFA is the use of a hypernetwork—a neural network designed to generate the embeddings for the target model.

Overview of the HYPEROFA framework for initializing target language embeddings using a hypernetwork and external word vectors.

The Hypernetwork Pipeline

  1. External Knowledge: The system leverages ColexNet+, a dataset of static multilingual word vectors that act as a universal bridge between languages.
  2. The BiLSTM Hypernetwork: A Bidirectional LSTM is trained to take these external word vectors as input and predict the corresponding internal embedding used by the PLM. It learns the mapping: "Given these external vectors for the English word 'apple', produce the specific internal vector RoBERTa uses for 'apple'."
  3. Embedding Factorization: To handle massive vocabularies efficiently, Singular Value Decomposition (SVD) decomposes the embedding matrix into coordinate and primitive matrices.
  4. Initialization: Once trained on the source vocabulary, the hypernetwork is fed vectors for tokens in the new target language (e.g., Swahili) to generate their initial embeddings.

Key Results and Discussion

HYPEROFA provides significant advantages in both zero-shot performance and training efficiency.

Faster Convergence

Training curves demonstrate that models starting with HYPEROFA begin at a much lower cross-entropy loss and reach higher performance levels faster than those using random initialization. This "warm start" is particularly effective when turning a monolingual model into a multilingual one.

Training cross-entropy loss over time, comparing HYPEROFA with OFA and random initialization across monolingual and multilingual models.

Downstream Performance

After continual pre-training, HYPEROFA matched or exceeded OFA across 22 diverse languages. In sentence retrieval tasks (SR-T), HYPEROFA-multi-400 achieved a score of 56.1 compared to the random baseline's 55.3. The method's ability to break the "linearity barrier" allows it to "hallucinate" more accurate initial meanings for words it has never seen before.

Conclusion

HYPEROFA offers a robust, non-linear alternative for vocabulary expansion in PLMs. By mapping external semantic knowledge into a model's internal space via a hypernetwork, it bypasses the limitations of linear heuristics and the inefficiency of random initialization. Future work will explore scaling this approach to decoder-only models (like GPT) and larger embedding dimensions typical of modern 70B+ parameter models.

Summary updated

BibTeX
@inproceedings{ozeren2025hyperofa,
  author = {Enes Özeren and Yihong Liu and Hinrich Schuetze},
  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