                 MixMin: Finding Data Mixtures via Convex Minimization





          Anvith Thudi 1 2 Evianne Rovers 3 4 Yangjun Ruan 1 2 Tristan Thrush 5 Chris J. Maddison 1 2





                          Abstract                                      Raffel et al., 2020; Achiam et al., 2023). These models are

                                                                        known to generalize to data-poor downstream tasks, a core

     Modern machine learning pipelines are increas-

                                                                        motivation behind scaling training data. However, as we

     ingly combining and mixing data from diverse

                                                                        increase the amount and diversity of data sources we can

     and disparate sources, e.g., pre-training large lan-

                                                                        train on, a core challenge becomes choosing how to weigh

     guage models. Yet, finding the optimal data mix-

                                                                        these sources when training. The effectiveness of a model

     ture is a challenging and open problem. We for-

                                                                        pre-trained on surrogate data is known to be directly related

     malize this data mixing problem as a bi-level ob-

                                                                        to how similar the surrogate (or “pretraining”) data is to

     jective: the best mixture is the one that would

                                                                        the downstream task (target distribution) (Ben-David et al.,

     lead to the best model for a downstream objec-

                                                                        2010; Isik et al., 2024; Jain et al., 2024; Pouget et al., 2024).

     tive. Unfortunately, this objective is generally in-

     tractable. In this paper, we make the observation                  Formally, finding the best mixture of data sources to train on

     that the bi-level data mixing objective becomes                    for a downstream loss poses a bi-level optimization which

     convex as our model class becomes larger. We                       is hard to optimize. We must find the mixture whose risk

     develop and study a gradient-based approach for                    minimizer optimizes the downstream loss. This generally

     optimizing this convex objective, which we call                    only admits expensive zero-order approaches, such as grid

     MixMin, and test it on language modeling and                       search (Dubey et al., 2024; Blakeney et al., 2024). Past

     chemistry tasks. MixMin was the only method                        work has considered learning to simulate the loss oracle for

     that uniformly improved the data mixture in all                    unseen mixtures (Liu et al., 2024), or leveraging a large pool

     our experiments. With MixMin, we improved the                      of existing models (Thrush et al., 2024). Other approaches

     data mixture using less than 0.2% additional com-                  consider solving data mixing objectives agnostic to a down-

     pute for a pythia-410M model trained on 8.2B                       stream loss, but are known to not consistently improve the

     tokens, resulting between 1-5% relative improve-                   baseline of training on all the data with their natural propor-

     ment to negative log likelihood on PIQA, ARC                       tions (when evaluated on diverse downstream losses) (Xie

     Easy, SciQ, and OpenWebMath. Crucially, we                         et al., 2024; Jiang et al., 2024; Liu et al., 2024; Fan et al.,

     found that MixMin mixtures for smaller mod-                        2023; Held et al., 2025).

     els improved training of larger models, suggest-

                                                                        In this paper we show that the bi-level optimization for

     ing that MixMin mixtures may be scale-invariant.

                                                                        data mixing reduces to a convex minimization as the model

     When mixing bioassay data to train an XGBoost

                                                                        classes become larger, which we can solve cheaply with

     model, we saw improvements to average precision

                                                                        gradient based methods. A key insight is that by restricting

     scores of 0.03 − 0.15.

                                                                        the loss functions to cross-entropy (CE) or mean-squared

                                                                        error (MSE), we gain additional structure which simplifies

                                                                        the data mixing objective. Practically, we show we can find

1. Introduction                                                         the best mixture by first training a (cheap) proxy model for

Recent progress in ML has come from training on vast                    each source, learning the best mixture of their outputs for

web-scale data (Dubey et al., 2024; Touvron et al., 2023;               the target dataset (convex minimization), and then using this

                                                                        weighting to remix the data, see Figure 1.

    1

      Department of Computer Science, University of Toronto,

Toronto, Canada 2 Vector Institute, Toronto, Canada 3 Department        First, we note that when our models are relatively close to

of Chemistry, University of Toronto, Toronto, Canada 4 Structural       Bayes optimal (the best possible functions), data mixing is

Genomics Consortium, Toronto, Canada 5 Department of Computer           equivalent to learning a linear model over the predictions

Science, Stanford University, Palo alto, USA. Correspondence to:        of a fixed set of models (a convex objective). Learning this

Anvith Thudi <anvith.thudi@mail.utoronto.ca>.

                                                                        linear model requires comparatively little data to training

Proceedings of the 42 nd International Conference on Machine            modern large models, and is relatively cheap to optimize.

Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025             Our reduction is specific to CE or MSE, where we leverage

by the author(s).



                                                                    1

