                                                 MixMin: Finding Data Mixtures via Convex Minimization



                                      Bigger Model Classes                    to dp(x). MixMin also holds for    R conditional CE and MSE

                                                                              losses under no   covariate shift:   −log(fy (x))dp(x, y) and

                                                                                ||f (x) − y||22 dp(x, y), with dp(x) = dp′ (x) ∀dp, dp′ ∈

                                                                              R

                    Data

Target Loss









                    Mixing

                                                                              P.

                                                                              Theorem 3.1. Let  R the objective for Data Mixing be un-

                             MixMin                                           conditional CE, −log(f (x))dp(x),      or conditional CE or

                                                                                                                        y

                                                                                                               R

                                                                              MSE    with no covariate  shift,   −log(f   (x))dp(x, y) and

              Training Mixture

                                                                                ||f (x) − y||2 dp(x, y), with p(x) = p′ (x) ∀p, p′ ∈ P .

                                                                                             2

                                                                              R



Figure 2: The convex MixMin objective better approximates                     Suppose also H contains the Bayes optimal model for

the Data Mixing objective as the model class becomes larger                   each mixture of the source distributions dp ∈ P . Then

(and better approximates Bayes optimal).                                      λ∗ = arg minλ∈∆P DM (λ, H) iff



                                                                                                  Z           X               

minimization by fitting a (small) proxy model. In this paper                      ∗

                                                                                λ = arg min               L        λp fp (x), y dt(x, y) (1)

we describe settings where the bi-level optimization col-                                  λ∈∆P    X ×Y

lapses and we can use simple gradient based optimization

to find the best mixture.                                                     The proof is provided in Appendix A.1. This optimization

                                                                              is clearly convex, and can be handled with gradient based

Data Filtering is not Data Mixing An often related but                        approaches unlike Data Mixing. However, running this

different approach to curating training data is data filtering.               optimization requires having the Bayes optimal fp and an

Abstractly, data filtering is some map F that takes a dataset                 estimator for the integral to compute the gradients. The

D → D′ where D′ ⊂ D. Such approaches are motivated                            main hurdle will be how to get reasonable approximations

by training efficiency, e.g., coresets, and/or data quality, e.g.,            for the Bayes optimal fp , which we discuss in Section 4.

rejection sampling to be closer to a desired target distribu-

tion. Data filtering can be composed with data mixing; one                    3.2. Not Well-Specified: ‘Expressivity’ is Enough

typically mixes amongst filtered data sources (Dubey et al.,                  We now show that Data Mixing smoothly approaches Equa-

2024). We leave studying such compositions to future work,                    tion 1 as the hypothesis space H contains models closer

but note some popular examples of data filtering include:                     Bayes optimal, e.g., becomes larger. This follows from

perplexity correlations (Thrush et al., 2024), n-gram or em-                  assuming some regularity in our loss function and the defi-

bedding similarity with a target distribution (Xie et al., 2023;              nition of the data mixing objective.

Everaert & Potts, 2024), handcrafted classifiers (Xiao et al.,

2024; Li et al., 2024a), and perplexity filtering (Li et al.,                 Lemma

                                                                              R          3.2. For L either CE or MSE, suppose

2024a)                                                                          L(f (x), y)dt(x, y) is C-Lipschitz in f w.r.t a norm on

                                                                              the functions ∥f (x)∥ 1 . Let

                                                                                                  Z

3. Data Mixing is Learning a Linear Model

                                                                                                            X             

                                                                                    ∗

                                                                                  λ = arg min             L    λp fp (x), y dt(x, y).

                                                                                            λ∈∆P      X ×Y

We show that Data Mixing simplifies to a convex optimiza-

tion problem as the model classes become larger. This                         Then, for any hypothesis space H such that for all mixtures

intuition is presented in Figure 2.                                           dpλ ∈ Conv(P ), the dpλ risk minimizer fˆλ (H) in H sat-

                                                                              isfies ∥fˆλ (H) − fλ ∥ ≤ ϵ where fλ is the Bayes optimal

3.1. Well-Specified: Data Mixing is just Risk                                 model2 , we have the excess Data Mixing error is bounded

     Minimization                                                             by ϵ:

We show that, when our hypothesis space contains the Bayes

optimal model fp for all dp ∈ P , the best Data Mixing                                DMH (λ∗ , dt) − min DMH (λ, dt) ≤ 2Cϵ                (2)

                                                                                                          λ∈∆P

weights are also the best weighting of models trained on

each source (a convex objective). The core idea is that                       The proof is provided in Appendix A.2. The main intuition

for certain losses, cross-entropy (CE) and mean-squared                       to take away from Lemma 3.2 is that as our model classes

error (MSE), the Bayes optimal model for a mixture is

                                                                                 1

the mixture of the Bayes optimal models’ for the sources.                          To ensure this for MSE one could consider only bounded

                                                                              output spaces, and for cross-entropy, bounded away from 0 and 1.

However this is only true if there is no input distribution                      2

                                                                                   Effectively this means functions too far away will not have

shift among the sources (p(x) are all the same), e.g., for                    low error. Mathematically, this means there is lower-bound on the

generative tasks. RTo clarify, MixMin holds for the uncon-                    increase in loss from Bayes optimal in terms of the norm of the

ditional CE loss, −log(f (x))dp(x), which matches f (x)                       perturbation to the function (e.g., strong-convexity).



                                                                          3

