                                      MixMin: Finding Data Mixtures via Convex Minimization



Algorithm 1 MixMin                                                         Cost We only need to evaluate fp (x) ∀x ∈ Dt once

                                                                           and can reuse the outputs for subsequent calls to the gradi-

Require: Step size η, number of steps n, loss function L

                                                                           ent. Given this, the dominating cost with MixMin, as with

(either cross-entropy or ℓ22 ), samples Dt from the target

                                                                           grid/random search based approaches to data mixing, is the

distribution dt, and (cheap) models trained on each source

                                                                           number of models needed to train (i.e., fˆp ). MixMin re-

fˆp (x) ∀ dp ∈ P .

                                                                           quires only as many models as sources, while the number

Initialize: λp ← |P1 | for all dp ∈ P , and pre-compute

                                                                           of models grid/random search approaches require scales ex-

{fˆp (x) ∀ x ∈ Dt , dp ∈ P }                                               ponentially (in the worst-case) with the number of sources.

 1: for i = 1, . . P

                   . , n do                                                Note once the outputs and proxy models are computed, the

 2:   fˆλ (x) ← dp∈P λp fˆp (x)                                            per-iteration cost of MixMin is O(|P ||Dt |), which is inde-

            λ P                                                            pendent of model size.

 3:   l ← |Dpt | (x,y)∈Dt L(fˆλ (x), y)

 4:   g ← ∇λ l

                 λ eηgp                                                    On the use of weak proxy models In our experiments,

 5:   λp ← P p λp eηgp for all dp ∈ P

                dp∈P

                                                                           we found that proxy models fˆp trained with very small frac-

 6: end for

                                                                           tions of total training compute achieved good results and

    Return{λp }dp∈P

                                                                           additional proxy model compute did not significantly im-

                                                                           prove the quality of the final mixtures. This suggests that

                                                                           MixMin can perform well when the proxy models fˆp have a

get larger and becomes closer to expressing the Bayes op-                  high loss and that the excess error of MixMin should be an-

timal model, the Equation 1 weights become closer to the                   alyzed beyond the risk of the proxy models fˆp . Specifically,

optimal Data Mixing weights. This is depicted in Figure 2                  we empirically found that we could train with significantly

                                                                           less data (1%) and still have similar MixMin performance.

4. MixMin                                                                  Furthermore, we found the ensemble of the proxy mod-

                                                                           els could be far less accurate than the model retrained on

We now consider how to optimize the objective in Equa-                     the MixMin mixture weights, suggesting the proxy models

tion 1. If we had a gradient oracle, we could optimize the                 were far from Bayes optimal 3 but still led to good mix-

objective using entropic descent (Duchi, 2018). However,                   tures. We hope future work investigates and generalizes

the objective (and gradient) is typically intractable for sev-             these phenomenon.

eral reasons which we now alleviate with approximations.

Firstly, computing the integral for the objective (and gra-                5. Related Work

dient) is typically intractable. We can however compute

an empirical risk given a dataset Dt ∼ dpt . Secondly, we                  Some past work has considered optimizing a pretraining

often do not know the Bayes optimal models fp for each                     data mixture for a specific downstream loss, i.e., task.

dp ∈ P , but instead can obtain “approximations” fˆp , e.g.,               Hwang & Whang (2021) train many small models with dif-

by training a model on a dataset Dp ∼ dp ∈ P . This gives                  ferent mixtures and learn to predict the task error of unseen

us our approximate convex mixture objective, where we let                  mixtures, and RegMix (Liu et al., 2024) later used a similar

Train(H, Dp ) be some training function:                                   oracle to find better mixtures (the best mixture if the oracle

                                                                           is accurate). Similarly, Held et al. (2025) proposed optimiz-

                                                                           ing the mixture given estimates of downstream performance

                                                                           from different source datasets; they assumed data mixing

  λ∗ ({fˆp }p∈P )                                                          was a linear model (with constraints) in the mixture weights

                        1        X             X                           and proposed mixtures by maximizing the performance of

       = arg min                          L(       λp fˆp (x), y)          the linear model. We note Liu et al. (2024) considered

              λ∈∆P     |Dt |

                               (x,y)∈Dt    p∈P                             modeling data mixing as a linear objective, but found their

                    where fˆp = Train(H, Dp )                              non-linear models for predicting data mixing improved over

                                                                           linear models. Finally there are the normal grid-search ap-

                                                            (MixMin)

                                                                           proaches (Blakeney et al., 2024), which random search is

                                                                           known to improve (Bergstra & Bengio, 2012).

Computing the gradient of the objective follows from

                                                                           Another line of work has considered data mixing objectives

chain rule, and hence we can run entropic descent to

                                                                           defined by just the sources and not a downstream loss: e.g.,

solve MixMin. Recall entropic descent is a variant of mirror

                                                                           with the motivation of faster optimization or generalizing

descent which handles the constraint of being in the sim-

plex. This gives us Algorithm 1, which we call MixMin for                     3

                                                                                Being close to Bayes optimal would imply the ensemble was

‘Mixtures by Minimization’.                                                close to retraining, a contradiction.



                                                                       4

