Data mixture
A data mixture is the recipe of a model's training data: the proportions of web text, code, maths, books, other languages and other sources it learns from.
A language model is not trained on one undifferentiated heap of text. Its builders decide how much of each source to include, and how often to sample it: a high-quality source may be repeated several times, while an over-represented one is cut back. Those proportions are the data mixture, and they shape what the model ends up good at.
The Pile, an open dataset released by EleutherAI researchers at the end of 2020, made the idea concrete: 825 GiB of English text drawn from 22 distinct subsets, many of them academic or professional sources. Meta's technical report on Llama 3, published in July 2024, gave the final pre-training mixture in broad terms: roughly 50% general knowledge, 25% maths and reasoning, 17% code and 8% multilingual text. Meta also used a classifier to cut back categories that are over-represented on the web, such as arts and entertainment, and said Llama 3's pre-training data contained four times as much code as Llama 2's.
Choosing the recipe is expensive to get wrong, so labs test it on small models first. Meta trained several small models on candidate mixtures and used scaling laws to predict how a large model would do on each. The DoReMi method, published in May 2023, trains a small 280 million parameter proxy model to learn weights for each data domain, then trains the full model with those weights. On The Pile, an 8 billion parameter model trained with DoReMi's weights improved average few-shot accuracy by 6.5 percentage points over The Pile's default weights and reached the baseline's accuracy with 2.6 times fewer training steps.
The mixture can also change during training. Meta reported that annealing, finishing pre-training on a mix that upsamples small amounts of high-quality code and maths data, can lift scores on key benchmarks, and it used short annealing runs to judge whether a new data source was worth adding. In practice, when a report says a new model was trained with more code, more maths or more languages, it is describing a change to the data mixture. Reports such as Llama 3's give the recipe only in broad categories, so outsiders can see the shape of a mixture but not reproduce it.
It is the set of proportions in which different kinds of data, such as web pages, code, maths, books and non-English text, are used to train a model. Meta's Llama 3, for example, was pre-trained on roughly half general knowledge, a quarter maths and reasoning, 17% code and 8% multilingual data. They train small models on candidate mixtures and predict how a large model would perform, or use methods such as DoReMi that learn domain weights with a small proxy model. Classifiers that sort web data by topic and quality help decide what to cut back or repeat. Not necessarily. In the DoReMi experiments on The Pile, the reweighted model improved perplexity across every domain, including domains that received a smaller share of the data than before. They are related steps. Curation decides which data is clean and good enough to include at all; the mixture decides how much weight each kind of included data gets during training.Common questions
What is a data mix in LLM training?
How do labs decide on a data mixture?
Does down-weighting a source make the model worse at it?
Is data mixture the same as data curation?
Search for "pre-training data mixture", "domain weights language models", "DoReMi" or "data mix scaling laws" to see how training recipes are designed. The best sources are model technical reports and dataset papers on arXiv, which sometimes publish their proportions, and open-data projects that release their full recipes. When a company describes its data only in general terms, treat claims about what drove a model's improvement with caution.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.