TL;DR
This paper introduces MiniCPM, a family of Small Language Models (SLMs) that achieve performance comparable to much larger models (7B-13B LLMs) with significantly fewer parameters (1.2B and 2.4B). They achieve this through novel scalable training strategies, including a "wind tunnel" for hyperparameter optimization and a Warmup-Stable-Decay (WSD) learning rate scheduler, enabling efficient exploration of data-model scaling laws.
What Problem Does This Paper Address?
The current trend in AI is towards ever-larger Large Language Models (LLMs) with trillions of parameters. While powerful, these models are incredibly expensive to train and deploy, making experimentation and widespread use challenging. This paper addresses the need for resource-efficient alternatives that can still deliver high performance. The authors aim to unlock the potential of Small Language Models (SLMs) by developing scalable training methodologies that not only improve SLMs but also inform the development of future LLMs. They highlight two key areas for improvement in existing SLMs: achieving comprehensive abilities comparable to LLMs and developing transparent, scalable training methods.
Methods
The authors introduce several key methodological innovations:
- MiniCPM Models: Specifically, they present 1.2B and 2.4B non-embedding parameter variants.
- Model Wind Tunnel Experiments (MWTE): This involves extensive hyperparameter optimization experiments on smaller models to discover stable and optimal scaling configurations before applying them to larger models. This is analogous to wind tunnel testing in aerospace engineering.
- Warmup-Stable-Decay (WSD) Learning Rate Scheduler (LRS): This novel scheduler divides training into three stages: warmup, stable training, and decay. It's designed for continuous training and domain adaptation, allowing for efficient reuse of intermediate checkpoints. The paper provides an in-depth analysis of the training dynamics observed with WSD LRS.
- Scalable Data-Model Scaling Law Analysis: The WSD LRS enables efficient study of data-model scaling laws. By decoupling the axes of model and data scaling, they can derive compute-optimal data-to-model ratios more efficiently than traditional methods.
- MiniCPM Family Extensions: Beyond the base models, they introduce MiniCPM-DPO (for preference alignment), MiniCPM-MoE (Mixture-of-Experts), and MiniCPM-128K (for long context).
Datasets
The paper mentions the use of several datasets for training and evaluation:
- Training Data: CommonCrawl (English and Chinese variants), C4, Pile, Code Pre-train (Stack, StarCoder), Open Web Math, Arxiv, peS20, Dolma, UltraChat, SlimOrca, OssInstruct, EvolInstruct, Knowledge SFT, Book Chinese, K12 textbooks, and proprietary datasets.
- Evaluation Datasets: C-Eval, CMMLU, MMLU, HumanEval, MBPP, GSM8K, MATH, HellaSwag, ARC-e, ARC-c, BBH. They also utilize MT-Bench and ∞Bench for evaluating specific capabilities.
Key Insights and Ideas
- SLMs Can Rival LLMs: MiniCPM models demonstrate that SLMs, when trained with sophisticated strategies, can achieve performance comparable to much larger 7B-13B LLMs. This challenges the notion that sheer parameter count is the sole determinant of capability.
- WSD LRS Enables Efficient Training Dynamics: The Warmup-Stable-Decay scheduler leads to a dramatic loss decrease in the decay stage, allowing for continuous training and efficient checkpoint reuse. It also facilitates a more scientific and efficient study of scaling laws.
- Data-Model Ratio is Crucial and Higher Than Previously Thought: Their analysis suggests a significantly higher compute-optimal data-to-model ratio than what was proposed by Chinchilla Optimal, indicating that models can benefit from even more data than previously assumed for optimal performance at a given compute budget.
- Specialization in Decay Stage is Beneficial: Introducing high-quality, specialized data (like SFT data) during the decay stage of training yields better results than simply adding it during the SFT phase. This suggests a more targeted approach to model enhancement.
- Scalability is Key: The paper emphasizes that their training methodologies are scalable in both model and data dimensions, offering a path forward for future LLM research.
Key Results
- MiniCPM-1.2B and MiniCPM-2.4B models achieve performance on par with or exceeding 7B-13B LLMs like Llama2-7B/13B and Mistral-7B across various benchmarks.
- MiniCPM-2.4B-DPO surpasses larger models like Llama2-70B-Chat on MT-Bench.
- MiniCPM-2.4B-128K achieves comparable results to models like Yarn-Mistral-7B-128K and outperforms ChatGLM3-6B-128K on long-context tasks, despite being smaller.
- The WSD LRS allows for efficient data-model scaling law analysis, revealing a much higher compute-optimal data-to-model ratio than previous work.
- MiniCPM models are deployable on mobile devices, with MiniCPM-2.4B (quantized to 4-bit) fitting into 2GB and achieving up to 18 tokens/sec on an iPhone 15 Pro.
Limitations and Future Work
- LLM Validation: The paper focuses on SLMs and does not extend the study of the scaling law to LLMs to validate it further.
- WSD LRS on LLMs: The application of the WSD LRS on LLMs has not been fully explored.
- Future Directions: The authors suggest future work on in-depth analysis of the loss decrease in the decay stage, enhancing MiniCPM's capabilities by scaling in both model and data size, and further exploring the optimization space of the WSD scheduler.
Summary updated