Bilingual Adaptation of Monolingual Foundation Models

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

This paper presents a robust, two-stage recipe for adapting monolingual Large Language Models (LLMs) like Llama 2 and Llama 3 to new languages (specifically Arabic and Hindi) without sacrificing their original English proficiency. By combining vocabulary expansion, novel embedding alignment techniques, and strategic bilingual continual pre-training, the authors demonstrate a cost-effective path to state-of-the-art performance in target languages while maintaining—or even slightly improving—English capabilities.

TL;DR

The authors release a detailed "recipe" for cross-lingual adaptation that solves the twin problems of inefficient tokenization and "catastrophic forgetting." Their approach, which involves vocabulary extension and a two-stage training process, allows a Llama 2 70B model to outperform specialized Arabic models like Jais 30B while retaining its English reasoning skills.

What Problem Does This Paper Address?

Most high-performing open-source LLMs are "English-dominant," trained on corpora where non-English data is a tiny fraction of the total. When researchers try to use these models for other languages, they hit two major walls:

  1. Tokenizer Inefficiency (Fertility): English-centric tokenizers often break a single word in another language into many small sub-tokens or even individual bytes. This "high fertility" makes inference slow, consumes the context window rapidly, and increases training costs.
  2. Catastrophic Forgetting: Continually pre-training a model on a new language often causes it to lose the reasoning and knowledge it acquired in English.

While training a bilingual model from scratch is one solution, it is prohibitively expensive and often results in a model that is weaker in English than the original foundation model.

Methods

The authors propose a two-stage adaptation strategy:

Stage 1: Vocabulary Extension & Embedding Alignment

The team first doubles the Llama 2 vocabulary (from 32k to 64k tokens) by adding the most frequent Arabic tokens. To prevent the model from "tripping" over these new, uninitialized weights, they explored two alignment methods:

  • Similarity-Based Initialization: Initializing new token embeddings by taking a weighted average of the top-k most semantically similar existing English tokens (using external embeddings like OpenAI's text-embedding-3-large).
  • Embedding Space Transformation: Learning a linear projection to map embeddings from a pre-existing bilingual model (Jais-30B) into the Llama 2 embedding space.

This is followed by embedding-only pre-training, where the transformer blocks are frozen, and only the embedding/unembedding layers are updated to align the new tokens' scales and orientations.

Stage 2: Continual Pre-training

The full model is then trained on a bilingual mix. The authors performed extensive ablations on the data mix ratio (e.g., 1:9 vs. 1:1 English-to-Arabic) and learning rate re-warming to find the stability sweet spot.

Datasets

  • Arabic: AraV5, a 140B token corpus including web pages, Wikipedia, news, and high-quality English-to-Arabic translations.
  • English: The Pile, used as "replay" data to mitigate forgetting.
  • Hindi: A curated 65B token corpus from diverse resources.
  • Evaluation: Standard benchmarks like MMLU, RACE, and ARC, translated into Arabic for target-language testing.

Key Insights and Ideas

  • Fertility is a Performance Bottleneck: The authors found that reducing Arabic fertility by ~72% (via vocabulary extension) was crucial. In "iso-token" comparisons (fixing the number of tokens seen), the extended tokenizer outperformed the base Llama 2 tokenizer by about 2%.
  • Alignment Before Training: Simply adding tokens isn't enough. The "Embedding Space Transformation" method significantly lowered the initial training loss compared to random or mean initialization.
  • The 1:9 Rule: For Llama 2 70B, mixing just 1 part English with 9 parts Arabic was sufficient to prevent catastrophic forgetting. Interestingly, for Llama 3 8B, a higher 1:1 ratio was required to maintain stability.
  • Cross-Lingual Transfer is Real: Increasing the amount of English data while keeping Arabic tokens constant actually improved Arabic performance, suggesting the model transfers reasoning capabilities across the language barrier.

Key Results

The results for the Llama 2 70B adaptation are particularly striking. As shown in the tables below, the adapted model significantly improved in Arabic while holding steady in English.

Table 3. Arabic summarized comparisons between: (1) Llama 2 models pre and post adaptation; (2) other notable English-Arabic bilin- gual models: Jais 30b (Sengupta et al., 2023a) and AceGPT (Huang et al., 2024)
Table 4: English performance comparison. The adapted 70B model actually sees a slight improvement in overall average (60.9% vs 60.2%) compared to the base model.

For the Hindi adaptation of Llama 2 13B, the authors observed an 8% improvement on the XNLI-Hindi benchmark compared to the base model, with only a minimal (1.8%) degradation in English.

Limitations and Future Work

  • The "Stability Gap": While Llama 2 was very stable, Llama 3 8B showed a slight (1%) drop in English knowledge tasks, which the authors attribute to a "stability gap" during domain adaptation that requires further study.
  • Low-Resource Languages: The study focused on high-resource languages (Arabic, Hindi). The authors intend to test this recipe on lower-resource languages in the future.
  • Architectural Scaling: Future work will explore combining this adaptation recipe with techniques like "depth-up scaling" to grow the model size during the adaptation process.

Summary updated

BibTeX
@misc{gosal2024bilingual,
  author = {Gurpreet Gosal and Yishi Xu and Gokul Ramakrishnan and Rituraj Joshi and Avraham Sheinin and Zhiming Chen and Biswajit Mishra and Natalia Vassilieva and Joel Hestness and Neha Sengupta and Sunil Kumar Sahu and Bokang Jia and Onkar Pandit and Satheesh Katipomu and Samta Kamboj and Samujjwal Ghosh and Rahul Pal and Parvez Mullah and Soundar Doraiswamy and Mohamed El 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