TL;DR
Finding the perfect "recipe" of training data (e.g., how much code versus how much math) is a major bottleneck in training large language models (LLMs). This paper unifies existing data-mixing algorithms into a single mathematical framework and introduces Aioli, a new method that dynamically learns optimal data proportions during training without requiring expensive extra runs, consistently outperforming standard baselines.
Introduction
When training an LLM, practitioners do not simply dump all available data into a single bucket. Training corpora consist of distinct "groups"—such as web crawls, GitHub code, scientific papers, and legal documents. The ratio of these groups (the "data mix") drastically alters the model's final capabilities.
Currently, practitioners either use stratified sampling (mixing everything in fixed, uniform proportions) or complex algorithms to find an "optimal" mix. However, the authors discovered a surprising reality: most of these advanced algorithms fail to consistently beat simple uniform mixing. The problem is that finding the right mix usually requires either a computationally prohibitive "brute force" search or relies on hidden assumptions about how data groups interact that do not hold up in practice.
Methods
The Linear Mixing Optimization (LMO) Framework
The authors first propose the Linear Mixing Optimization (LMO) framework. They prove that popular methods like DoReMi, Skill-It, and DoGE are fundamentally solving the same optimization problem: minimizing loss based on a "mixing law."
The critical insight was realizing that while the math of these mixing laws was sound, the parameters (the values representing how one data group affects another) were being estimated inaccurately by existing methods.
Introducing Aioli
To address these estimation inaccuracies, the authors developed Aioli.
Key features of Aioli include:
- Online Estimation: Unlike offline methods that require multiple full training runs to "guess" the right mix, Aioli learns the mix during the main training run.
- Interleaved Probing (LEARNPARAMS): Within a single training round, Aioli spends a small fraction of time training on different data mixtures in an interleaved fashion (similar to time-division multiplexing in signals). This allows it to directly measure how different groups impact the model's loss.
- Dynamic Adjustment: It uses Exponentiated Gradient Descent (EGD) to update the data proportions for the next round based on the measured interactions.
Datasets
The researchers evaluated their work using SlimPajama, a massive, cleaned version of the RedPajama dataset. They tested on:
- 6 specific settings: Combinations of ArXiv, Books, GitHub, C4, StackExchange, and Wikipedia.
- Varying group sizes: They tested small-scale mixes ($m=2$ or $3$ groups) and the full SlimPajama set ($m=7$ groups).
- Model Scales: They primarily used 160M parameter models for iteration but validated their findings on 1.4B parameter models.
Key Insights and Ideas
- The "Mixing Law" is Real: The relationship between data proportions and model loss is remarkably linear (or log-linear). The framework's assumptions are high-fidelity; the failure of previous methods was purely an estimation problem.
- Cross-Group Synergy: Data mixing isn't just about how much "Group A" helps the model learn "Group A." It's about how training on "Group B" (like code) might actually lower the loss on "Group A" (like logic puzzles). Aioli captures these cross-group interactions in a full matrix, whereas some previous methods only looked at the diagonal (self-impact).
- The "Aioli" Analogy: Much like the sauce is an emulsion where separate ingredients are combined into a stable mixture, the algorithm takes separate "probes" of data groups and emulsifies them into a single, optimized training trajectory.
Key Results
- Consistent Wins: Aioli outperformed stratified sampling on 6 out of 6 datasets. On average, it improved test perplexity by 0.27 points, while existing methods often performed worse than the baseline (by as much as 6.9 points).
- Budget Efficiency: In a "restricted budget" scenario—where compute is severely limited for finding a mix—Aioli proved highly effective. It could take a sub-optimal mix learned on a short run and dynamically "fix" it during the full training run, improving performance by up to 12.012 perplexity points.
- Scalability: The gains observed at the 160M scale held true when tested on 1.4B parameter models, suggesting the method is robust for larger LLMs.
Limitations and Future Work
- Inference Overhead: Because Aioli requires repeated evaluations on a validation set to update its parameters, it incurs an extra computational cost during training.
- Boundary Non-linearity: The authors noted that the linear "mixing law" starts to break down at the extreme edges of the data simplex (e.g., when a mixture contains 0% of a certain group).
- Downstream Disconnect: Interestingly, the paper notes that lower perplexity (better next-token prediction) doesn't always correlate perfectly with better performance on specific benchmarks like ARC or BoolQ. Incorporating downstream task performance directly into the data-mixing objective remains a vital next step for the field.
Summary updated