TL;DR
This paper introduces a cost-effective, model-agnostic method to improve the performance of large language models (LLMs) on underrepresented languages. By customizing tokenizers to expand vocabulary for target languages while preserving English capabilities, they achieve better grammar, reduced code-switching, and lower computational costs, making LLMs more equitable and accessible.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown impressive cross-lingual understanding, but their performance often drops significantly for languages that are not well-represented in their training data and vocabularies. This "curse of multilinguality" is exacerbated by the fact that many LLMs are primarily trained on English, leading to issues like:
- Higher computational costs: Languages with less efficient tokenization require more tokens to represent the same text, increasing memory usage and computation time.
- Performance degradation: Models struggle to accurately represent nuances of underrepresented languages, leading to errors like generating non-existent words, code-switching, and broken grammar.
- Bias towards dominant languages: LLMs tend to default to English, even when prompted in other languages.
This paper aims to mitigate these issues by developing bilingual LLMs that are effective for both English and a target underrepresented language, without requiring massive computational resources or training from scratch.
Methods
The authors propose a three-step, model-agnostic pipeline:
- Vocabulary Extension: This is the core innovation. Instead of retraining an entire LLM, they create a new bilingual tokenizer. This tokenizer preserves the original English tokenization and vocabulary but expands it with tokens specific to the target language. This is achieved by training a new tokenizer on the target language and then merging it with the original one. Crucially, they ensure that English tokens are not removed, preserving English capabilities.
- Embeddings Initialization: New tokens added to the vocabulary require new embedding vectors. The paper explores several initialization techniques and settles on "Natural Character Overlap Segmentation" (NACHOS), which initializes new token embeddings by averaging the embeddings of existing tokens that form the new token. This method showed better convergence during training.
- Continual Pre-training: The LLM, now equipped with the extended vocabulary and initialized embeddings, undergoes further pre-training on bilingual parallel corpora. This step helps the model learn to effectively use the new tokens and adapt to the target language.
Datasets
The paper utilized several datasets for training and evaluation:
- Tokenizer Training:
- Ukrainian: UberText 2.0 (publicly available, 3.274B words)
- Arabic: A private dataset of non-fiction books (430 million words), with additional preprocessing including light stemming and handling of prefixes.
- Georgian: Georgian section of the public OSCAR dataset (171.9M words).
- Continual Pre-training:
- Ukrainian/Arabic: Wikipedia parallel dataset dumps (approx. 2B tokens for Ukrainian, 1.8B for Arabic).
- Georgian: Parallel corpora from the same dump, but smaller due to data sparsity.
- Evaluation:
- FLORES-200 dataset for evaluating translation quality.
- Custom datasets for evaluating grammar correctness, code-switching, and non-existing words. For NEWR and CSWR, they created specific corpora for Ukrainian and Arabic.
Key Insights and Ideas
- Vocabulary is Key: The paper strongly emphasizes that vocabulary size and composition are critical factors influencing LLM performance, especially for underrepresented languages. A limited vocabulary forces models to rely more on context, increasing noise and hindering the learning of nuanced meanings.
- Preserving English is Crucial: The method's success hinges on its ability to expand target language vocabulary without sacrificing English proficiency. This is achieved by carefully merging tokenizers and ensuring English tokens are retained.
- Cost-Effective Improvement: The approach offers a significant performance boost for target languages with substantially lower computational costs compared to training models from scratch or extensive fine-tuning.
- Tokenization Fertility Matters: Improving tokenization fertility (fewer tokens per word) directly translates to reduced computational costs and faster inference.
- NACHOS Initialization: The proposed NACHOS embedding initialization method shows promise for faster and more stable training convergence.
Key Results
The authors demonstrated significant improvements across several metrics:
- Grammar Correctness Score (GCS): For Ukrainian, their model achieved a GCS of 0.503, outperforming the vanilla model (0.264) and a tuned model (0.388). For Arabic, their model reached 0.548, a substantial improvement over vanilla (0.04) and tuned (0.238) models.
- Non-Existing Words Ratio (NEWR): For Ukrainian, their model achieved 3% NEWR, comparable to the tuned model (3.2%). For Arabic, their model achieved 5% NEWR, a dramatic improvement over the vanilla model (86.3%).
- Code Switching Word Ratio (CSWR): For Ukrainian, their model achieved an excellent score of 0.001, compared to 0.515 for the vanilla model. For Arabic, the score was 0.002, significantly better than the vanilla model's 0.45.
- Tokenizer Fertility: For Ukrainian and Arabic, the extended vocabularies significantly reduced tokenizer fertility, meaning fewer tokens were needed to represent text, leading to improved computational efficiency.
- English Performance Retention: Experiments showed that with careful tuning (specifically, lowering the learning rate), the models could retain their English performance on benchmarks like MMLU, even after extensive training on target languages.
Limitations and Future Work
The authors acknowledge several limitations:
- Model Agnosticism: While the approach is model-agnostic, it was primarily tested on Mistral 7B and Gemma 2. Further validation with other open-source models (e.g., Llama 3, Qwen) is needed.
- Language Coverage: The method was fully tested for English-Ukrainian and English-Arabic. Due to limited Georgian corpora, the English-Georgian experiment was incomplete. English capability retention was also only tested for Ukrainian.
- Vocabulary Size and Composition: Further experiments are needed to find optimal vocabulary sizes and compositions, and their dependence on dataset size and language properties.
- Downstream Tasks: The current work focuses on base completion models. Evaluating the proposed method on downstream tasks like machine translation, summarization, or question answering would provide a more comprehensive assessment.
- Metrics Refinement: The proposed metrics for language quality, particularly code-switching, could benefit from further refinement and the addition of more language-specific rules.
Future work could involve testing the approach on a wider range of models and languages, exploring more sophisticated vocabulary strategies, and evaluating performance on diverse downstream NLP tasks.
Summary updated