Introduction
Determining the optimal training data composition for Large Language Models (LLMs) is one of the most significant challenges in modern AI development. The specific mixture of code, academic papers, web text, and literature—often referred to as the "data recipe"—profoundly influences a model's final capabilities. However, identifying the ideal proportions is traditionally a prohibitively expensive process of trial and error. This paper introduces a novel framework for Modular Training and Merging, which allows researchers to simulate thousands of potential data mixtures at a fraction of the traditional computational cost.
The Challenge of Data Ablation
In standard LLM training, evaluating the impact of a specific dataset (data ablation) requires training a full model on that specific mixture. If a researcher wishes to test how adding biology papers or removing specific web crawls affects performance, they must commit to a complete training run.
As the number of potential data sources ($n$) grows, the search space for the optimal mixture expands exponentially ($2^n$). For most organizations, training dozens or hundreds of model variants to find the best recipe is computationally and financially impossible. Consequently, most practitioners rely on heuristics or sub-optimal "best guesses."
Methodology: Modular Training and Merging
The authors propose a two-step strategy to transform this exponential search problem into a linear one:
- Modular Training: Instead of training a single model on a massive, combined dataset, the training corpus is divided into discrete "base units" (e.g., 1 billion tokens each). Separate, identical models are then trained independently on each unit.
- Parameter Merging: To evaluate a specific candidate mixture, the weights of the models trained on the relevant units are simply averaged.
The core hypothesis is that the perplexity—a standard metric for how well a model predicts text—of this "merged" proxy model will strongly correlate with the perplexity of a model trained sequentially on that exact data mixture. By using the merged model as a proxy, researchers can evaluate a mixture's potential without ever actually training on it.
Experimental Framework
The researchers validated this approach using several diverse datasets and benchmarks:
- S2ORC: The Semantic Scholar Open Research Corpus, partitioned by field of study and publication year.
- M2D2 Wikipedia: Wikipedia text organized into top-level topical domains.
- Paloma: A benchmark for out-of-distribution (OOD) evaluation to test generalization.
- Seed Data: To ensure a common optimization starting point, all modular models were initialized from a "seed" model pre-trained on 42 billion tokens of Gutenberg books and English Wikipedia.
Key Findings
High Correlation and Reliability
The study found that the performance of merged proxy models is remarkably predictive of actual training outcomes. Pearson correlation scores between the proxy models and sequentially trained models often exceeded 0.95. On the Paloma benchmark for out-of-distribution data, the correlation reached as high as 0.984. This suggests that if a merged proxy indicates that Mixture A outperforms Mixture B, the result is highly likely to hold true in a full-scale training run.
Cross-Scale Predictability
In a significant finding for efficiency, the authors demonstrated that proxy evaluations using smaller models (130M parameters) were predictive of how larger models (1.1B parameters) would perform on the same data mixtures. In some instances, the 130M parameter proxy was even more predictive of 1.1B model performance than the 130M model’s own sequential training results, likely because the merging process helps filter out stochastic training noise.
Massive Computational Savings
The efficiency gains of this method are substantial. In a scenario involving 128 data partitions, a traditional search for the best 3-way mixture would require training over 340,000 models, costing approximately 5 million GPU hours. Using the modular approach, the same search requires only 128 modular models and roughly 81,000 GPU hours—a 60x reduction in cost.
Discussion and Future Work
While the results are promising, the authors note several areas for further investigation:
- The Role of the Seed: The modular models in this study shared a 42B token seed. It remains to be seen if the method is as effective when models are trained modularly from random initialization.
- Perplexity vs. Downstream Tasks: The study focused on perplexity as the primary metric. Future research is needed to determine if these proxies accurately predict performance on specific downstream tasks like coding or logical reasoning.
- Scaling to Frontier Models: The experiments reached the 1.1 billion parameter scale. Testing the behavior of parameter merging at the scale of 70B+ or 400B+ parameters is a critical next step.
- Ratio Optimization: Current experiments focused largely on the binary inclusion of data. Future work could explore using merging to predict the effects of specific percentage-based ratios within a mixture.
By turning data ablation into a linear-cost operation, Modular Training and Merging offers a scalable path toward more scientific and optimized LLM data curation.
Summary updated