                                   MixMin: Finding Data Mixtures via Convex Minimization



better across the sources. However, when evaluating on a               6.1. Pretraining Language Models

downstream objective (as is the focus of our paper) methods

                                                                       Data mixing is now a common step in pre-training

here are known to not consistently improve over the natu-

                                                                       LLMs (Dubey et al., 2024; Li et al., 2024b). We investi-

ral or balanced distribution of data (Fan et al., 2023; Jiang

                                                                       gated how MixMin compared to other data mixing methods,

et al., 2024; Albalak et al., 2023; Xie et al., 2024): see Held

                                                                       its compute efficiency, and how weights found at a smaller

et al. (2025) for comparisons. Outside of language model-

                                                                       scale of models transfers to training larger models 4 .

ing, we note the natural distribution of data is the standard

data mixture used for transfer learning in chemistry (after

                                                                       6.1.1. E XPERIMENTAL S ETUP

filtering data) (Salem et al., 2020; Li et al., 2022; Ye et al.,

2018). Another line of work considered data mixing for dis-            Datasets and Models We used the domains in SlimPa-

tributionally robust optimization (Thudi & Maddison, 2024),            jama (cer, 2023) as sources for pre-training. For the down-

which is distinct to downstream data mixing objective.                 stream target, we considered several multiple-choice tasks

Given these past findings, we compare to RegMix and ran-               that models in the 160M − 410M scale are known to do

dom search in our experiments. However, compared to                    non-trivially at (Thrush et al., 2024), alongside another gen-

MixMin, RegMix has significantly higher evaluation costs.              erative task: SciQ (Welbl et al., 2017), PIQA (Bisk et al.,

                                                                       2020), ARC-Easy (Clark et al., 2018) and the first 10000

Our setting for Bi-Level optimization also presents sev-               documents in OpenWebMath (Paster et al., 2023) 5 . For

eral challenges for previous approaches, including those               multiple-choice tasks we used MixMin to maximize the

used for other hyperparameter optimizations. Firstly, the              log probability of the correct question and answer (Q+A)

inner-optimization is over an arbitrary function space (e.g.,          sequence, i.e., treating these tasks as new pretraining do-

non-parametric models like XGBoost), and so lacks the para-            mains. Note that the optimal conditional of A given Q

metric gradients needed for many methods (Ji et al., 2021;             distribution is a conditional of the joint distribution of Q+A,

Pedregosa, 2016). Alternative constraint based approaches              so our objective subsumes the Q → A prediction problem.

through KKT suffer similar issues given the non-parametric             Alongside the objective loss, we also evaluated accuracy

space of the inner optimization (Shi et al., 2005). For many           and the conditional cross-entropy of the pre-trained models

model classes, one could parameterize the inner optimiza-              for these tasks (i.e., multiple-choice performance). Open-

tion, but we then lose the necessary convexity for these               WebMath is a specialized pretraining dataset, and so the loss

methods (e.g., Neural Networks).                                       for MixMin and evaluation was the negative log probability

                                                                       of a sequence. Our experiments used the 160M and 410M

6. Experiments                                                         pythia models (Biderman et al., 2023) trained for 3.2B and

                                                                       8.2B tokens respectively (chinchilla optimal (Hoffmann

We compared MixMin to previous data mixing baselines for               et al., 2022)).

language modeling and chemistry tasks. For language mod-

eling we further investigated the transferability of mixtures

found using cheap proxy models to more expensive train-                Data Filtering We included documents in SlimPajama

ing runs. For chemistry, we explored the performance of                with at least 1024 tokens (using the Pythia tokenizer), and

MixMin as we increased the pool of surrogate data sources.             scraped documents for each domain until adding the next

Experiments were run using A100 GPUs and AMD EPYC                      document would bring us over 3.2B tokens for each domain.

7643 CPUs.

Our experiments support the following list of (weak) condi-            Hyperparameter Tuning We took the largest batch size

tions for when MixMin works:                                           that fits on a single A100 gpu, which was 64 for the 160M -

                                                                       pythia model and 32 for the 410M -pythia model for a con-

  1. The data sources do not have covariate shift (consider            text length of 1024. For the 160M -pythia model we in-

     changing the objective to remove covariate shifts)                creased the learning rate until training loss got worse on the

                                                                       natural distribution of domains in SlimPajama: we started

  2. The downstream task is close to/contained within a                from 1e − 4, 5e − 4, 1e − 3, 5e − 3, 1e − 2 and found loss

     mixture of our sources                                            got worse at 1e − 2 so chose 5e − 3. For the 410M -pythia

                                                                       model we evaluated learning rates 5e − 3 and 1e − 2 and

  3. Our final model class is very expressive                          found 5e − 3 was better. Other hyperparameters are the

                                                                       same as (Thrush et al., 2024). All hyperparemeters are fixed

  4. Our proxy model’s learnt some signal for each source

                                                                       throughout the language modeling experiments.

     (e.g., even with very little data): consider iteratively

     using more compute for the proxy models until stability              4

                                                                              p values from Welch’s t-test are shown in Appendix B.

                                                                          5

     in the mixtures is reached                                               We chose 10000 documents for computational efficiency.



                                                                   5

