Introduction
While Large Language Models (LLMs) like Llama-3 exhibit remarkable general capabilities, they often possess significant "knowledge gaps" in specialized domains or non-English languages. For example, Llama-3's performance in Chinese and high-level multidisciplinary science is limited by the underrepresentation of these topics in its original pre-training data.
The standard remedy is Continual Pre-training (CPT), which involves training the model on additional domain-specific data. However, CPT faces two primary hurdles: catastrophic forgetting, where the model loses its original capabilities (e.g., English coding) while learning new ones, and the high computational cost associated with optimizing data mixtures and training curricula.
Methodology
This research introduces a transparent and efficient recipe for CPT, validated through the development of Llama-3-SynE. The approach utilizes a two-stage process: Bilingual Adaptation followed by Synthetic Enhancement.
Data Mixture and Curriculum Design
To optimize the training process, the researchers employed a Topic-based Data Mixture strategy. Web data was categorized by topic, and the model's "perplexity" (a measure of prediction uncertainty) was monitored. If performance on a specific topic plateaued, the data mixture was dynamically adjusted.
Crucially, the study identified a Perplexity-based Curriculum as a key factor in mitigating forgetting. By starting with "easy" data (low perplexity) and gradually introducing "harder" data (high perplexity), the model builds a stable foundation for new knowledge without shocking the existing weights.
Synthetic Data and Surrogate Testing
To enhance reasoning capabilities, the researchers generated 1.5 billion tokens of high-quality synthetic Question-and-Answer (QA) pairs using models like Mistral-7B. This structured data proved far more effective for learning scientific reasoning than raw web text. To manage costs, all exploratory strategies were first tested on a 1.1B surrogate model (TinyLlama) before being scaled to the 8B Llama-3.
Key Insights
The Power of Synthetic Data
Despite comprising only 1.5% of the total 100-billion-token dataset, synthetic QA pairs were responsible for the majority of improvements in scientific and mathematical reasoning. The model demonstrated a high tolerance for noise in this synthetic data, maintaining stable performance until corruption levels exceeded 50%.
Transferability
The success of strategies transferred from a 1.1B model to an 8B model suggests that CPT "recipes" are largely model-agnostic, providing a cost-effective path for researchers to optimize larger architectures.
Results
The resulting Llama-3-SynE model achieved significant gains over the base Llama-3 (8B):
- Chinese Proficiency: Increased by +8.81 points on C-Eval and +6.31 on CMMLU.
- Scientific Reasoning: Improved by +12.00 points on the MATH benchmark and +4.13 on SciEval.
- Capability Retention: The model maintained its English MMLU scores and slightly improved in English coding benchmarks (HumanEval), successfully avoiding catastrophic forgetting.
Conclusion and Future Work
This work provides a reproducible framework for enhancing LLMs through efficient CPT. While highly effective for 8B models, future research will explore the scalability of these methods to 70B+ parameters and investigate how these base model improvements interact with subsequent instruction tuning and human alignment (RLHF).
Summary updated