Bilingual Adaptation of Monolingual Foundation Models

Gurpreet Gosal, Yishi Xu, Gokulakrishnan Ramakrishnan, Rituraj Joshi, Avraham Sheinin, Zhiming Chen, Biswajit Mishra, Sunil Kumar Sahu, Neha Sengupta, Natalia Vassilieva, Joel Hestness, Samujjwal Ghosh, Bokang Jia, Onkar Arun Pandit, Satheesh Katipomu, Samta Kamboj, Rahul Pal, Parvez Mullah, Soundar Balaji Doraiswamy, Karim Chami, Preslav Nakov · DOI

TL;DR

This paper introduces an efficient two-stage method to adapt powerful English-centric Large Language Models (LLMs) to new languages, like Arabic and Hindi. By strategically expanding the model's vocabulary and carefully continuing its training on a mix of languages, they achieve significant improvements in the target language while largely preserving English capabilities, demonstrating cost-effective cross-lingual transfer.

What Problem Does This Paper Address?

The rapid advancement of LLMs has largely focused on English, leading to models with impressive capabilities but limited multilingual support. Adapting these strong English-dominant models to new languages presents several challenges:

  • Catastrophic Forgetting: The model might lose its proficiency in English as it learns the new language.
  • Tokenizer Limitations: Standard English tokenizers are inefficient for other languages, splitting words into many sub-word units, which increases computational cost and reduces context window effectiveness.
  • High Training Costs: Training multilingual models from scratch is prohibitively expensive.

This paper aims to provide an efficient and effective solution for adapting existing monolingual LLMs to new languages, specifically focusing on Arabic and Hindi, while mitigating these challenges.

Methods

The authors propose a two-stage adaptation process:

  1. Vocabulary Expansion and Embedding Alignment:
    • Tokenizer Extension: They extend the existing tokenizer's vocabulary to include tokens for the target language (e.g., Arabic). They experiment with different extension strategies, finding that significantly increasing the vocabulary size (e.g., by 100%) is more effective than replacing existing tokens.
  2. Embedding Initialization: Crucially, they explore novel methods to initialize the embeddings for these new tokens. Simple methods like Xavier or Kaiming initialization are insufficient. They find that "Similarity-Based Token Embedding Initialization" (using external embeddings like OpenAI's to find similar tokens and average their embeddings) and "Embedding Space Transformation" (using embeddings from a pre-trained Arabic-English model like Jais) yield better results.
  3. Embedding-Only Pre-training: After initialization, they perform a stage of pre-training where only the embedding and unembedding layers are updated, keeping the rest of the model frozen. This helps align the embeddings of the new and existing tokens.
  4. Continual Pre-training:
    • The model is then continually pre-trained on a mixed corpus of English and the target language (e.g., Arabic). This stage is critical for acquiring new language capabilities without forgetting the original ones.
  5. They conduct extensive hyperparameter tuning, including data mix ratios (e.g., 1:9 English to Arabic), learning rates, and batch sizes, to optimize performance and prevent catastrophic forgetting.

Datasets

  • Arabic Data: AraV5 dataset (web pages, Wikipedia, news, books, social media), which includes English corpora translated to Arabic.
  • English Data: The Pile corpus (a diverse collection of English text from sources like ArXiv, Wikipedia, CommonCrawl, etc.).
  • Hindi Data: A curated Hindi corpus.

The paper does not introduce new benchmark datasets but uses existing ones for evaluation.

Key Insights and Ideas

  • Vocabulary Expansion is Key: Simply extending the vocabulary with new language tokens is more effective than replacing existing ones, even if it leads to a larger vocabulary.
  • Embedding Initialization Matters Immensely: The way new language token embeddings are initialized significantly impacts downstream performance. Novel methods leveraging external embeddings or existing multilingual models outperform standard initialization.
  • Bilingual Pre-training Balances Capabilities: Continually pre-training on a mix of English and the target language is crucial for acquiring new skills while retaining old ones, preventing catastrophic forgetting.
  • English Data as "Replay" Data: Including a portion of English data in the pre-training mix acts as a form of "replay," helping to mitigate forgetting of English capabilities.
  • Cost-Effective Transfer: This approach offers a significantly more cost-effective way to achieve multilingual capabilities compared to training models from scratch.

Key Results

  • Arabic Adaptation: The adapted Llama 2 models show significant improvements in Arabic downstream tasks. For example, Llama 2 70B adapted achieved a 7.5% improvement in Arabic MMLU compared to its base model.
  • English Preservation/Enhancement: The method not only preserves English capabilities but in some cases slightly enhances them, demonstrating effective cross-lingual transfer.
  • Generalizability: The approach was successfully applied to adapt Llama 3 8B to Arabic and Llama 2 13B to Hindi, showing its broad applicability.
  • State-of-the-Art Comparison: The adapted Llama 2 models outperform other notable English-Arabic bilingual models like Jais and AceGPT on various Arabic downstream tasks.
  • Hindi Adaptation: Llama 2 13B adapted to Hindi showed an 8% improvement on XNLI-Hindi.

Limitations and Future Work

  • Limited Scope of Languages: While demonstrated for Arabic and Hindi, the approach's effectiveness across a wider range of languages and language families is yet to be fully explored.
  • Hyperparameter Sensitivity: The method relies on careful hyperparameter tuning, and finding optimal settings for new language pairs might require extensive experimentation.
  • Future Work: The authors suggest extending the approach to other languages and model architectures, exploring depth-up scaling and adapter layers, and investigating the impact of different data mixes for other language pairs. They also mention the potential for applying this to low-resource languages.

Summary updated

BibTeX
@misc{gosal2024bilingual,
  author = {Gurpreet Gosal and Yishi Xu and Gokulakrishnan Ramakrishnan and Rituraj Joshi and Avraham Sheinin and Zhiming Chen and Biswajit Mishra and Sunil Kumar Sahu and Neha Sengupta and Natalia Vassilieva and Joel Hestness and Samujjwal Ghosh and Bokang Jia and Onkar Arun Pandit and Satheesh Katipomu and Samta Kamboj and Rahul Pal and Parvez Mullah and Soundar Balaji Doraiswamy and Karim Chami and Preslav Nakov},
  title = {{Bilingual Adaptation of Monolingual Foundation Models}},
  year = {2024},
  eprint = {2407.12869},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.12869},
}
Figure