Data Mixing, Minus the Guesswork: Research from the team behind CausalMix offers a technique to select fine-tuning examples
When you’re building a fine-tuning dataset, finding a mix of subject domains that yields a high-performing model can require expensive trial and error, because fine-tuned performance also depends on the quality of the individual examples.
When you’re building a fine-tuning dataset, finding a mix of subject domains that yields a high-performing model can require expensive trial and error, because fine-tuned performance also depends on the quality of the individual examples. A cause-and-effect approach aims to separate the two effects.
What's new: Researchers at Tsinghua University, Ant Group, and Renmin University of China, with Zinan Tang and Yukun Zhang as lead authors, built CausalMix, a method for choosing the share of training examples drawn from various domains regardless of their quality.
Key insight: Datasets can be analyzed according to their data mixture (the proportions of examples that represent different domains) and data quality (variations among examples in difficulty, reasoning complexity, and/or composition). Data mixture and data quality correlate, and finding their correlation in any given dataset makes it possible to differentiate their separate impacts on the performance of a model trained on the dataset. Given a dataset and a consistent training budget, to find the marginal gain of its data mixture — that is, its effect on a fine-tuned model’s performance — we can subtract the effect of data quality from the model’s performance overall. The best data mixture is the one that yields the largest marginal gain.
How it works: The authors compiled 512 subsets of 100,000 examples each drawn from the Tulu 3 dataset. Each subset contained examples for instruction following, coding, math, knowledge, and safety in different proportions. In addition, the authors measured data quality with respect to difficulty, reasoning complexity, and writing clarity as computed by OpenDataArena-Tool. They fine-tuned a separate Qwen2.5-0.5B model on each subset and recorded each fine-tuned model’s performance on 10 benchmarks. Then they trained three models, all of them ensembles of decision trees: one to estimate the portion of each Qwen2.5-0.5B’s performance attributable to data quality, one to estimate the portion of a data mixture that correlates with the corresponding data quality, and one to represent the effect of the data mixture on fine-tuned performance.
- Given a subset’s data-quality metrics, LightGBM learned to estimate the portion of the fine-tuned Qwen2.5-0.5B’s performance attributable to data quality. The authors subtracted this output from Qwen2.5-0.5B’s performance overall to find the marginal gain attributable to the data mixture.
- The authors approximated the marginal gain in fine-tuned performance due to the data mixture as equal to the product of (i) the portion of the data mixture that doesn’t correlate with data quality and (ii) a variable that represented the data mixture’s effect.
- To estimate (i), they trained a second LightGBM. Specifically, given the data-quality metrics, the second LightGBM learned to estimate the portion of the data mixture that correlated with data quality. The authors subtracted this output from the actual data mixture to find the portion of the data mixture that didn’t correlate with data quality.
- To estimate (ii), they trained CausalForestDML, given a subset’s data quality metrics, to minimize the difference between the marginal gain and the product of the updated mixture and the model’s estimate of the variable.
- During inference, the authors: (i) randomly sampled 100,000 mixtures, (ii) estimated the marginal gain for each, (iii) computed the top 100 mixtures, and (iv) averaged them to produce the final mixture.
Results: The authors compared their method to various baselines, including distributing data across domains in equal proportions and Data Mixing Optimization (DMO), a method that automatically chooses fine-tuning mixtures based on minimizing loss. Fine-tuning on 800,000 examples, CausalMix outperformed every competing method tested on the 10 benchmarks used to select the mixtures.
- Fine-tuning Qwen2.5-0.5B, CausalMix achieved 32.81 percent on average, compared to DMO’s 32.04 percent.
- With the larger Qwen2.5-7B model, CausalMix achieved 62.28 percent on average versus DMO’s 60.35. The authors selected this mixture without repeating the 512 trial runs at 7B scale.
- To see if their method transferred to other datasets and models, the authors applied their method to Qwen3-4B and code and math problems from AM-Thinking-v1-Distilled-Code&Math, and tested across four other benchmarks. CausalMix (66.66 percent on average) outperformed the competing methods including DMO (63.47 percent on average).
Yes, but: It’s not clear how well the authors’ method extends across datasets and to other datasets. On a held-out subset of Tulu 3, CausalMix often underperformed competing methods. For example, fine-tuning Qwen2.5-0.5B on 800,000 examples from the held-out set, DMO (26.49 percent on average) outperformed CausalMix (25.04 percent on average).
Why it matters: The authors' method provides a rational approach to optimizing data mixtures rather than trial and error, and it guarantees that a good mixture will continue to apply as data or model size scales up. This makes it possible to find the best data mixture using smaller datasets and models and maintain the same proportions when scaling up without jeopardizing performance.
We’re thinking: The impact of any given training example on trained performance deepens on other examples. For instance, one example might be too hard until the model learns from another. The impact of data mixture reflects this principle. How well a model follows an instruction may depend on reasoning it learned from contemplating a math problem, and vice versa.