TL;DR
This paper introduces DeepSeek LLM, a new family of open-source large language models trained on a massive 2 trillion token dataset in English and Chinese. By meticulously studying scaling laws, the authors developed a novel strategy for allocating model and data scales, leading to impressive performance gains, particularly in code, math, and reasoning, outperforming LLaMA-2 70B and rivaling GPT-3.5.
What Problem Does This Paper Address?
The rapid advancement of large language models (LLMs) has been a defining feature of recent AI progress. However, a significant challenge lies in understanding and applying "scaling laws" – the principles that govern how model performance improves with increased compute, data, and model size. Previous research on scaling laws has yielded conflicting conclusions, creating uncertainty about how to best allocate resources for training increasingly powerful LLMs. This paper aims to resolve these ambiguities by conducting a thorough investigation into scaling laws, particularly for open-source models, and using these insights to build a new, high-performing LLM family.
Methods
The core of this work lies in a deep dive into scaling laws. The authors first investigated the scaling of hyperparameters, identifying that batch size and learning rate are critical and can be modeled with power laws related to compute budget. They then employed an "IsoFLOP profile" approach, similar to Chinchilla, to analyze model and data scaling. A key methodological innovation is the adoption of "non-embedding FLOPs/token" (M) as a more accurate representation of model scale compared to traditional parameter counts. This allowed for a more precise estimation of optimal model and data allocation strategies.
The training process itself involved:
- Pre-training: A massive 2 trillion token dataset was curated, emphasizing both English and Chinese. The architecture largely follows LLaMA, with modifications to the learning rate scheduler.
- Supervised Fine-Tuning (SFT): The models were fine-tuned on 1.5 million instruction data instances in English and Chinese, covering general language, math, and coding.
- Direct Preference Optimization (DPO): This technique was used to further enhance conversational abilities and alignment, leveraging preference data for helpfulness and harmlessness.
Datasets
- Pre-training: A custom dataset of 2 trillion tokens, primarily in English and Chinese.
- SFT: Approximately 1.5 million instruction data instances in English and Chinese.
- DPO: Preference data constructed for helpfulness and harmlessness.
- Evaluation: A wide array of public benchmarks were used, including MMLU, C-Eval, CMMLU, HellaSwag, PIQA, ARC, OpenBookQA, BigBench Hard, TriviaQA, NaturalQuestions, RACE, DROP, GSM8K, MATH, HumanEval, MBPP, AGIEval, CLUEWSC, CHID, CMath, and CCPM. They also introduced their own ChineseQA test set.
Key Insights and Ideas
- Data Quality Matters: The study revealed that the quality of the pre-training data significantly influences the optimal model/data scaling strategy. Higher quality data allows for more compute budget to be allocated to model scaling, suggesting that better data can drive the training of larger, more capable models.
- Model Scale Representation: Using "non-embedding FLOPs/token" (M) as a measure of model scale proved more accurate for predicting performance and optimal allocation than traditional parameter counts. This is because it better accounts for computational overheads like attention.
- Hyperparameter Scaling Laws: The optimal batch size and learning rate can be predictably modeled as power laws of the compute budget, providing a framework for efficient hyperparameter selection across different scales.
- Language Conflict Impact: Smaller models showed a greater performance disparity when dealing with multilingual data, suggesting that language conflict has a more pronounced effect on smaller model architectures.
- DPO Enhances Generation: Direct Preference Optimization (DPO) was found to strengthen open-ended generation skills without significantly compromising performance on standard benchmarks.
Key Results
- LLaMA-2 70B Outperformed: DeepSeek LLM 67B demonstrated superior performance compared to LLaMA-2 70B across various benchmarks, particularly in code, mathematics, and reasoning.
- GPT-3.5 Level Performance: DeepSeek LLM 67B Chat achieved performance comparable to GPT-3.5 in open-ended evaluations in both Chinese and English.
- Strong Math and Code Capabilities: The models showed significant improvements in math and coding tasks after fine-tuning, with HumanEval and GSM8K scores improving by over 20 points.
- Safety: The DeepSeek 67B Chat model exhibited good security performance across numerous safety test categories and achieved a high safety score on the "Do-Not-Answer" dataset, surpassing ChatGPT and GPT-4.
- Scaling Laws Validation: The developed scaling laws accurately predicted the performance of DeepSeek LLM 7B and 67B models, demonstrating their predictive power.
Limitations and Future Work
- Chinese Data Exhaustiveness: The authors acknowledge that their initial Chinese data might not be exhaustive, potentially leading to suboptimal performance on certain Chinese-specific topics.
- Other Languages: Due to the primary focus on Chinese and English data, the model's proficiency in other languages remains delicate and requires caution.
- Future Work: The team plans to release technique reports on code intelligence and Mixture-of-Experts (MoE). They are also working on a larger, improved dataset for the next version of DeepSeek LLM to enhance reasoning, Chinese knowledge, math, and code capabilities. Further research into reinforcement learning for complex reasoning is also planned.
Summary updated