Abstract Scaling law principles indicate a power-law correlation between loss and variables such as model size, dataset size, and computational resources. These principles are vital for optimizing model pre-training, contributing to the success of models like GPT-4 and Llama. However, original disclosures often lack the details needed to derive precise formulas, particularly for larger models. This report confirms that OpenAI's scaling law formulations remain valid up to 33 billion parameters, though constant coefficients vary by setup. We provide a transparent methodology to estimate these constants using models with only 1M–60M parameters, enabling accurate prediction of test loss trajectories and optimal training configurations.
Introduction: The "Black Box" of Scaling
In the development of Large Language Models (LLMs), scaling laws serve as a foundational roadmap. They suggest that model performance improves predictably as parameters and data increase. Yet, for many practitioners, these laws have remained a "black box." While the general power-law form is known, the specific constant coefficients—which dictate the exact performance gains—are often undisclosed or sensitive to specific experimental conditions like learning rates and batch sizes.
Researchers from Meituan Inc. address this gap in their report, "Unraveling the Mystery of Scaling Laws: Part I." They demonstrate that by training tiny "pilot" models (1M to 60M parameters), one can accurately forecast the behavior of models up to 33B parameters—a 600x scale-up.
Methodology: From Tiny Models to Giant Predictions
The researchers propose a three-step methodology to estimate scaling law constants:
- Predicting Converged Loss ($L(N)$): A series of models ranging from 1M to 60M parameters are trained to convergence on "infinite" data. This establishes the relationship between model size ($N$) and the minimum achievable loss.
- Predicting Loss at Infinite Batch Size ($L(N, S_{min})$): By estimating loss relative to training steps ($S$) under an idealized infinite batch size, the team isolates learning efficiency from the noise inherent in finite batches.
- Predicting Real-World Loss ($L(N, S, B)$): Most training uses finite batch sizes ($B$). Using a Taylor expansion of the loss function, the authors derive a conversion between infinite and finite batch steps. Because the resulting formula is non-linear, they employ the bisection method to numerically solve for the predicted loss at any given step.
As shown in the table above, while exponents like $\alpha_N$ may remain consistent with previous literature (e.g., OpenAI's KMH+20), the constant terms such as $N_c$ and $B_*$ vary significantly depending on the dataset and setup. This highlights the necessity of local estimation for accurate forecasting.
Key Results and Validation
The methodology was validated across the C4 web corpus and a 3-trillion-token mixed-language dataset. The results confirm that the power-law shape holds firm up to at least 33B parameters.
The accuracy of these predictions is remarkable. As illustrated in the figure above, the predicted loss trajectories for both a 2B model on C4 and a 33B model on code data closely track the actual training logs after the initial warm-up phase. This capability allows researchers to predict:
- The minimum possible test loss for a specific model size.
- The optimal "critical batch size" that balances training time and compute efficiency.
- The precise number of tokens and steps required to reach a target loss.
Insights for Practitioners
A key takeaway is that there is no "universal constant" for scaling laws. Factors like tokenization, data distribution, and context length shift the coefficients. However, the process for finding these constants is universal and accessible. Furthermore, the mathematical models suggest that compute-optimal training often requires stopping before full convergence, a counter-intuitive but efficient strategy for resource allocation.
Limitations and Future Directions
While highly effective, the current framework has limitations. Predictions are less accurate during the initial "warm-up" phase of training where the learning rate is still ramping up. Additionally, while the general trend holds for out-of-domain data, the actual loss curves exhibit higher volatility than the smooth predicted trajectories. Future work aims to integrate context length directly into the scaling formulas and extend these derivations to Mixture-of-Experts (MoE) architectures.
Summary updated