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:
- 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.
- 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.
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