Aioli: A Unified Optimization Framework for Language Model Data Mixing

## Abstract

Abstract Language model performance depends on identifying the optimal mixture of data groups to train on (e.g., law, code, math). Prior work has proposed a diverse set of methods to efficiently learn mixture proportions, ranging from fitting regression models over training runs to dynamically updating proportions throughout training. Surprisingly, we find that no existing method consistently outperforms a simple stratified sampling baseline in terms of average test perplexity per group. In this paper, we study the cause of this inconsistency by unifying existing methods into a standard optimization framework. We show that all methods set proportions to minimize total loss, subject to a method-specific mixing law —an assumption on how loss is a function of mixture proportions. We find that existing parameterizations of mixing laws can express the true loss-proportion relationship empirically, but the methods themselves often set the mixing law parameters inaccurately, resulting in poor and inconsistent performance. Finally, we leverage the insights from our framework to derive a new online method named Aioli , which directly estimates the mixing law parameters throughout training and uses them to dynamically adjust proportions. Empirically, Aioli outperforms stratified sampling on 6 out of 6 datasets by an average of 0.28 test perplexity points, whereas existing methods fail to consistently beat stratified sampling, doing up to 6.9 points worse. Moreover, in a practical setting where proportions are learned on shorter runs due to computational constraints, Aioli can dynamically adjust these proportions over the full training run, consistently improving performance over existing methods by up to 12.01 test perplexity points.

## 1 Introduction

It is critical to determine what data to train on for a language model (LM) to acquire a range of capabilities, from generating code to understanding scientific literature and conversing with users [, , ].
To achieve this, practitioners mix data from various groups (such as code files, scientific papers, and chat logs) in specific proportions to compose an overall training dataset—a procedure known as *data mixing*. Identifying the optimal mixture proportions is critical to LLM performance. However, a brute-force trial-and-error search over the proportions is computationally expensive, requiring many training runs.

Recent work introduces two types of data mixing algorithms that *learn* mixture proportions: offline and online methods.
Offline methods conduct multiple training runs with varying proportions, fit a regression model to predict performance, and use this model to determine the optimal static mixture [, ].
Online methods adjust the mixture proportions dynamically throughout training using information from the model, such as its loss and gradients [, , , ].
These mixing methods require at least one training run to learn the proportions but are more efficient than a brute-force search.

Given the wide range of methods available, it is important to determine which ones are effective.
However, when we evaluated existing methods, we found that no method consistently outperformed stratified sampling—a simple baseline that uniformly mixes groups and requires zero extra training runs—across all sets of data groups in terms of average test perplexity (Table 2). This surprising outcome suggests that all existing methods suffer from some common weaknesses.
To make progress in data mixing, we identify three objectives for our work: 1) improve our understanding of the underlying assumptions of existing methods, 2) assess the fidelity of these assumptions in practice to better understand performance, and 3) apply our insights to develop principled new data mixing methods.

In this paper, we improve our understanding of data mixing methods by showing that many existing methods can be expressed in a unified optimization framework, which we call Linear Mixing Optimization (LMO) (Section 3). These methods solve an optimization problem that sets proportions to minimize the average loss per data group, subject to a method-specific *mixing law*—a particular assumption relating loss per group and mixture weights.
We find that all current mixing laws share the same parameterization: for training round $t$ from $1$ to $T$,

$$ $L^{t+1}(p^{t})\mathrel{\overset{\text{lin}}{=}}\sigma(A^{t}p^{t}),$ $$

where $p^{t}\in\triangle^{m}$ (the simplex) are mixing proportions over $m$ given data groups at time $t$, $L^{t+1}(p^{t}):\triangle^{m}\rightarrow(\mathbb{R}^{+})^{m}$ are the losses per group at the next timestep, $A^{t}\in\mathbb{R}^{m\times m}$ is a parameter matrix, $\sigma=\text{Id}$ or $\exp$, and $\mathrel{\overset{\text{lin}}{=}}$ means equal up to linear transformation.
Existing offline methods assume a static log-linear mixing law ($T=1$, $\sigma=\exp$), while online methods assume a linear dynamic mixing law ($T>1$, $\sigma=\text{Id}$).
All methods set the parameters of their mixing laws differently (Table 1), and offline methods solve the optimization problem directly while online methods solve it greedily using exponentiated gradient descent.
Our framework reveals the underlying assumptions of each method in terms of the mixing law’s parameterization, the values of the parameters, and how the optimization problem is solved.

Figure: Figure 1: Left: existing methods can be expressed in a unified optimization framework, in which they implicitly assume a linear or log-linear loss-proportion relationship. Center: the (log)-linear parameterizations are well-specified, but existing methods set their parameters incorrectly. Right: Aioli, an online mixing method that more accurately estimates the parameters that capture the true loss-proportion relationship.
Refer to caption: x1.png

Applying the LMO framework, we test the fidelity of existing methods
assumptions, examining if they hold in practice (Section 4). Both the log-linear static and linear dynamic parameterizations capture the true loss-proportion relationship across pretraining datasets, achieving an average of 0.0005 MSE and 0.969 $R^{2}$.
We then show that although existing mixing laws are well-specified, methods can set their parameters ($A^{t}$) inaccurately, causing poor performance.
We compare each method’s parameters to the optimal parameters, which we approximate by fitting the mixing laws to training runs. We find that the method’s parameters can differ significantly from the optimal parameters, and the extent of these deviations is correlated with method performance relative to stratified sampling (Figure 3), helping explain our initial observations.
Finally, we validate the assumptions made in solving the optimization problem, finding that the greedy approximation in online methods is a reasonable proxy for the full objective.
Our analysis shows that existing methods’ parameterizations and solving strategies are of high fidelity, but their parameters are not.

To validate these insights, we develop Aioli, a simple new online data mixing method derived from the LMO framework (Section 5).
Similar to existing online methods, Aioli uses exponentiated gradient descent to minimize the average loss per group at each timestep subject to a linear dynamic mixing law, which we have empirically shown to be well-specified.
Unlike existing online methods, Aioli directly estimates the parameters $A^{t}$ from the current training run by fitting the mixing law on the history of losses and dynamic mixture proportions so far. Aioli is thus able to dynamically adjust proportions without requiring any extra training runs.

We evaluate Aioli in two settings by training 160M parameter models on various combinations of data sources from SlimPajama [] (Section 6). First, we compare Aioli to existing data mixing methods and find that Aioli consistently outperforms stratified sampling on all 6 datasets, by an average of $0.280$ and up to $0.439$ points in test perplexity. On the other hand, existing data mixing methods do worse than stratified on at least one dataset by up to 6.9 perplexity points, despite using extra training runs. As we expect, the parameters of Aioli are also more consistently close to the optimal parameters (Figure 2).
Second, we consider a scenario with limited additional computational resources, in which practitioners cannot run experiments for learning mixture proportions for the full training duration. In this setting, mixture proportions learned on a shorter run may not perform well on the longer final run.
We find that using Aioli to dynamically adjust these learned proportions throughout the final training run can improve performance by an average of 1.202 perplexity points in 28 out of 30 cases, compared to using the learned proportions directly.

## 2 Problem Setup

We formalize the data mixing problem and establish notation.
In data mixing, we have $m$ data groups of text, such as GitHub, BooksCorpus, and arXiv. We are given train, validation, and test sets for each data group, which we denote as $D_{\text{train}}^{i},D_{\text{val}}^{i},D_{\text{test}}^{i}$ for the $i$th group. Define $D_{\text{train}}=\{D_{\text{train}}^{1},\dots,D_{\text{train}}^{m}\}$, and similarly define $D_{\text{val}}$ and $D_{\text{test}}$.

##### Data & Mixing.

During training, we show the model a total of $N$ examples from $D_{\text{train}}$ over $S$ training steps. To express how data proportions can change throughout training, we divide training into $T$ equal rounds. Each round $t$ uses a mixture proportion from the probability simplex: $p^{t}=\left[p_{1}^{t},\ldots,p_{m}^{t}\right]\in\triangle^{m}$. Static mixtures use only a single round ($T=1$): $\bm{p}=\left(p^{1}\right)$, while dynamic mixtures use several ($T>1$): $\bm{p}=\left(p^{1},\ldots,p^{T}\right)$.

##### Model & Loss.

Let $f(\bm{p},t)$ refer to the language model (LM), $f$, at the beginning of round $t$ where the model has been trained on data sampled using mixture proportions $p^{1},\cdots,p^{t-1}$ so far. Given a model $f$, we can compute its loss on each group using the training data, $L_{\text{train}}(f)=\left(L_{\text{train},1}(f),\dots,L_{\text{train},m}(f)\right)$, and similarly using the validation data, $L_{\text{val}}(f)$, and test data, $L_{\text{test}}(f)$. In this notation, the loss at the end of training can be expressed as $L_{(\cdot)}(f(\bm{p},T+1))$. When the $f$ being referred to is obvious, we simply write $L_{(\cdot)}^{t}(\bm{p})$, and for static mixtures we drop the superscript: $L_{(\cdot)}(\bm{p})$.

##### Data Mixing Problem.

Given a set of data groups, an LM $f$ to train for $S$ steps with $N$ samples, and $T$ rounds of training (i.e., determining whether we use static or dynamic proportions), we aim to determine the $\bm{p}$ that minimizes the total test loss across groups: $\underset{\bm{p}\in\triangle^{T\times m}}{\text{minimize}}\sum_{i=1}^{m}L_{
\text{test},i}^{T+1}(\bm{p}).$

This objective aims to produce a trained model that does well on many data groups, which can serve as a proxy for downstream performance.
However, without assuming additional structure on $L_{\text{test}}^{T+1}(\bm{p})$, this problem can only be solved with a brute-force search over $\bm{p}$, which requires training many different models.
Existing methods overcome this by imposing an implicit constraint on the problem, thereby setting $\bm{p}$ without searching.
In the next section, our LMO framework unifies many existing methods using a single explicit constraint.

## 3 A Unified Optimization Framework for Data Mixing

We introduce the LMO framework by stating the general optimization problem (Section 3.1). Then, we explain how this framework can express several existing methods (Section 3.2, 3.3), with a summary of our insights regarding these methods in Section 3.3.3.

### 3.1 Linear Mixing Optimization (LMO)

The LMO framework consists of an optimization problem that is equivalent to the data mixing problem (Section 2), subject to an additional constraint:

$$ $\displaystyle\text{minimize}_{\bm{p}\in\triangle^{T\times m}}\sum_{i=1}^{m}L_{ \text{val},i}^{T+1}(\bm{p})$ (1) $\displaystyle\text{s.t.}\;L_{\text{val},i}^{t+1}(\bm{p})=c_{i}^{t}+b_{i}^{t} \sigma\Big{(}\sum_{j=1}^{m}-A_{ij}^{t}p_{j}^{t}\Big{)}\;\forall i\in[m],t\in[T],$ (2) $$

for some $A^{t},b^{t},c^{t},$ and $\sigma$. $A^{t}\in\mathbb{R}^{m\times m}$ is a matrix that encodes cross-group interactions, where $A_{ij}^{t}$ intuitively describes how much training on group $j$ at $t$ impacts group $i$’s loss. $b^{t},c^{t}\in\mathbb{R}^{m}$ are group-specific parameters. $\sigma:\mathbb{R}\rightarrow\mathbb{R}$ is either the identity function (Id) or the exponential function ($\exp$). We refer to the constraint in (2) as a *mixing law* that specifies the assumed relationship between loss and proportions.

There are three components of this optimization problem that need to be specified to yield a way to set $\bm{p}$: a) the parameterization of the mixing law, defined by $T$ and $\sigma$; b) the values of the parameters $A^{t},b^{t},$ and $c^{t}$; and c) how to solve the problem. We express existing methods in LMO by specifying these components.

### 3.2 Preliminaries for expressing methods in the LMO framework

We discuss preliminaries before presenting existing methods and explaining how they can be expressed in the LMO framework. First, we formally define what it means for a method to be *expressed* in the LMO framework. Then, we present a result that allows us to convert between linear dynamic mixing laws ($T>1$, $\sigma=\text{Id}$) and a way to set $\bm{p}$, which we will to use to express online methods in our framework in Section 3.3.

###### Definition 1 .

A data mixing method can be expressed in the LMO framework if the way it sets proportions $\bm{p}$ and trains model $f$ in terms of $\bm{p}$ can be equivalently constructed by specifying a mixing law parameterization, parameters, and way of solving the LMO optimization problem.

This definition allows us to cast existing methods as a way of solving the LMO optimization problem based on how they set $\bm{p}$ and train according to $\bm{p}$, even if the methods themselves are not originally designed to minimize average validation loss.

###### Definition 1 .

##### Converting mixing laws into update rules.

When $T>1$, a natural way to solve the LMO optimization problem is via exponentiated gradient descent (EGD) [, ], which updates $p^{t}$ greedily while ensuring that it remains on the probability simplex. The following lemma presents the EGD update rule for the LMO optimization problem when $\sigma=\text{Id}$.

###### Lemma 1 .

The EGD update rule for (1) subject to $L_{\text{val},i}^{t+1}(\bm{p})=c_{i}^{t}-b_{i}^{t}\sum_{j=1}^{m}A_{ij}^{t}p_{j
}^{t}\;\forall i\in[m]$ is

$$ $\displaystyle p_{j}^{t+1}=\frac{1}{Z^{t}}\cdot p_{j}^{t}\exp\bigg{(}\eta\sum_{ i=1}^{m}b_{i}^{t}A_{ij}^{t}\bigg{)}\;\forall j\in[m],$ (3) $$

where $\eta>0$ is the step size and $Z^{t}$ is a normalizing constant such that $p_{j}^{t+1}\in\triangle^{m}$.

This lemma shows how to adjust $p^{t}$ dynamically to solve the LMO optimization problem. Notably, this update rule is defined in terms of the mixing law parameters, $A^{t}$ and $b^{t}$. This gives us a way to convert between how a method sets $\bm{p}$ and the implicit assumption it makes in its mixing law.

**Table 1: Summary of how existing methods and Aioli are expressed in the LMO framework.**
| Method | 1) Mixing Law Parameterization | 2) Parameters | 3) Solver |
| --- | --- | --- | --- |
| DML | $L_{\text{val},i}(\bm{p})=c_{i}+b_{i}\exp\big{(}\sum_{j=1}^{m}-A_{ij}p_{j}\big{)}$ | Fit from $\geq m+1$ training runs | Direct |
| Skill-It | $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m<br>}A_{ij}^{t}p_{j}^{t}$ | $A_{ij}^{t}=L_{\text{val},i}^{t}(\bm{p})(L_{\text{val},i}^{T+1}(\mathbf{1}_{j})<br>-L_{\text{val},i}^{1}(\mathbf{1}_{j}))/L_{\text{val},i}^{1}(\mathbf{1}_{j})$ | EGD |
| DoReMi | $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m<br>}A_{ij}^{t}p_{j}^{t}$ | $A_{ii}^{t}=\min\{L_{\text{train},i}^{t}(\bm{p})-L_{\text{train},i}(f_{\text{<br>ref}}),0\}$ | EGD |
| DoGE | $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m<br>}A_{ij}^{t}p_{j}^{t}$ | $A_{ij}^{t}=\langle\triangledown L_{\text{val},i}^{t}(\bm{p}),\triangledown L_{<br>\text{train},j}^{t}(\bm{p})\rangle$ | EGD |
| Aioli | $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-\sum_{j=1}^{m}A_{<br>ij}^{t}p_{j}^{t}$ | Fit from history of $L_{\text{val}}$ and $\bm{p}$ | EGD |

###### Lemma 1 .

### 3.3 Existing methods

We discuss four existing data mixing methods and express them as specific instances of the LMO framework. A summmary of our insights is provided in Section 3.3.3 and Table 1.
In Appendix B.1, we comment on how several other online and offline data mixing methods are related to our framework, and all proofs for this section are in Appendix B.2.

#### 3.3.1 Offline methods

##### Data Mixing Laws (DML).

Ye et al. [] propose an offline method using a static mixing law ($T=1$): $L_{\text{val},i}(\bm{p})=c_{i}+b_{i}\exp(\sum_{j=1}^{m}-A_{ij}p_{j})$ for $i\in[m]$, with $A,b,c$ learned by sweeping training runs over static proportions (at least $m+1$ runs to avoid being underdetermined). Their method selects the proportion that minimizes the predicted validation loss. This law can be derived from (2) with $\sigma=\exp$, showing that LMO with a) log-linear static mixing law, b) fitted parameters, and c) direct computation of $\bm{p}$ can express DML.

#### 3.3.2 Online Methods

We provide a colloquial description and an algorithmic description of three online methods. Then, in Theorem 1, we demonstrate how they all are expressed in LMO using a linear dynamic mixing law, the EGD update rule, and method-specific mixing law parameters.

##### Skill-It.

Chen et al. [] is an online method motivated by curriculum learning that dynamically adjusts mixture proportions. Data group interactions are expressed in a “skills graph,” where each edge denotes how much the loss on one group changes when trained on another. The skills graph is learned in advance using $m$ additional training runs and is then used to update proportions $p^{t}$ throughout training.

Concretely, the skills graph matrix $A^{\text{SG}}$ has entries $A^{\text{SG}}_{ij}=(L_{\text{val},i}^{T+1}(\mathbf{1}_{j})-L_{\text{val},i}^{1
}(\mathbf{1}_{j}))/L_{\text{val},i}^{1}(\mathbf{1}_{j})$ indicating the relative decrease in loss on group $i$ when training a model on group $j$ only. This is used in the Skill-It update rule, $p^{t+1}_{j}\propto p_{j}^{t}\exp(\eta\sum_{i=1}^{m}A^{\text{SG}}_{ij}L_{\text{
val},i}^{t}(\bm{p}))$ for all $j\in[m]$ and learning rate $\eta>0$. This rule determines $p^{t+1}$, which is then used to sample $D_{\text{train}}$ for training $f$ in the next round.

##### DoReMi.

Xie et al. [] is an online method that applies ideas from distributionally robust optimization to data mixing, where the training objective minimizes the worst-group excess loss over a model trained with stratified sampling. $p^{t}$ is updated dynamically to minimize this excess loss and then averaged for the final run. DoReMi requires two additional runs to learn a static $\bm{p}$.

Concretely, let $f_{\text{ref}}=f(\text{Unif}(m),T+1)$ denote a “reference model” that is first trained using stratified sampling. Then, a “proxy model” uses dynamic proportions according to the update rule $p_{j}^{t+1}\propto p_{j}^{t}\exp(\eta\max\{L_{\text{train},j}^{t}(\bm{p})-L_{
\text{train},j}(f_{\text{ref}}),0\})$ for all $j\in[m]$ and step size $\eta>0$. This $p^{t+1}$ is used to weight the training objective, such that the proxy model is updated to minimize $\sum_{i=1}^{m}p_{i}^{t+1}L_{\text{train},i}(f)$ at the next timestep. The averaged static proportions $\frac{1}{T}\sum_{t=1}^{T}p^{t}$ are then used in the final run.

##### DoGE.

Fan et al. [] is an online method that solves a bi-level optimization problem in which $p^{t}$ is updated to minimize the average training loss at each step. By using a first-order Taylor approximation of the training loss, $p^{t}$ is updated using the gradient dot products across data groups. The dynamic proportions are then averaged for the final run. DoGE requires one additional run to learn a static $\bm{p}$.

Concretely, a proxy model is trained using $p_{j}^{t+1}\propto p_{j}^{t}\exp(\eta\langle\triangledown L_{\text{train},j}(f
^{t}),\sum_{i=1}^{m}\triangledown L_{\text{val},i}(f^{t})\rangle)$, and $f$ is updated to minimize the training loss weighted by $p^{t}$, similar to DoReMi. The averaged static proportions $\frac{1}{T}\sum_{t=1}^{T}p^{t}$ are used in the final run.

##### Framework expression.

All three online methods use an update rule $p_{j}^{t+1}\propto p_{j}^{t}\exp(\cdot)$, which is similar to (3).
This provides intuition for our main theorem, which expresses these methods in LMO.

###### Theorem 1 .

Define the following parameters for each method:

- •
$A^{t,\text{Skill-It}}\in\mathbb{R}^{m\times m}$, where $A_{ij}^{t,\text{Skill-It}}\texttt{=}L_{\text{val},i}^{t}(\bm{p})(L_{\text{val}
,i}^{T+1}(\mathbf{1}_{j})-L_{\text{val},i}^{1}(\mathbf{1}_{j}))/L_{\text{val},
i}^{1}(\mathbf{1}_{j})$ for all $i,j\in[m]$,
- •
$A^{t,\text{DRM}}\in\mathbb{R}^{m\times m}$, where $A_{ii}^{t,\text{DRM}}=\min\{L_{\text{train},i}^{t}(\bm{p})-L_{\text{train},i}(
f_{\text{ref}}),0\}$ and $A_{ij}^{t,\text{DRM}}=0$ for $i\neq j$,
- •
$A^{t,\text{DoGE}}\in\mathbb{R}^{m\times m}$, where $A_{ij}^{t,\text{DoGE}}=\langle\triangledown L_{\text{val},i}^{t}(\bm{p}),
\triangledown L_{\text{train},j}^{t}(\bm{p})\rangle$ for all $i,j\in[m]$.

Instantiating the LMO framework (1) with a) a linear dynamic mixing law $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m
}A_{ij}^{t}p_{j}^{t}$, b) parameters $A^{t}=A^{t,\text{Skill-It/DRM/DoGE}}$, and c) EGD to solve for $\bm{p}$ allows for us to express Skill-It, DoReMi, and DoGE, respectively.

###### Theorem 1 .

#### 3.3.3 Summary of LMO Framework Insights

Table 1 summarizes how existing methods are expressed in the LMO framework.
LMO reveals the assumptions each method makes through how the components of the framework are specified.
First, all mixing laws are either linear or log-linear. Second, the mixing laws differ in the values of the parameters used. For example, Skill-It’s $A^{t}$ is the current loss times a matrix learned from training on static proportions, while DoReMi’s $A^{t}$ is diagonal. Third, offline mixing methods solve for $\bm{p}$ directly while online mixing methods use EGD, which uses a greedy approximation. In the next section, we study if each of these assumptions holds well in practice.

## 4 Analyzing Fidelity of Existing Methods with the LMO Framework

We examine the fidelity of the assumptions made by existing methods in terms of the three components of the LMO framework: a) the mixing law parameterization, b) values of the mixing law parameters, and c) how to solve the optimization problem for $\bm{p}$. After providing experiment details (Section 4.1), we discuss these three components in order (Section 4.2-4.4).

### 4.1 Experiment Details

##### Data settings.

We use a sampled version of SlimPajama [, ], a pre-processed version of the RedPajama pretraining dataset [], which has been used to train open-source LMs [, ].
SlimPajama consists of $7$ data groups: ArXiv, Books, CommonCrawl, C4 [], Github, StackExchange, and Wikipedia.
To develop a fine-grained understanding of data mixing, we create 6 settings by extracting combinations of these groups. We study three settings with $m=2$: Arxiv/StackExchange, Github/C4, and Book/StackExchange. We study two settings with $m=3$: Arxiv/Book/StackExchange and CommonCrawl/Github/Wikipedia. Finally, we study mixing over the full SlimPajama dataset with $m=7$.

##### Models.

We train 160M parameter GPT-style decoder-only LMs with batch size $8$ and context length $2048$. For $m=2,3$, we train for $5$K steps, and for $m=7$, we train for $40$K steps.

##### Training sweeps.

To assess the true loss-proportion relationship and compare it to the assumptions made by existing methods, we conduct training sweeps over a set of various mixture proportions, denoted as $\mathcal{P}$. For $m=2$, we set $\mathcal{P}=\{[0.1,0.9],[0.2,0.8],\dots,[0.9,0.1]\}$. For $m=3$ and $7$, we set $\mathcal{P}$ equal to $10$ $\bm{p}$’s drawn from the Dirichlet distribution with $\alpha=1.0$ and $1.5$, respectively.

### 4.2 Mixing law parameterization

We examine whether existing methods’ mixing law parameterizations—log-linear static and linear dynamic—capture the true loss-proportion relationship. By empirically fitting them to loss-proportion pairs, we find that both parameterizations are indeed well-specified.
Full results for both mixing laws are in Table 5 in Appendix C.1. We also discuss the generality of these parameterizations across training scales and other SlimPajama subsets in Appendix C.1.1, and study if these parameterizations hold over mixtures of instruction-tuning tasks in Appendix C.1.2.

##### Setup.

For the *log-linear static mixing law*, we study if there exists $A,b,c$ such that $L_{\text{val},i}(\bm{p})$ can be expressed as $c_{i}+b_{i}\exp(\sum_{j=1}^{m}-A_{ij}p_{j})$ for all $i\in[m]$. We fit the parameters using full training runs on $\mathcal{P}$. For the *linear dynamic mixing law*, we study if there exists $A^{t}$ such that $L_{\text{val},i}^{t+1}(\bm{p})$ can be expressed as $L_{\text{val},i}^{t}(\bm{p})-\sum_{j=1}^{m}A_{ij}^{t}p_{j}^{t}$, for all $i\in[m]$ ($b^{t}$ is absorbed into $A^{t}$). To fit $A^{t}$, we select a timestep $t$ and train on a static proportion $p^{0}\in\mathcal{P}$ until round $t$, and at $t+1$ we sweep the values of $p^{t+1}\in\mathcal{P}$.

##### Results.

On average across our $6$ data settings, the mean squared error (MSE) of the fitted log-linear static mixing law is $8.9\times 10^{-4}$, and the $R^{2}$ coefficient of determination is 0.991.
The average MSE of the fitted linear dynamic mixing law is $1.0\times 10^{-4}$ and the $R^{2}$ is 0.947.
See Figure 2 for examples.
Since both parameterizations have high $R^{2}$ and low MSE, we conclude that they capture the true loss-proportion relationship well and are of high fidelity.

Figure: Figure 2: Left: $p_{i}$ vs $\log(L_{\text{val},i}(\bm{p})-c_{i})$ with fitted static log-linear mixing law. Right: $p_{i}^{t}$ vs $L_{\text{val},i}(\bm{p})$ with fitted linear dynamic mixing law. Colors represent random seeds (left) and initial $p^{0}\in\mathcal{P}$ (right, blue is ${0.7,0.3}$). Both laws fit the true loss-proportion relationship well.
Refer to caption: x2.png

### 4.3 Values of mixing law parameters

As shown in Table 1, each method sets the parameters of its mixing law differently. We study how close the method-specific parameters are to the optimal parameters that are obtained when fitting the method’s mixing law to the true loss-proportion relationship, and if these parameter disparities are reflected in method performance. We find that existing methods’ differences in parameters are largely responsible for their performance.
We omit studying DML since its parameters are fitted from full training runs and hence differ from the optimal parameters in estimation error only.

##### Setup.

For each online method—Skill-It, DoReMi, and DoGE—we select a step $t$ and obtain the method-specific $A^{t}$. We then sweep $\mathcal{P}$ for the next round $t+1$. This sweep is used to fit an approximately optimal $A^{t\star}$ that captures the true loss-mixture relationship, $L_{\text{val}}^{t+1}(\bm{p})=L_{\text{val}}^{t}(\bm{p})-A^{t\star}p^{t}$, as well as fit a $b^{t}\in\mathbb{R}$ used for scaling $A^{t}$ (details in Appendix C.2). We study the relationship between $\tilde{A}^{t}:=b^{t}A^{t}$ and $A^{t\star}$, and how this relationship is connected to the performance of the method.

Figure: Figure 3: Improvement over stratified sampling versus optimality of $A^{t}$. Each dot represents a method applied to a dataset. The red region shows that existing methods are worse than stratified on at least 1 dataset. The vertical dashed line serves as a visual aid.
Refer to caption: x4.png

To express similarity between $\tilde{A}^{t}$ and $A^{t\star}$ in a way that is reflected in performance, we observe that from Lemma 1, $p^{t}$ is updated using the column sum of $\tilde{A}^{t}$, $\mathbf{1}^{\top}\tilde{A}^{t}$. Moreover, the magnitude of $\tilde{A}^{t}$ is not critical to performance since the step size $\eta$ can always be tuned to control this.
Therefore, we compare the vectors $\tilde{a}^{t}=\mathbf{1}^{\top}\tilde{A}^{t}/\|\mathbf{1}^{\top}\tilde{A}^{t}
\|_{2}$ and $a^{t\star}=\mathbf{1}^{\top}A^{t\star}/\|\mathbf{1}^{\top}A^{t\star}\|_{2}$. Finally, we note that the order of the elements of $\tilde{a}^{t}$ determines the update direction from $p^{t}$ to $p^{t+1}$ in Lemma 1. Therefore, we propose a similarity score that is an average of cosine similarity and the Spearman rank correlation, $\text{sim}(\tilde{A}^{t},A^{t\star})=0.5\text{cossim}(\tilde{a}^{t},a^{t\star}
)+0.5\text{Spearman}(\tilde{a}^{t},a^{t\star})$. This metric is bounded between $-1$ and $1$, where $1$ indicates $\tilde{a}^{t}=a^{t\star}$ and $-1$ indicates $\tilde{a}^{t}=-a^{t\star}$.

##### Results.

In Figure 3, we plot each method’s $\text{sim}(\tilde{A}^{t},A^{t\star})$ versus each method’s improvement over the stratified sampling baseline, which sets $p_{i}=1/m$ for all $i\in[m]$, for each dataset in the $m=2,3$ data settings. We find that no existing online method works well across all datasets (also see Table 2), and that our metric and loss improvement have a moderate positive correlation ($R^{2}=0.491$). This suggests that $A^{t}$’s fidelity to $A^{t\star}$ clearly influences the performance of online methods, and that existing methods’ parameters are not consistently accurate across the datasets. In Appendix C.2.1, we give more details on the properties of $A^{t\star}$, such as how $A^{t\star}$ varies with $t$ and the significance of its off-diagonal entries. We find that restricting $A^{t}$ to be static or diagonal—as some existing methods’ parameters are structured—can result in lower $\text{sim}(\tilde{A}^{t},A^{t\star})$.

### 4.4 Solving strategy

We study the assumptions made in how existing methods solve the LMO optimization problem. We find that the greedy approximation used by EGD, $\text{minimize}_{p^{t}}\sum_{i=1}^{m}L_{\text{val},i}^{t+1}(\bm{p})$, does not significantly compromise performance compared to full optimization of dynamic proportions, which has an exponentially large solution space. In particular, we study if greedily selecting $p^{t}$ from $\mathcal{P}$ at each $t$ yields the optimal dynamic proportions in $(\mathcal{P})^{T}$, and we find that this holds in $2$ out of $3$ data settings (Table 10).
This suggests that the greedy approximation can simplify optimization without substantial performance loss. We also comment on other possible solving strategies in Appendix C.3.

## 5 Aioli : a Method for Improved Data Mixing

To validate our insights from Section 4, we develop Aioli, an online method derived from the LMO framework. We have three takeaways from section 4:

- a)
A linear dynamic mixing law, $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-\sum_{j=1}^{m}A_{
ij}^{t}p_{j}^{t}$ for all $i\in[m]$, can capture the loss-proportion relationship with high fidelity (Section 4.2).
- b)
Existing online methods often set the parameters $A^{t}$ to be very different from true $A^{t\star}$ (Section 4.3).
- c)
Exponentiated gradient descent can recover near-optimal performance while simplifying the optimization problem, avoiding an exponential solution space (Section 4.4).

We thus directly specify the linear dynamic mixing law parameterization and EGD as two out of three LMO components of Aioli since we found that their assumptions generally hold in practice. According to Lemma 1, the update rule given these two components is $p_{j}^{t+1}\propto p_{j}^{t}\exp(\eta\sum_{i=1}^{m}A_{ij}^{t})$ ($b^{t}$ is absorbed into $A^{t}$).
Thus, our primary mandate in creating Aioli is to construct and utilize an $A^{t}$ that is an accurate estimate of the true $A^{t\star}$ in the linear dynamic mixing law, which existing online methods fail to achieve.

##### Estimating A t ⁣ ⋆ superscript 𝐴 𝑡 ⋆ A^{t\star} italic_A start_POSTSUPERSCRIPT italic_t ⋆ end_POSTSUPERSCRIPT

To build intuition, note that for each group $i\in[m]$, the $m$ variables $A_{i1}^{t},\dots,A_{im}^{t}$ can be learned by solving a system of $m$ equations, each of the form $\sum_{j=1}^{m}A_{ij}^{t}p_{j}^{t}=L_{\text{val},i}^{t}(\bm{p})-L_{\text{val},i
}^{t+1}(\bm{p})$ and with different $\bm{p}$. That is, we could do a training sweep of $m$ different proportions $p^{t,1},p^{t,2},\dots,p^{t,m}\in\triangle^{m}$ and observe how $L_{\text{val},i}^{t+1}$ changes to obtain $A_{i1}^{t},\dots,A_{im}^{t}$.
Aioli uses this intuition while avoiding training sweeps. In LearnParams (Algorithm 2) at round $t$, we define $p^{t,i}=(1-\varepsilon)\mathbf{1}_{i}+\varepsilon\text{Unif}(m)$ for all $i\in[m]$ to be a one-hot vector with probability mass $\varepsilon$ distributed uniformly across all groups. We allocate an initial $\delta\in[0,1]$ fraction of each round for estimating $A^{t}$ (i.e., $\delta S/T$ steps), and we determine a randomly interleaved order for training on $p^{t,1},\dots,p^{t,m}$ over this duration.
Each time after we train according to some $p^{t,i}$, we record the resulting changes in loss per group. We then average the loss changes per $p^{t,i}$ across the $\delta S/T$ steps, effectively simulating a training sweep at each round without needing $m$ times the compute and having to roll back training to the beginning of the round. Finally, we solve the linear system of equations to obtain $A^{t}$.

##### Aioli .

In each round of training, we estimate $A^{t}$ using LearnParams and then normalize the entries of $A^{t}$, producing $\bar{A}^{t}$.
Otherwise, $A^{t}$ decreases along with loss over time, resulting in the first few $p^{t}$ updates being much larger in magnitude than others.
We update the proportions using $p_{j}^{t}\propto p_{j}^{t-1}\exp(\eta\sum_{i=1}^{m}\bar{A}_{ij}^{t})$, and train for the remainder of that round using $p_{j}^{t}$.

Finally, we design Aioli so that it can be used to improve other data mixing methods, which we study in Section 6.2. Mixture proportions can be updated using Aioli either from the start of training or from the middle of a run. In the latter case,
we denote an initial static mixture $\bm{p}^{\text{init}}\in\triangle^{m}$ and initial number of steps $S_{\text{init}}$. If $S_{\text{init}}$ is nonzero, Aioli trains according to $\bm{p}_{\text{init}}$ for the first $S_{\text{init}}$ steps before beginning to update the mixture proportions. Aioli is presented in Algorithm 1.

Figure: Algorithm 1 Aioli

Figure: Algorithm 2 LearnParams

## 6 Experimental Results

We evaluate all methods in the LMO framework, including Aioli, in two settings. First, we consider an unrestricted additional training budget setting to assess how Aioli compares to other methods in their original form, since each method uses a different number of extra training runs to learn proportions (Section 6.1).
Second, we consider a restricted training budget setting to assess if Aioli can enhance existing methods in practical, budget-constrained conditions, where existing methods have less than a full training run to learn mixing proportions (Section 6.2). Hyperparameters and experimental details are available in Appendix D, and ablations and downstream evaluation are in Appendix E.

##### Data settings and models.

We use the same data settings and models as in Section 4.1, where we train for $S=5$K steps for $m=2,3$-group settings and $S=40$K steps for the full SlimPajama.

##### Baselines and evaluation.

We consider three online methods (Skill-It, DoGE, DoReMi) and one offline method (DML). We also consider grid search (GS), which sweeps training runs and selects $\bm{p}$ with the lowest average validation loss, and stratified sampling, which sets $p_{i}=\frac{1}{m}$ for all $i\in[m]$.
For each method, we report the average test perplexity per group of the trained model. This metric is considered a proxy for downstream performance [] and also represents the objective in the data mixing problem presented in Section 2.

### 6.1 Unrestricted Setting

##### Setup.

We allow methods up to $10S$ additional training steps to learn the mixture proportions. Approaches like grid search and DML can use the entire budget (searching and fitting over $10$ full runs), while Skill-It, DoReMi, and DoGE use $mS$, $2S$, and $S$ extra training steps, respectively (see Section 3.3). Stratified sampling and Aioli use no extra training steps. We evaluate Aioli with $S_{\text{init}}=0$.

##### Results.

In Table 2, we find that Aioli robustly outperforms stratified sampling in all 6 data settings by an average of 0.280 perplexity points, while all other methods do worse than stratified sampling on at least 1 set of data groups by up to 6.9 points.
The performance of Aioli and other online methods is additionally reflected in Figure 3, in which we find that Aioli’s $A^{t}$ similarity with $A^{t\star}$ is correlated with performance. While Aioli’s parameter similarity is not always the highest, we note that its lowest similarity score is much higher than that of other methods, providing evidence that Aioli’s parameter estimation procedure is more consistently accurate than that of other methods. Lastly, regarding offline methods, we hypothesize that their poor performance on settings with larger $m$ is due to the training budget being limited to $10S$, and that increasing this budget would eventually allow them to perform well.

### 6.2 Restricted Setting

##### Motivation.

We introduce the restricted setting because practitioners may not have the resources or desire to complete multiple full training runs to learn proportions, especially as recent LLMs are trained for longer and on more data []. As a result, practitioners may only use data mixing methods on shortened runs, producing learned proportions that may be suboptimal on the full run. We study if Aioli is able to improve performance by dynamically adjusting previously learned proportions throughout the full training run.

##### Setup.

We allow all existing methods only $0.5S$ additional training steps to learn the mixture proportions. This requires methods to learn $\bm{p}^{\text{method}}$ over shorter runs of $S_{\text{method}}$ steps each. For instance, grid search will conduct $10$ runs of length $S/20$ (see Table 11). We evaluate each method by using $\bm{p}^{\text{method}}$ learned from shorter runs to train the model on the full run of $S$ steps.
We use Aioli to dynamically adjust each $\bm{p}^{\text{method}}$ throughout the full run. That is, for each existing method, we run Aioli with $\bm{p}^{\text{init}}=\bm{p}^{\text{method}}$ and $S_{\text{init}}=S_{\text{method}}$, referring to this as Aioli +method.

**Table 2: Difference in average test perplexity compared to stratified sampling in the unrestricted setting, where all methods can use $\leq 10$ extra runs to learn $\bm{p}$. Negative values (green) = improvement. A=Arxiv, B=Books, GH=GitHub, SE=StackExchange, W=Wikipedia.**
| Method | A/SE | GH/C4 | B/SE | A/B/SE | CC/GH/W | SlimPajama | # $<$ stratified | # extra runs |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Stratified | $16.532$ | $35.991$ | $47.192$ | $35.114$ | $41.583$ | $26.426$ | - | 0 |
| GS | $-0.399$ | $-0.407$ | $-0.645$ | $-0.247$ | $0.298$ | $0.176$ | 4 | 10 |
| DML | $-0.241$ | $-0.110$ | $-0.644$ | $-0.599$ | $0.242$ | $0.175$ | 4 | 10 |
| Skill-It | $-0.326$ | $0.551$ | $-0.728$ | $-0.568$ | $-0.195$ | $-0.184$ | 5 | $m$ |
| DoReMi | $-0.307$ | $5.303$ | $-0.217$ | $-0.393$ | $6.898$ | $0.123$ | 3 | 2 |
| DoGE | $0.419$ | $0.184$ | $-0.678$ | $1.843$ | $0.604$ | $0.809$ | 1 | 1 |
| Aioli | $-0.205$ | $-0.340$ | $-0.439$ | $-0.096$ | $-0.196$ | $-0.240$ | 6 | 0 |

##### Results.

In Table 3, we find that adding Aioli to any existing method that learns proportions over shorter runs improves average test perplexity per group in 28 out of 30 settings, by an average of 1.202 and a maximum of 12.012 points.
Furthermore, Aioli can help methods that initially underperform stratified sampling surpass it, such as DoGE across all settings. In some settings, such as Books/StackExchange, Aioli improves methods that already outperform stratified sampling.
This shows that Aioli can enhance a wide variety of mixture proportions, regardless of their initial performance.
For the two cases where Aioli underperforms the base method, the base method already outperforms stratified, and adding Aioli maintains this trend, worsening perplexity by at most 0.025 points.

**Table 3: Average test perplexity in the restricted setting, where each method learns $\bm{p}$ on shortened runs, and Aioli +method dynamically adjusts $\bm{p}$ throughout training. green=Aioli +method outperforms method.**
| Method | Arxiv/SE | GH/C4 | Books/SE | Arxiv/Books/SE | CC/GH/Wiki | SlimPajama |
| --- | --- | --- | --- | --- | --- | --- |
| GS | $16.573$ | $36.345$ | $47.063$ | $35.174$ | $42.767$ | $27.741$ |
| Aioli + GS | $16.388\$ | $35.925\$ | $46.667\$ | $34.705\$ | $41.378\$ | $25.654\$ |
| DML | $16.659$ | $36.658$ | $46.846$ | $34.585$ | $42.731$ | $37.696$ |
| Aioli + DML | $16.277$ | $35.856$ | $46.710$ | $34.529$ | $41.595$ | $25.654\$ |
| Skill-it | $16.246$ | $37.255$ | $46.667$ | $34.539$ | $42.069$ | $26.734$ |
| Aioli + Skill-it | $16.261$ | $36.153$ | $46.586$ | $34.565$ | $41.732$ | $26.073\$ |
| DoReMi | $16.522$ | $37.812$ | $46.489$ | $34.934$ | $42.738$ | $28.762$ |
| Aioli + DoReMi | $16.347$ | $35.626$ | $46.163$ | $34.770\$ | $41.800$ | $26.587\$ |
| DoGE | $16.853$ | $35.795$ | $46.743$ | $35.775$ | $41.790$ | $32.301$ |
| Aioli + DoGE | $16.473\$ | $35.632$ | $46.145\$ | $34.771\$ | $41.378$ | $26.073$ |

## 7 Related Work

##### Data mixing.

Beyond the data mixing methods explored in our framework, Albalak et al. [] frames online data mixing as a multi-armed bandit problem with loss as the reward function.
In concurrent work, Jiang et al. [] also set data mixtures online and adaptively by using a credit assignment score that predicts how data from each domain affects loss on that domain. In our language, Jiang et al. [] use a diagonal $A^{t}$ matrix, and the values on the diagonal are defined by their credit assignment function and the per-group losses.
Recent works have also studied how to mix data on smaller models and use these learned proportions on larger models [, , ].
In a similar vein, Na et al. [] show that one can simulate a model trained on a particular data mixture by averaging together models trained on different (possibly disjoint) partitions of data groups.
Thrush et al. [] mixes data to optimize performance on downstream tasks, constructing an $A^{t}$-like interaction matrix by using pretrained model perplexities.

##### Curriculum Learning.

Bengio et al. [] initially introduced curriculum learning as training models over samples from easiest to hardest. While early work focused on manually designed curricula, later work emphasizes model-driven ones [, , , ]. Curricula can encourage skills-based generalization [], or emphasize high quality data to improve downstream task performance [].
Online mixing methods can be also viewed as curriculum learning over data groups.

##### Data Selection.

A common way to curate datasets besides mixing is to select data at the per-sample level []. Techniques here can be broadly classified as data filtering, data matching, and data condensation. In data filtering, low-quality samples are removed using simple heuristics, such as GitHub file lengths [, ], or via deduplication [, , ]. In data matching, samples that are most similar to a reference dataset are selected. Similarity can be defined in terms of embeddings [], gradients [, ], or directly using machine learning models to score samples [, , ]. Lastly, data condensation aims to identify a subset of samples that captures the full training dataset’s properties. Selection mechanisms include using gradients, model predictions, and embedding distances [, , ].

##### Hyperparameter Optimization and Truncation Bias.

Many data mixing methods utilize extra training runs to learn the static mixture proportions before the final training run. This allows us to view data mixing as a hyperparameter optimization problem in $\bm{p}$.
[] and [] mitigate the inefficiency of grid search in higher dimensions by combining it with data mixing laws to impose additional structure. However, both grid search and these offline methods can have poor performance when $\bm{p}$ is searched for or fitted on shorter runs, as in the restricted setting.
To understand these results, we note that many popular hyperparameter optimization methods carefully control truncation, and some runs are allowed to continue longer than others [, , ]. Thus, generic hyperparameter optimization methods may eventually prove effective for tuning data mixes.

## 8 Discussion

We propose an optimization framework, LMO, that can express several existing data mixing methods using their implicit mixing law.
Using LMO, we show that linear dynamic mixing laws are well-specified in capturing the true loss-proportion relationship across datasets, but existing online methods still perform poorly on some datasets because their parameters are inaccurate. This insight inspires Aioli, whose performance gains are rooted in its ability to estimate parameters $A^{t}$ of the linear dynamic mixing law throughout training.

##### Limitations and Future Work.

Aioli introduces extra inference cost during training via the repeated evaluations in LearnParams (Alg. 2). This overhead can be reduced or completely mitigated by using the training loss as a proxy for the validation loss, computing $L_{\text{val}}$ over a subset of $D_{\text{val}}$, or by using each $A^{t}$ for longer (equivalently, decreasing $T$).

The LMO framework itself is an invitation for future work.
We hope that LMO identifies clear axes of improvement for data mixing (the parameterization of the mixing law, parameter estimation, and how to solve for $\bm{p}$) and inspires the next generation of principled data mixing methods.
Another direction for future work is understanding how to define data groups and how data group partitions impact data mixing. For example, C4 is a subset of CommonCrawl, so repartitioning these datasets into more disjoint groups could result in better data mixing performance.
Furthermore, it is unclear if linear mixing laws results from some specific property of the data groups we studied. It would be interesting to consider in future work how often linear mixing laws hold, and how to exploit potential non-linearities in data mixing.

### 8.1 Reproducibility Statement

See Appendix B.2 for the full proofs on how to express Skill-it, DoReMi, and DoGE using the LMO framework. See Appendix C for details on how to reproduce our analyses of mixing law parametrization validity, $A^{t}$ parameter fit, and assessing whether greedy optimization is sufficient for data mixing. Finally, to reproduce the experimental results, please see Appendix D.

##### Code release.

Code for reproducing our results is available at [https://github.com/HazyResearch/aioli](https://github.com/HazyResearch/aioli).

### 8.2 Ethics Statement

Our work focuses on improving the efficiency and performance of language model training. While our research does not directly address ethical concerns, it can contribute to more responsible AI development by optimizing training, which can reduce computational costs and energy consumption.

## 9 Acknowledgments

We thank Sabri Eyuboglu, Neel Guha, Ben Viggiano, Dan Biderman, Dan Fu, Michael Wornow, Jon Saad-Falcon, Alyssa Unell, Owen Dugan, Jerry Liu, and Gautam Machiraju for their feedback. We thank NYU HPC and Stanford NLP for providing compute and research support. This research project has benefited from the Microsoft Accelerate Foundation Models Research (AFMR) grant program.

We gratefully acknowledge the support of NIH under No. U54EB020405 (Mobilize), NSF under Nos. CCF2247015 (Hardware-Aware), CCF1763315 (Beyond Sparsity), CCF1563078 (Volume to Velocity), 1937301 (RTML), and 1922658 (NRT-HDR: FUTURE); US DEVCOM ARL under Nos. W911NF-23-2-0184 (Long-context) and W911NF-21-2-0251 (Interactive Human-AI Teaming); ONR under Nos. N000142312633 (Deep Signal Processing); Stanford HAI under No. 247183; NXP, Xilinx, LETI-CEA, Intel, IBM, Microsoft, NEC, Toshiba, TSMC, ARM, Hitachi, BASF, Accenture, Ericsson, Qualcomm, Analog Devices, Google Cloud, Salesforce, Total, the HAI-GCP Cloud Credits for Research program, the Stanford Data Science Initiative (SDSI), the Samsung Advanced Institute of Technology (under the project Next Generation Deep Learning: From Pattern Recognition to AI), the NSF Graduate Research Fellowship (MYH), and members of the Stanford DAWN project: Meta, Google, and VMWare. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views, policies, or endorsements, either expressed or implied, of NIH, ONR, or the U.S. Government.

## Appendix

In Appendix A, we provide a glossary of notation used in the paper. In Appendix B, we discuss how additional data mixing methods are related to the LMO framework and provide proofs that existing methods can be expressed in our framework. In Appendix C, we provide additional results on our analysis of existing data mixing methods. In Appendix D we provide additional details for our results in Section 6, and in Appendix E we provide additional results, including downstream evaluation and ablations.

## Appendix A Notation

The glossary is given in Table 4 below.

**Table 4: Glossary of variables and symbols used in this paper.**
| Symbol | Used for |
| --- | --- |
| $m$ | The number of data groups. Examples of data groups include a pre-training domain or an instruction-tuning task. |
| $D_{\text{train/val/test}}$ | Training, validation, and test datasets comprised of $m$ groups, where $D_{(\cdot)}^{i}$ is group $i$’s training/validation/test data. |
| $N$ | Total number of samples from $D_{\text{train}}$ to train on. |
| $S$ | Number of steps to train for (i.e., $S=N\times\text{batch size}$). |
| $T$ | Number of rounds to divide training into, where each round is $\frac{S}{T}$ steps. |
| $\bm{p}$ | Mixture proportions are $\bm{p}=(p^{1})$ for $T=1$ (static) and $\bm{p}=(p^{1},\dots,p^{T})$ for $T>1$ (dynamic), |
|  | where $p^{t}=[p_{1}^{t},\dots,p_{m}^{t}]\in\triangle^{m}$ is a probability distribution. |
| $f$ | A language model (can be either pre-trained or initialized from scratch). |
| $f(\bm{p},t)$ | The model $f$ at the beginning of round $t$ after being trained on $p^{1},\dots,p^{t-1}$ so far. |
| $L_{\text{train/val/test}}(f)$ | $L_{\text{train}}(f)=(L_{\text{train},1}(f),\dots,L_{\text{train},m}(f))$ is the vector of $f$’s training losses over each data group; |
|  | similarly defined for validation and test losses. |
| $L_{(\cdot)}^{t}(\bm{p})$ | Shorthand for $L_{(\cdot)}(f(\bm{p},t))$. When dealing with static mixtures, we also use $L_{(\cdot)}(\bm{p})$. |
| $A^{t}$ | Parameter matrix $A^{t}\in\mathbb{R}^{m\times m}$ used in mixing laws (2), capturing cross-group interactions. |
|  | See Table 1 for instantiations. |
| $b^{t},c^{t}$ | Group-specific parameters $b^{t},c^{t}\in\mathbb{R}^{m}$ used in mixing laws 2. Note that the value of $c^{t}$ does not impact the |
|  | LMO framework, and neither does $b^{t}$ when all $b_{i}^{t}$ are equal. |
| $\sigma$ | Either $\sigma:\mathbb{R}\rightarrow\mathbb{R}=\text{Id}$ or $\exp$. |
| $Z^{t}$ | Used for normalization in proportion update rule. |
| $\eta$ | Step size $\eta>0$ used in proportion update rule. |
| $\mathcal{P}$ | The set of mixture proportions that comprises a training sweep. |
| $A^{t\star}$ | Approximately optimal $A^{t}$ for the linear dynamic mixing law, obtained by fitting |
|  | $L{\text{val}}^{t+1}(\bm{p})=L{\text{val}}^{t}(\bm{p})-A^{t\star}\bm{p}$ over training sweeps. |
| $\tilde{A}^{t}$ | Method-specific $\tilde{A}^{t}=b^{t}A^{t}$, where $A^{t}$ is obtained directly from the method and |
|  | $b^{t}\in\mathbb{R}$ is learned from training sweeps. |
| $\text{sim}(\tilde{A}^{t},A^{t\star})$ | Similarity between method-specific and optimal $A^{t}$, defined as an average of cosine similarity and |
|  | Spearman rank correlation over $A^{t}$’s normalized column sums. |
| $\varepsilon$ | one-hot smoothing factor used to define $p^{t,i}=(1-\varepsilon)\mathbf{1}_{i}+\varepsilon\text{Unif}(m)$, smoothed one-hot distributions |
|  | we use to learn $A^{t}$ in Aioli. |
| $\delta$ | The fraction per round dedicated to learning $A^{t}$ in Aioli. |
| $k$ | Number of sweeps per group to average $A^{t}$ estimates over in Aioli. |
| $\bm{p}^{\text{init}}$ | Initial mixture $\bm{p}^{\text{init}}\in\triangle^{m}$ that Aioli can dynamically adjust. |
| $S_{\text{init}}$ | Number of steps to train according to $\bm{p}^{\text{init}}$. |

## Appendix B LMO framework details

### B.1 Additional existing methods

We comment on two other popular data mixing methods, Online Data Mixing (ODM) [] and RegMix [].

In ODM [], data mixing is framed as a multi-armed bandit problem, where each arm is a data group that a batch is trained on, and the reward function is defined in terms of the training loss of each group. ODM uses the EXP3 algorithm to explore training on different data groups. $p^{t}$, which is used to determine which group the entire training batch is comprised of, is updated according to $p_{j}^{t+1}=(1-m\varepsilon_{t})\frac{\exp(\varepsilon_{t-1}R_{j}^{t})}{\sum_{
i=1}^{m}\exp(\varepsilon_{t-1}R_{i}^{t})}+\varepsilon_{t}$. $\varepsilon_{t}$ is an exploration rate, and the reward function is $R_{j}^{t}=\alpha R_{j}^{t-1}+(1-\alpha)\frac{L_{\text{train},j}^{t}(\bm{p})}{p
_{j}^{t}}$ if the $j$th group is selected at time $t$; otherwise, $R_{j}^{t}=R_{j}^{t-1}$. While the exploration and the smoothing of $p^{t}$ and $R^{t}$ make this method not directly expressible in our framework, we note that the update rule can be loosely interpreted as allocating larger proportions to groups that have high loss. This update rule does not consider cross-group interactions and is thus similar to DoReMi’s update rule, which utilizes a diagonal $A^{t}$ defined in terms of current loss.

RegMix [] conducts many training runs on smaller models at shorter scales. Similar to DML [], a regression model is fit to these runs and used to predict mixture proportions for a longer run on a larger model. They consider using a linear regression model, i.e., the mixing law $L_{\text{val},i}(\bm{p})=c_{i}-\sum_{j=1}^{m}A_{ij}p_{j}^{t}$, but find that the $R^{2}$ is relatively low (0.87). Instead, their main approach uses LightGBM, a tree-based gradient boosting approach, i.e., using an ensemble of non-linear decision trees as a mixing law. We note that Aioli could be used in conjunction with RegMix to facilitate better transfer across model size and training duration in their settings, an exciting direction for future work.

### B.2 Proofs for section 3.3

#### B.2.1 Background on Exponentiated Gradient Descent

We provide background on exponentiated gradient descent (EGD) taken from Kakade [].
In EGD, we have a sequence of decisions $w^{1},\dots,w^{T}$, where $w^{t}=[w_{1}^{t},\dots,w_{m}^{t}]\in\triangle^{m}$. We also have a sequence of cost functions $c^{1},\dots,c^{T}:\triangle^{m}\rightarrow\mathbb{R}$. To minimize the total cost $\sum_{t=1}^{T}c^{t}(w^{t})$, the EGD update rule sets $w^{0}=\text{Unif}(m)$, and updates according to $w_{j}^{t+1}=\frac{w_{j}^{t}\exp(-\eta\triangledown_{j}c^{t}(w^{t}))}{Z_{t}}$. $Z_{t}$ ensures that $w^{t+1}\in\triangle^{m}$, $\eta$ is a step size, and $\triangledown_{j}c^{t}(w^{t})$ denotes $\frac{\partial c^{t}(w^{t})}{\partial w_{j}^{t}}$. EGD is known to have certain regret guarantees on the value of costs incurred by playing $w^{1},\dots,w^{T}$ versus always playing the best fixed point in hindsight, i.e., the quantity $\sum_{t=1}^{T}c^{t}(w^{t})-\inf_{w\in\triangle^{m}}\sum_{t=1}^{T}c^{t}(w)$.
We now are ready to prove Lemma 1.

See 1

###### Proof.

The cost function at each timestep in our setting is $\sum_{i=1}^{m}L_{\text{val},i}^{t+1}(\bm{p})$, and the decision we make is $p^{t}$. The mixing law constraint in (2) with $\sigma=\text{Id}$ is $L_{\text{val},i}^{t+1}(\bm{p})=c_{i}^{t}-b_{i}^{t}\sum_{j=1}^{m}A_{ij}^{t}p_{j
}^{t}$ for all $i\in[m]$, so our objective function (1) can be written as

$$ $\displaystyle\sum_{i=1}^{m}\bigg{(}c_{i}^{t}-b_{i}^{t}\sum_{j=1}^{m}A_{ij}^{t} p_{j}^{t}\bigg{)}.$ (4) $$

The gradient of this expression with respect to $p_{j}^{t}$ for $j\in[m]$ is $-\sum_{i=1}^{m}b_{i}^{t}A_{ij}^{t}$. Plugging this into the EGD update rule, we obtain the update $p_{j}^{t+1}=\frac{1}{Z_{t}}p_{j}^{t}\exp(\eta\sum_{i=1}^{m}b_{i}^{t}A_{ij}^{t})$.
∎

###### Proof.

#### B.2.2 Proof of Theorem 1

To prove Theorem 1, we write out individual propositions 1, 2, 3 for expressing each online method in the LMO framework.

By our definition of what it means to express a method in LMO, we must consider how each method 1) trains $f$ and 2) sets $p^{t}$. We must see if this procedure can be replicated by solving some specification of the LMO optimization problem in our data mixing setup.

Critically, note that this definition of “expression” does not claim that the optimization problems proposed in existing methods are exactly the same as the LMO optimization problem. Instead, we are stating that the training procedures used in their methods can be equivalently viewed as a way of solving the LMO optimization problem subject to certain assumptions on the loss-proportion relationship.

###### Proposition 1 (Skill-It Derivation) .

Using a) a linear dynamic parameterization $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m
}A_{ij}^{t}p_{j}^{t}$, b) parameters $A_{ij}^{t}=L_{\text{val},i}^{t}(\bm{p})\cdot(L_{\text{val},i}^{T+1}(\mathbf{1}
_{j})-L_{\text{val},i}^{1}(\mathbf{1}_{j}))/L_{\text{val},i}^{1}(\mathbf{1}_{j})$, and c) exponentiated gradient descent (EGD) to solve for $\bm{p}$, the LMO framework (1) can express Skill-It.

###### Proof.

The Skill-It algorithm sets $p^{t}$ in each round and then samples from $D_{\text{train}}$ according to $p^{t}$ to train $f$ for a round. This training procedure is directly specified in our data mixing problem setup (Section 2). Therefore, we simply need to show that the Skill-It update rule can be converted into a linear dynamic mixing law.
By comparing Lemma 1 and the Skill-It update rule $p_{j}^{t+1}=\frac{1}{Z_{t}}\cdot p_{j}^{t}\exp\big{(}\eta\sum_{i=1}^{m}A_{ij}^
{\text{SG}}L_{\text{val},i}^{t}(\bm{p})\big{)}$, we can match $A_{ij}^{t}$ in the lemma with $A_{ij}^{\text{SG}}$ in Skill-It, and we can match $b_{i}^{t}$ in the lemma with $L_{\text{val},i}^{t}(\bm{p})$. Therefore, Lemma 1 tells us that using $L_{\text{val},i}^{t+1}(\bm{p})=c_{i}^{t}-b^{t}\sum_{j=1}^{m}L_{\text{val},i}^{
t}(\bm{p})A_{ij}^{\text{SG}}p_{j}^{t}$ in the LMO framework with exponentiated gradient descent recovers Skill-It (since the $b^{t}$ and $c_{i}^{t}$ can be dropped and are only used for scaling $A^{t}$).

Using the definition of $A_{ij}^{\text{SG}}$, we can rewrite the mixing law as $L_{\text{val},i}^{t+1}(\bm{p})=c_{i}^{t}-b^{t}\sum_{j=1}^{m}A_{ij}^{t,\text{
Skill-It}}p_{j}^{t}$ where $A_{ij}^{t,\text{Skill-It}}=L_{\text{val},i}^{t}(\bm{p})(L_{\text{val},i}^{T+1}
(\mathbf{1}_{j})-L_{\text{val},i}^{1}(\mathbf{1}_{j}))/L_{\text{val},i}^{1}(
\mathbf{1}_{j})$. Lastly, note that we can replace $c_{i}^{t}$ with any other value, including $L_{\text{val},i}^{t}(\bm{p})$, due to the fact that $p^{t}$ has $m-1$ degrees of freedom (see Lemma 2).

We note that [] explicitly specifies their mixing law in equation 2 of their paper, along with the same objective function as ours in the LMO framework.
∎

###### Proposition 2 (DoReMi Derivation) .

Using a) a linear dynamic parameterization $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m
}A_{ij}^{t}p_{j}^{t}$, b) parameters $A_{ij}^{t}=\min\{L_{\text{train},i}^{t}(\bm{p})-L_{\text{train},i}(f_{\text{
ref}}),0\}$ for $i=j$ and $A_{ij}=0$ otherwise, and c) EGD to solve for $\bm{p}$, the LMO framework (1) can express DoReMi’s proxy model.

###### Proof.

When training the proxy model for DoReMi, $p^{t}$ is set in each round, and then $f$ is updated to minimize $\sum_{i=1}^{m}p_{i}^{t}L_{\text{train},i}(f)$.
Using Lemma 3, we establish that DoReMi’s weighted training objective at each timestep is equal in expectation to the objective of training on data sampled from $p^{t}$, which is what our problem setup focuses on. Having established that the training procedure is the same in expectation, we now need to show that the DoReMi $p^{t}$ update rule can be converted into a linear dynamic mixing law.
By comparing Lemma 1 and the DoReMi update rule $p_{j}^{t+1}\propto p_{j}^{t}\exp(\eta\max\{L_{\text{train},j}^{t}(\bm{p})-L_{
\text{train},j}(f_{\text{ref}}),0\})$, we can match $A_{ij}^{t}$ in the lemma with 0 0 for $i\neq j$, and $A_{ii}^{t}$ with $\max\{L_{\text{train},j}^{t}(\bm{p})-L_{\text{train},j}(f_{\text{ref}}),0\}$. Therefore, Lemma 1 tells us that using $L_{\text{val},i}^{t+1}=c_{i}^{t}-b^{t}\sum_{j=1}^{m}A_{ij}^{t}p_{j}^{t}$ with $A_{ii}^{t}=\max\{L_{\text{train},j}^{t}(\bm{p})-L_{\text{train},j}(f_{\text{
ref}}),0\}$ can express the DoReMi proxy model training. We include $b^{t}$ to allow for scaling $A^{t}$, but since this does not impact the optimal $\bm{p}$, it is not in the update rule. Lastly, applying Lemma 2 lets us write the mixing law as $L_{\text{val},i}^{t+1}=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m}A_{ij}^
{t}p_{j}^{t}$.

We comment on the fact that DoReMi’s proxy model is trained with a DRO (distributionally robust optimization) min-max objective, namely, $\text{minimize}_{f}\;\text{maximize}_{p}\sum_{i=1}^{m}p_{i}L_{\text{train},i}^
{T+1}(f)$. This objective, which differs from our data mixing objective, yields $p^{t}$ gradient ascent and $f^{t}$ gradient descent updates. However, we are still able to express this training procedure in the LMO framework, since our claim is: if we assume that the $L_{\text{val},i}^{t+1}=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m}A_{ij}^
{t,\text{DRM}}p_{j}^{t}$ mixing law captures the relationship between $L_{\text{val}}^{t}$ and $p^{t}$, then training according to the DoReMi proxy run should not only guide $f$ and $\bm{p}$ to optimize the DRO objective, but also to optimize the average validation loss per group.

∎

###### Proposition 3 (DoGE Derivation) .

Using a) a linear dynamic parameterization $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m
}A_{ij}^{t}p_{j}^{t}$, b) parameters $A_{ij}^{t}=\langle\triangledown L_{\text{val},i}^{t}(\bm{p}),\triangledown L_{
\text{train},j}^{t}(\bm{p})\rangle$ for all $i,j\in[m]$, and c) EGD to solve for $\bm{p}$, the LMO framework (1) can express DoGE’s proxy model.

###### Proof.

When training the proxy model for DoGE, $p^{t}$ is set in each round, and then $f$ is updated to minimize $\sum_{i=1}^{m}p_{i}^{t}L_{\text{train},i}(f)$. Using Lemma 3, we establish that DoGE’s weighted training objective at each timestep is equal in expectation to the objective of training on data sampled from $p^{t}$. Next, we show that the DoGE update rule can be converted into a linear dynamic mixing law. By comparing Lemma 1 and the DoGE update rule $p_{j}^{t+1}\propto p_{j}^{t}\exp(\eta\langle\triangledown L_{\text{train},j}(f
^{t}),\sum_{i=1}^{m}\triangledown L_{\text{val},i}(f^{t})\rangle)$, we can see that $A_{ij}^{t}$ in the Lemma can be matched with $\langle\triangledown L_{\text{train},j}(f^{t}),\triangledown L_{\text{val},i}(
f^{t})\rangle$. Therefore, using the mixing law $L_{\text{val},i}^{t+1}=c_{i}^{t}-b^{t}\sum_{j=1}^{m}A_{ij}^{t}p_{j}^{t}$ with $A_{ij}^{t}=\langle\triangledown L_{\text{train},j}(f^{t}),\triangledown L_{
\text{val},i}(f^{t})\rangle$ allows LMO to express DoGE proxy model training. Again, $b^{t}$ is included for scaling but does not impact optimization, and by applying Lemma 2, we can replace $c_{i}^{t}$ with $L_{\text{val},i}^{t}(\bm{p})$.
∎

###### Lemma 2 .

Let $L_{i}^{t+1}(\bm{p})=c_{i}^{t}-\sum_{j=1}^{m}A_{ij}^{t}p_{j}^{t}$ for some $c^{t}$ and $A^{t}$. Then, there exists an $B_{ij}^{t}$ such that $L_{i}^{t+1}(\bm{p})=L_{i}^{t}(\bm{p})-\sum_{j=1}^{m}B_{ij}^{t}p_{j}^{t}$.

###### Proof.

Since $p^{t}\in\triangle^{m}$, we can write the probability $p_{m}^{t}$ as $1-\sum_{j=1}^{m-1}p_{j}^{t}$. Then, the first equation can be written as

$$ $\displaystyle L_{i}^{t+1}(\bm{p})$ $\displaystyle=c_{i}^{t}-\sum_{j=1}^{m-1}A_{ij}^{t}p_{j}^{t}-A_{im}^{t}\bigg{(} 1-\sum_{j=1}^{m-1}p_{j}^{t}\bigg{)}$ (5) $\displaystyle=c_{i}^{t}-\sum_{j=1}^{m-1}(A_{ij}^{t}-A_{im}^{t})p_{j}^{t}-A_{im }^{t}$ $\displaystyle=L_{i}^{t}(\bm{p})-\sum_{j=1}^{m-1}(A_{ij}^{t}-A_{im}^{t})p_{j}^{ t}-(A_{im}^{t}-c_{i}^{t}+L_{i}^{t}(\bm{p}))$ $\displaystyle=L_{i}^{t}(\bm{p})-\sum_{j=1}^{m-1}(A_{ij}^{t}-A_{im}^{t}+A_{im}^ {t}-c_{i}^{t}+L_{i}^{t}(\bm{p}))p_{j}^{t}-(A_{im}^{t}-c_{i}^{t}+L_{i}^{t}(\bm{ p}))(1-\sum_{j=1}^{m-1}p_{j}^{t})$ $\displaystyle=L_{i}^{t}(\bm{p})-\sum_{j=1}^{m-1}(A_{ij}^{t}-c_{i}^{t}+L_{i}^{t }(\bm{p}))p_{j}^{t}-(A_{im}^{t}-c_{i}^{t}+L_{i}^{t}(\bm{p}))(1-\sum_{j=1}^{m-1 }p_{j}^{t}).$ $$

Let $B_{ij}^{t}=A_{ij}^{t}-c_{i}^{t}+L_{i}^{t}(\bm{p})$ for all $j\in[m]$. Then, this equation becomes

$$ $\displaystyle L_{i}^{t+1}(\bm{p})$ $\displaystyle=L_{i}^{t}(\bm{p})-\sum_{j=1}^{m-1}B_{ij}^{t}p_{j}^{t}-B_{im}^{t} (1-\sum_{j=1}^{m-1}p_{j}^{t})$ (6) $\displaystyle=L_{i}^{t}(\bm{p})-\sum_{j=1}^{m}B_{ij}^{t}p_{j}^{t}.$ $$

∎

###### Lemma 3 .

Let $L_{B}^{t}(f,p)$ be the total training loss of $f$ on a batch of size $B$ sampled from $D_{\text{train}}$ according to $p\in\triangle^{m}$, and let $L_{B,i}^{t}(f,p)$ be the total training loss on samples from group $i$ in that batch. Then, the average loss over a uniformly sampled batch weighted by $p^{t}$ is equal in expectation to the average loss per group over a batch sampled according to $p^{t}$:

$$ $\displaystyle\mathbb{E}\left[\sum_{i=1}^{m}p_{i}^{t}L_{B,i}^{t}(f,\text{Unif}( m))\right]=\mathbb{E}\left[\frac{L_{B}^{t}(f,p^{t})}{m}\right]$ (7) $$

###### Proof.

Let each group $i$ consist of samples $x$ from the distribution $\mathcal{D}_{i}$, where $D_{\text{train}}\sim\mathcal{D}_{i}$ and let $\tilde{L}_{\text{train, i}}(f)=\mathbb{E}_{x\sim\mathcal{D}_{i}}\left[\ell(f,x
)\right]$ be the population-level loss on group $i$, where $\ell(f,x)$ is $f$’s loss on sample $x$.

If a batch is uniformly sampled, each group has $B/m$ samples. We can then write $L_{B,i}^{t}(f,\text{Unif}(m))=\sum_{k=1}^{B/m}\ell(f,x_{k}^{i})$, where $x_{k}^{i}$ is the $k$th sample of group $i$ in the batch. Then,

$$ $\displaystyle\mathbb{E}\left[\sum_{i=1}^{m}p_{i}^{t}L_{B,i}^{t}(f,\text{Unif}( m))\right]=\mathbb{E}\left[\sum_{i=1}^{m}p_{i}^{t}\sum_{k=1}^{B/m}\ell(f,x_{k} ^{i})\right]=\sum_{i=1}^{m}\frac{p_{i}^{t}B}{m}\tilde{L}_{\text{train, i}}(f).$ (8) $$

Next, if a batch is sampled according to $p^{t}$, then group $i$ has $Bp_{i}^{t}$ samples in the batch. We can then write $L_{B}^{t}(f,p^{t})=\sum_{i=1}^{m}\sum_{k=1}^{p_{i}^{t}B}\ell(f,x_{k}^{i})$. Then,

$$ $\displaystyle\mathbb{E}\left[\frac{L_{B}^{t}(f,p^{t})}{m}\right]=\mathbb{E} \left[\sum_{i=1}^{m}\sum_{k=1}^{p_{i}^{t}B}\frac{\ell(f,x_{k}^{i})}{m}\right]= {\sum_{i=1}^{m}\frac{p_{i}^{t}B}{m}\tilde{L}_{\text{train, i}}(f)}.$ (9) $$

This hence establishes the equivalence in expectation between a weighted training objective and training on data sampled according to $\bm{p}$.

∎

###### Proposition 1 (Skill-It Derivation) .

###### Proof.

###### Proposition 2 (DoReMi Derivation) .

###### Proof.

###### Proposition 3 (DoGE Derivation) .

###### Proof.

###### Lemma 2 .

###### Proof.

###### Lemma 3 .

###### Proof.

## Appendix C Analysis Details and Additional Results

### C.1 Mixing Law Parameterization

**Table 5: Comparison of log-linear static and linear dynamic mixing law parameterizations across different data settings with MSE and $R^{2}$ metrics. Both log-linear and linear dynamic mixing laws fit the relationship between mixing proportions and losses well.**
| Parameterization | Arxiv/SE | GH/C4 | Books/SE |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| MSE | $R^{2}$ | MSE | $R^{2}$ | MSE | $R^{2}$ |  |
| Log-linear static | 2e-4 | 0.990 | 5e-4 | 0.989 | 6e-4 | 0.987 |
| Linear dynamic | 2e-4 | 0.936 | 1e-4 | 0.948 | 4e-5 | 0.926 |
|  | Arxiv/Books/SE | CC/GH/Wiki | SlimPajama |  |  |  |
|  | MSE | $R^{2}$ | MSE | $R^{2}$ | MSE | $R^{2}$ |
| Log-linear static | 6e-4 | 0.991 | 0.001 | 0.989 | 0.002 | 0.997 |
| Linear dynamic | 6e-5 | 0.957 | 1e-4 | 0.975 | 5e-6 | 0.938 |

We describe how we performed the linear and log-linear parameterization experiments.
For the log-linear static parameterizations, we train our model on $\bm{p}\in\mathcal{P}$ sweeps and fit the parameters using code provided in Ye et al. [] (i.e., using PyTorch and L-BFGS to minimize the Huber loss of the mixing law). We do this over $5$ random seeds for $k=2,3$ and over 3 seeds for the full SlimPajama.

For the linear dynamic parameterizations, for $k=2,3$ we train the model for $2000$ steps according to some $p^{0}\in\mathcal{P}$, and then sweep over $\mathcal{P}$ for the next 100 steps. We do this for one random seed, performing $|\mathcal{P}|^{2}$ total runs. For the full SlimPajama setting, we train the model for $10000$ steps using stratified sampling, and then sweep over $\mathcal{P}$ for the next $5000$ steps. We fit the parameters using Pytorch and L-BFGS.

#### C.1.1 Additional parameterization experiments

Parameterization across checkpoints. We investigate whether the log-linear static and linear dynamic mixing laws remain well-specified in later stages of training and on other datasets.
To do so, we take various Pythia 160M checkpoints  [], sweep mixing proportions, and fit the linear dynamic and log-linear static mixing laws. We train for $2000$ steps according to the learning rates and learning rate scheduler reported in []. We fit the static mixing law on full runs of $2000$ steps, and the linear dynamic mixing law at $t=500$, after which we do a training sweep over the next $500$ steps.
In Tables 6 and 7, we find that the strong fit for log-linear static mixing laws
continues to hold during pre-training at checkpoint 72K (roughly halfway through training Pythia-160M) and after pre-training, with an average $R^{2}$ of 0.982 and 0.991, respectively. However, the linear dynamic mixing law’s $R^{2}$ coefficient is lower, averaging 0.815 at checkpoint 72K and 0.830 at the end of pre-training. It may be interesting to further study if the dynamics of the loss-proportion relationship evolve in a structured way throughout training, or if these results are due to more noise in how models learn at later stages of training.

Parameterization across other sets of data groups. In Figure 4, we identify an example set of data groups that exhibits a non-linear relationship between loss and proportion: Books/C4 from SlimPajama. For these two data groups, we see that as the proportion of Books increases while C4 decreases, the loss on Books starts *increasing* past a certain $\bm{p}$, suggesting quite counterintuitively that performance on Books is optimized by allocating some proportion to C4.
In this case, neither log-linear static or linear dynamic mixing laws have good fit to the proportion-loss relationship, as neither can represent the non-linearity.
In particular, the average MSE and $R^{2}$ for the log-linear static mixing law is $0.003$ and $0.558$, respectively, and the average MSE and $R^{2}$ for the linear dynamic mixing law is $0.0002$ and $0.721$.

Fortunately, because these nonlinearities exist on the boundary of the simplex and tend to incur high loss, they tend to have little impact on the optimization of $\bm{p}$, which strives to minimize the average loss for the standard data mixing problem.
For instance, we found that the optimal proportion according to Ye et al. []’s log-linear static mixing law on one random seed was $[0.176,0.824]$, and the true optimal from grid search was $[0.2,0.8]$.
However, it is important to further investigate this non-linear phenomenon on additional data groups and training regimes, which we defer to future work.

**Table 6: Comparison of log-linear static and linear dynamic mixing law parameterizations when training from the 72K Pythia-160M checkpoint.**
| Parameterization | Arxiv/SE | GH/C4 | Books/SE |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| MSE | $R^{2}$ | MSE | $R^{2}$ | MSE | $R^{2}$ |  |
| Log-linear static | 2e-4 | 0.975 | 7e-5 | 0.992 | 2e-4 | 0.981 |
| Linear dynamic | 4e-4 | 0.834 | 7e-4 | 0.815 | 6e-4 | 0.796 |

**Table 7: Comparison of log-linear static and linear dynamic mixing law parameterizations when training from the pre-trained Pythia-160M.**
| Parameterization | Arxiv/SE | GH/C4 | Books/SE |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| MSE | $R^{2}$ | MSE | $R^{2}$ | MSE | $R^{2}$ |  |
| Log-linear static | 3e-6 | 0.994 | 4e-6 | 0.992 | 6e-6 | 0.986 |
| Linear dynamic | 5e-5 | 0.896 | 8e-5 | 0.824 | 1e-4 | 0.769 |

Figure: Figure 4: Top: Log-linear static mixing law fit on Books/C4 across 5 random seeds (validation loss). Bottom: Linear dynamic mixing law fit on Books/C4 on 1 random seed. Each color is a different initial mixture $p^{0}\in\mathcal{P}$ trained for $2000$ steps, and the fitting sweeps are done over $100$ additional steps.
Refer to caption: x5.png

#### C.1.2 Parameterization on instruction-tuning mixtures

Previously, we studied if training on SlimPajama (from scratch, at a pre-training checkpoint, and at the end of pre-training) exhibited linear dynamic or log-linear static mixing. We now study if supervised fine-tuning on a mixture of task types exhibits similar mixing laws. The data mixing groups we consider are instruction-following tasks. It is important to know how to optimally mix these groups so that the model can follow a variety of instructions, as shown by how existing datasets consist of a diverse set of commands [, , , , , ].

We select $m=9$ tasks from Natural Instructions [, ]: AbductiveNLI, BoolQ, HellaSwag, MathQA, PIQA, SemEval, SQuAD 1.1, SST2, and XSum. We selected tasks with many samples, prioritizing diversity of capabilities and formats. We construct validation and test splits that are 100 samples per group. More information is provided in Table 8.

**Table 8: Overview of Instruction Tasks**
| Task | Task number in Natural Instructions | # Samples | Output Format |
| --- | --- | --- | --- |
| AbductiveNLI [] | task067 | 6499 | Open-ended |
| BoolQ [] | task380 | 6500 | Yes/No |
| HellaSwag [] | task1389 | 6494 | Multiple choice |
| MathQA [] | task1420 | 6452 | Multiple choice |
| PIQA [] | task080 | 6500 | Open-ended |
| SemEval [] | task295 | 5996 | Multiple choice |
| SQuAD 1.1 [] | task075 | 6498 | Open-ended |
| SST2 [] | task363 | 6495 | Pos/Neg |
| XSum [] | task1290 | 6493 | Open-ended |

To conduct the sweeps, we set $\mathcal{P}$ to be $50$ mixing proportions drawn from the Dirichlet distribution with $\alpha=1.5$. For the static parameterization, we conduct 50 training runs over $\mathcal{P}$, for $1000$ steps each, and we do this over $5$ random seeds. For the dynamic parameterization, we train on $10$ proportions from $\mathcal{P}$ for 500 steps and then sweep over the entire $\mathcal{P}$ for the next $100$ steps. We do this over $1$ random seed. We ensure there are no repeated samples in training. We use a pre-trained Pythia-160M model [], consistent with the rest of our experiments, and use a linear scheduler with learning rate 1e-5 and 100 warmup steps.

Our results are in Table 9. In addition to displaying the averaged MSE and $R^{2}$ across all $9$ groups, we also display per-group results. We find that the log-linear static mixing law attains an average $R^{2}$ of 0.888 over these instruction tasks. However, the linear dynamic mixing law only attains an average $R^{2}$ of 0.419. Interestingly, we observe that the $4$ instruction tasks that involve open-ended generation have higher $R^{2}$ (average of $0.73$) while the binary and multiple choice tasks have a lower $R^{2}$ (average of $0.17$) for the linear dynamic law. We hypothesize that this is because tasks that do not require open-ended generation are easier to learn and more susceptible to overfitting. We observed that their validation losses often plateau before $500$ steps, and increasing the proportions after this point does not consistently decrease loss. Finally, we also include a log-linear dynamic mixing law—that is, $\log(L_{\text{val},i}^{t}(\bm{p}))=\log(L_{\text{val},i}^{t-1}(\bm{p}))-\sum_{
j=1}^{m}A_{ij}^{t}p_{j}^{t}$. This can be thought of as a piecewise version of the log-linear static mixing law, and we find that this slightly improves MSE and $R^{2}$ compared to the linear dynamic mixing law.

**Table 9: Comparison of log-linear static, linear dynamic, and log-linear dynamic mixing law parameterizations over instruction-tuning tasks in terms of MSE and $R^{2}$.**
| Task | Log-linear static | Linear dynamic | Log-linear dynamic |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| MSE | $R^{2}$ | MSE | $R^{2}$ | MSE | $R^{2}$ |  |
| AbductiveNLI | 3e-4 | 0.939 | 4e-4 | 0.586 | 4e-5 | 0.599 |
| BoolQ | 1e-3 | 0.941 | 8e-2 | 0.215 | 2e-2 | 0.276 |
| HellaSwag | 6e-4 | 0.848 | 6e-3 | 0.225 | 2e-3 | 0.256 |
| MathQA | 8e-4 | 0.787 | 6e-3 | 0.090 | 2e-3 | 0.115 |
| PIQA | 5e-4 | 0.916 | 3e-4 | 0.754 | 2e-5 | 0.761 |
| SemEval | 9e-4 | 0.974 | 4e-3 | 0.239 | 3e-3 | 0.254 |
| SQuAD 1.1 | 8e-3 | 0.947 | 4e-3 | 0.742 | 9e-4 | 0.766 |
| SST2 | 3e-3 | 0.662 | 2e-2 | 0.082 | 4e-2 | 0.118 |
| XSum | 1e-4 | 0.977 | 1e-4 | 0.838 | 1e-5 | 0.841 |
| Average | 2e-3 | 0.888 | 1e-2 | 0.419 | 8e-3 | 0.443 |

### C.2 Values of mixing law parameters

We explain how to compare method-specific $A^{t}$’s to an approximation of the true $A^{t\star}$. First, after performing method-specific initialization, such as training reference models, we run each online method (Skill-It, DoReMi’s proxy model DoGE’s proxy model, Skill-it, and Aioli) for $t$ steps. For Skill-It, DoReMi, and DoGE, we use the unrestricted setting configuration of hyperparameters presented in Section D.
For Aioli, we analyze the parameters of Aioli +GS from the restricted setting, since we found that this had less noisy fluctuation in the weights than in the unrestricted setting.
For $m=2$, we set $t=1000$ for Skill-It and $t=500$ for DoGE, DoReMi, and Aioli since Skill-It is updated less frequently. For $m=3$, we set $t=1000$ for DoGE, DoReMi and Skill-It, and $t=1500$ for Aioli. We then checkpoint the language model and the method’s $A^{t}$. For DoGE and DoReMi, we compute a smoothed $A^{t}=\frac{1}{100}\sum_{i=1}^{100}A^{t-100+i}$ because each $A^{t}$ is computed at the batch level, and can thus be noisy. For Aioli, we also smooth the $A^{t}$ by averaging the previous timestep parameters.

To approximate $A^{t\star}$, we run a training sweep over $\mathcal{P}$ for the next 100 steps after the checkpoint. We use this training sweep to fit $A^{t\star}$ from the dynamic mixing law $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-\sum_{j=1}^{m}A_{
ij}^{t\star}p_{j}^{t}$.

Before we compare parameters, we must scale $A^{t}$ by some $b^{t}$ where $L_{\text{val},i}^{t+1}(\bm{p})=L_{\text{val},i}^{t}(\bm{p})-b^{t}\sum_{j=1}^{m
}A_{ij}^{t}p_{j}^{t}$ for all $i\in[m]$. This is allowed since $b^{t}$ does not influence the optimal $\bm{p}$ and does not need to be in the update rule. We fit a single $b^{t}$ across all groups’ mixing laws and set $\tilde{A}^{t}=b^{t}A^{t}$.
We can then compare $A^{t}$ and $A^{t\star}$ using the metric $\text{sim}(\tilde{A}^{t},A^{t\star})=0.5\text{cossim}(\tilde{a}^{t},a^{t\star}
)+0.5\text{Spearman}(\tilde{a}^{t},a^{t\star})$, which we proposed in Section 4.3.

#### C.2.1 Properties of A t ⁣ ⋆ superscript 𝐴 𝑡 ⋆ A^{t\star} italic_A start_POSTSUPERSCRIPT italic_t ⋆ end_POSTSUPERSCRIPT

We discuss some properties of $A^{t\star}$, finding that 1) $A^{t\star}$ can vary significantly across time, and 2) $A^{t\star}$ needs to be modeled as a full matrix. In Appendix E.2, we also present ablations on Aioli that test how capturing these two properties in Aioli are important to performance.

For each initial mixture $p^{0}\in\mathcal{P}$, we train for $t=2000$ steps and then sweep over $\mathcal{P}$ for the next $100$ steps. We repeat this setup for $t=4000$ to obtain $A^{2000\star}$ and $A^{4000\star}$. We do this experiment for Arxiv/Stackexchange and Github/C4.

Extent of time variation of $A^{t}$.
We find that the column sums of $A^{t}$ can change order over time, meaning that the $p^{t}$ “changes direction” in terms of which group has the largest proportion. In particular, for $p^{0}=[0.5,0.5]$ and Github/C4, we have that

$$ $\displaystyle A^{2000\star}=\begin{bmatrix}0.148&0.011\\ -0.013&0.087\end{bmatrix}\qquad A^{4000\star}=\begin{bmatrix}0.015&0.001\\ 0.001&0.015\end{bmatrix}$ (10) $$

The column sums are $\mathbf{1}^{\top}A^{2000\star}=[0.135,0.098]$ and $\mathbf{1}^{\top}A^{4000\star}=[0.016,0.017]$, showing that the ordering of proportions of the groups changes. This suggests that the optimal $p^{t}$ can change significantly across time, prioritizing Github initially and later C4, which is also reflected for Github/C4 in the greedy row of Table 10.

However, for Arxiv/Stackexchange, we found that the column sums of $A^{2000\star}$ and $A^{4000\star}$ never change in terms of the ordering of proportions of the data groups, across all $p^{0}\in\mathcal{P}$. As a result, the optimal $p^{t}$ never changes direction.
This suggests that how much $A^{t}$ varies in ordering over time depends on the data groups. As a result, methods like Skill-It, which use a time-invariant $A^{\text{SG}}$ multiplied by validation loss, may not be able to match the true $A^{t\star}$ if the groups’ validation losses change in ranking across time, which we observe in Github/C4.

Modeling $A^{t\star}$ as a full vs diagonal matrix. We find that modeling the off-diagonal entries of $A^{t\star}$ is important. For each sweep, we fit both $A^{t\star}$ as described above and a diagonal matrix $A_{d}^{t\star}$. We compare if the column sums of $A^{t\star}$ and $A_{d}^{t\star}$ differ in the order of elements.

We find that for Arxiv/StackExchange, $p^{0}=0.4$, and both $t=2000$ and $t=4000$, setting $p^{t}$ based on the full matrix would put a larger proportion on StackExchange, while setting $p^{t}$ based on the diagonal matrix would put a larger weight on ArXiv. In particular, the full and diagonal matrices for $t=2000$ are

$$ $\displaystyle A^{2000\star}=\begin{bmatrix}0.249&0.058\\ 0.025&0.224\end{bmatrix}\qquad A_{d}^{2000\star}=\begin{bmatrix}0.284&0\\ 0&0.238\end{bmatrix}$ (11) $$

The second column sum is larger for $A^{2000\star}$ and smaller for $A_{d}^{2000\star}$. We also have similar findings on Github/C4; for $p^{0}=0.6$ and $t=2000$, we have

$$ $\displaystyle A^{2000\star}=\begin{bmatrix}0.119&0.027\\ -0.010&0.104\end{bmatrix}\qquad A_{d}^{2000\star}=\begin{bmatrix}0.135&0\\ 0&0.098\end{bmatrix}$ (12) $$

Using the diagonal matrix for Github/C4 would result in prioritizing training on Github, even though the full matrix suggests that C4 should be prioritized. Therefore, it is important to model $A^{t\star}$ as a full matrix. Methods like DoReMi, which use a diagonal $A^{t}$, can perform suboptimally.

### C.3 Solving strategy

Figure: Figure 5: The linear dynamic parameterization results from Figure 2, with $p^{t}=[0,1]$ and $[1,0]$ also plotted. We see that the linear dynamics are misspecified at $p_{i}^{t}=0$ for both $i$.
Refer to caption: x7.png

We present our results on examining the assumptions made in how existing methods solve the LMO optimization problem. All online methods use exponentiated gradient descent, which updates $p^{t}$ using the gradient at the current timestep. This involves a greedy approximation of the objective function. We study if the greedy approximation yields a $\bm{p}$ is close to the true optimal $\bm{p}$.

For $m=2$ data settings, we take our $S=5000$ steps and split it into $T=2$ rounds. We perform a brute-force sweep at each round over $\mathcal{P}$, which sweeps $p_{1}=0.1,0.2,\dots,0.9$. In total over one random seed, we conduct $81$ training runs for each of Arxiv/Stackexchange, Github/C4, and Books/Stackexchange.

We determine the greedy-approximate $\bm{p}$ by selecting the best $p^{1}$. Then, conditioning on this $p^{1}$, we select the best $p^{2}$. We report what the greedy $\bm{p}$ and its performance is in the first row of Table 10, and we report the optimal $\bm{p}$ and its performance in the second row. Note that this protocol does not depend on the mixing law or a method for setting $\bm{p}$.

We find that for Arxiv/StackExchange and Books/StackExchange, the greedy proportions and the optimal proportions are identical. However, for Github/C4, the greedy approximation fails to recover the optimal proportions. Therefore, the greedy approximation recovers the optimal dynamic proportions in $2$ out of $3$ cases.

**Table 10: Comparison of the greedily selected $p^{1},~{}p^{2}$ versus the optimal $p^{1},~{}p^{2}$ for a $T=2$ rounds data mixing problem. On 2 out of 3 datasets, the greedily selected proportions match the optimal proportions.**
| Solving | Arxiv/SE | GH/C4 | Books/SE |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| $p_{1}^{1},p_{1}^{2}$ | Avg test PPL | $p_{1}^{1},p_{1}^{2}$ | Avg test PPL | $p_{1}^{1},p_{1}^{2}$ | Avg test PPL |  |
| Greedy | $0.4,0.4$ | $16.039$ | $0.6,0.4$ | $36.525$ | $0.3,0.6$ | $45.513$ |
| Optimal | $0.4,0.4$ | $16.039$ | $0.3,0.6$ | $34.709$ | $0.3,0.6$ | $45.513$ |

Beyond exponentiated gradient descent, one may wonder if exactly solving the greedy objective could suffice. For the linear dynamic mixing law $L^{t+1}(\bm{p})=L^{t}(\bm{p})-A^{t}p^{t}$, the optimal $p^{t}$ is $\mathbf{1}_{j}$, where $j=\arg\max\sum_{i=1}^{m}A_{ij}^{t}$. However, we find in Figure 5 that the loss-proportion relationship can be nonlinear at the edge of the simplex where $p^{t}=\mathbf{1}_{j}$.
Exponentiated gradient descent, which uses entropy regularization, is hence able to implicitly avoid extreme $\bm{p}$ where the linear mixing law is misspecified and thus is a practical technique for LMO.

## Appendix D Experimental Details

##### Training details.

To obtain the SlimPajama test sets, we shuffle and split the validation set from SlimPajama-6B [, ] in half.
Next, we discuss the training setups for the restricted and unrestricted settings. For the $m=2,3$ settings, we train a 160M model using Pythia-160M’s configuration for $S=5000$ steps and results are averaged over 5 random seeds. For $m=7$, we train a 160M model using Pythia-160M’s configuration for $S=40000$ steps results are averaged over 3 random seeds. All settings use FlashAttention [], batch size of 8, context size of 2048, and cosine learning rate decay from a starting learning rate of 5e-5 to 1e-5 with 500 steps of learning rate warmup.

For the $m=2,3$ settings, experiments were run on a NVIDIA RTX 6000 Ada Generation GPU. For the $m=7$ setting, experiments were run on a NVIDIA A100 80 GB GPU.

##### Restricted versus unrestricted.

Both the restricted and unrestricted settings share the same length of the final training runs (5000 and 40000 steps, as above). The unrestricted setting gives all methods up to 10 training runs to initialize mixing algorithm parameters, or $10S$ steps, while the restricted setting give $0.5S$ steps. See Table 11 for training budget allocations in each setting. Aioli and stratified sampling do not use extra training runs.

**Table 11: Training budget allocations for restricted and unrestricted settings.**
| Setting | $m$ | Method | Runs within training budget |
| --- | --- | --- | --- |
| Unrestricted | $2$ | DML | 10 runs, 5000 steps |
|  |  | Skill-it | 2 runs, 5000 steps |
|  |  | DoReMi | 2 runs, 5000 steps |
|  |  | DoGE | 1 run, 5000 steps |
|  | $3$ | DML | 10 runs, 5000 steps |
|  |  | Skill-it | 3 runs, 5000 steps |
|  |  | DoReMi | 2 runs, 5000 steps |
|  |  | DoGE | 1 run, 5000 steps |
|  | $7$ | DML | 10 runs, 40000 steps |
|  |  | Skill-it | 7 runs, 40000 steps |
|  |  | DoReMi | 2 runs, 40000 steps |
|  |  | DoGE | 1 run, 40000 steps |
| Restricted | $2$ | DML | 10 runs, 250 steps |
|  |  | Skill-it | 2 runs, 1250 steps |
|  |  | DoReMi | 2 runs, 1250 steps |
|  |  | DoGE | 1 run, 2500 steps |
|  | $3$ | DML | 10 runs, 250 steps |
|  |  | Skill-it | 3 runs, 833 steps |
|  |  | DoReMi | 2 runs, 1250 steps |
|  |  | DoGE | 1 run, 2500 steps |
|  | $7$ | DML | 10 runs, 2000 steps |
|  |  | Skill-it | 7 runs, 2814 steps |
|  |  | DoReMi | 2 runs, 10000 steps |
|  |  | DoGE | 1 run, 20000 steps |

##### Mixing algorithm details.

See Table 12 for a glossary of hyperparameters. $m=2$: restricted Table 13, unrestricted Table 14; $m=3$: restricted Table 15, unrestricted Table 16; $m=7$: restricted Table 17, unrestricted Table 18.

In Table 19, we provide the mixture proportions for each method (averaged across training steps) for each dataset on one random seed. In Figure 6, we provide all of Aioli’s proportion trajectories throughout training in both the unrestricted and restricted settings on one random seed for the $m=2$ settings.

To perform training sweeps and emulate grid searches in static settings for $m=3,7$, we oversampled from the Dirichlet with $\alpha=1$ by 4$x$ the number of points and then hierarchically merged closest points into a centroid until we obtained $x$ points. For example, to obtain 10 points in the $7$-dimensional simplex for SlimPajama, we would sample 40 points in the simplex and hierarchically merge closest points until 10 points remain. This is to ensure that near-duplicate $\bm{p}$’s are not included in the sweep. This procedure is used in Grid Search (GS) and DML in Section 6 and in our analysis in Section 4

##### Aioli -specific hyperparameters

In the unrestricted setting, we found it sometimes helpful to use an exponential moving average with proportion $\gamma$ over $A^{t}$ for Aioli. Formally, the standard $p^{t}$ update rule in Algorithm 1 can be unrolled as $p_{j}^{t+1}\propto p_{j}^{0}\exp(\eta\sum_{\tau=1}^{t}\sum_{i=1}^{m}\bar{A}_{
ij}^{\tau})$, which places equal weight on every $\bar{A}_{ij}^{\tau}$. To incorporate the EMA, we define $A^{1}_{\text{ema}}=\bar{A}^{1}$ and $A^{t}_{\text{ema}}=(1-\gamma)\bar{A}^{t}+\gamma A^{t-1}_{\text{ema}}$. We then use the update rule $p_{j}^{t+1}\propto p_{j}^{0}\exp(\eta A_{\text{ema}}^{t})$.
This allows Aioli to decay the contributions of $A^{t}$, such that the value of $p^{t}$ is less dependent on earlier proportions in the training.

**Table 12: Hyperparameters in each of the online mixing methods. Hyperparameters for grid search and DML are the number of runs and number of steps per run, which are described above.**
| Method | Hyperparameter | Type |
| --- | --- | --- |
| Aioli | $\cdot$ number of rounds $T$ | int |
|  | $\cdot$ sweeps $k$ | int |
|  | $\cdot$ proportion of round $\delta$ dedicated to LearnParams | float |
|  | $\cdot$ EGD learning rate $\eta$ | float |
|  | $\cdot$ $\varepsilon$ one-hot smoothing factor | float |
|  | $\cdot$ EMA parameter $\gamma$ | float or None |
| Skill-it | $\cdot$ number of rounds $T$ | int |
|  | $\cdot$ EGD learning rate $\eta$ | float |
|  | $\cdot$ multiplicative weights window | int |
| DoReMi | $\cdot$ EGD learning rate $\eta$ | float |
| DoGE | $\cdot$ EGD learning rate $\eta$ | float |
|  | $\cdot$ proportion of training batch that consists of validation set. DoGE computes gradients on the validation set | float |

**Table 13: Restricted hyperparameter values for each data mixing algorithm for experiments where $m=2$ (corresponding to Table 3 results).**
| Data groups | Method | Hyperparameter | Value |
| --- | --- | --- | --- |
| arXiv/SE | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.128 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ EMA parameter $\gamma$ | None |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  |  | $\cdot$ proportion of batch for validation set | 0.25 |
| GitHub/C4 | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.128 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ EMA parameter $\gamma$ | None |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.1 |
|  |  | $\cdot$ proportion of batch for validation set | 0.25 |
| Books/SE | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.128 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ EMA parameter $\gamma$ | None |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  |  | $\cdot$ proportion of batch for validation set | 0.25 |

**Table 14: Unrestricted hyperparameter values for each data mixing algorithm for experiments where $m=2$ (corresponding to Table 2 results).**
| Data groups | Method | Hyperparameter | Value |
| --- | --- | --- | --- |
| arXiv/SE | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.128 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ EMA parameter $\gamma$ | 0.1 |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  |  | $\cdot$ proportion of batch for validation set | 0.25 |
| GitHub/C4 | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.128 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.3 |
|  |  | $\cdot$ EMA parameter $\gamma$ | 0.5 |
|  | Skill-it | $\cdot$ number of rounds $T$ | 5 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.1 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.1 |
|  |  | $\cdot$ proportion of batch for validation set | 0.25 |
| Books/SE | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.128 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.1 |
|  |  | $\cdot$ EMA parameter $\gamma$ | None |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.8 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  |  | $\cdot$ proportion of batch for validation set | 0.25 |

**Table 15: Restricted hyperparameter values for each data mixing algorithm for experiments where $m=3$ (corresponding to Table 3 results).**
| Data groups | Method | Hyperparameter | Value |
| --- | --- | --- | --- |
| arXiv/Books/SE | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.288 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ EMA parameter $\gamma$ | None |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  |  | $\cdot$ proportion of batch for validation set | 0.5 |
| CommonCrawl/GitHub/Wiki | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.288 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ EMA parameter $\gamma$ | None |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  |  | $\cdot$ proportion of batch for validation set | 0.5 |

**Table 16: Unrestricted hyperparameter values for each data mixing algorithm for experiments where $m=3$ (corresponding to Table 2 results).**
| Data groups | Method | Hyperparameter | Value |
| --- | --- | --- | --- |
| arXiv/Books/SE | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.288 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.1 |
|  |  | $\cdot$ EMA parameter $\gamma$ | 0.5 |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  |  | $\cdot$ proportion of batch for validation set | 0.5 |
| CommonCrawl/GitHub/Wiki | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 4 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.288 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.3 |
|  |  | $\cdot$ EMA parameter $\gamma$ | 0.5 |
|  | Skill-it | $\cdot$ number of rounds $T$ | 10 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  |  | $\cdot$ proportion of batch for validation set | 0.5 |

**Table 17: Restricted hyperparameter values for each data mixing algorithm for experiments where $m=7$ (corresponding to Table 3 results).**
| Data groups | Method | Hyperparameter | Value |
| --- | --- | --- | --- |
| SlimPajama, full | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 2 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.07 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ EMA parameter $\gamma$ | 0.1 |
|  | Skill-it | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.03 |
|  |  | $\cdot$ proportion of batch for validation set | 0.5 |

**Table 18: Unrestricted hyperparameter values for each data mixing algorithm for experiments where $m=7$ (corresponding to Table 2 results).**
| Data groups | Method | Hyperparameter | Value |
| --- | --- | --- | --- |
| SlimPajama, full | Aioli | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ sweeps $k$ | 2 |
|  |  | $\cdot$ proportion of round $\delta$ | 0.07 |
|  |  | $\cdot$ $\varepsilon$ one-hot smoothing factor | 0.75 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.3 |
|  |  | $\cdot$ EMA parameter $\gamma$ | 0.1 |
|  | Skill-it | $\cdot$ number of rounds $T$ | 20 |
|  |  | $\cdot$ EGD learning rate $\eta$ | 0.2 |
|  |  | $\cdot$ Multiplicative weights window. | 3 |
|  | DoReMi | $\cdot$ EGD learning rate $\eta$ | 0.01 |
|  | DoGE | $\cdot$ EGD learning rate $\eta$ | 0.1 |
|  |  | $\cdot$ proportion of batch for validation set | 0.5 |

**Table 19: Average proportions over the entire training trajectory for the unrestricted setting, on one random seed.**
| Data groups | Method | Average Proportions |
| --- | --- | --- |
| arXiv/SE | Grid search | [0.4, 0.6] |
|  | DML | [0.404, 0.596] |
|  | Skill-it | [0.437, 0.563] |
|  | DoReMi | [0.37, 0.63] |
|  | DoGE | [0.624, 0.376] |
|  | Aioli | [0.507, 0.493] |
| GitHub/C4 | Grid search | [0.3, 0.7] |
|  | DML | [0.46, 0.54] |
|  | Skill-it | [0.583, 0.417] |
|  | DoReMi | [0.858, 0.142] |
|  | DoGE | [0.352, 0.648] |
|  | Aioli | [0.505, 0.495] |
| Books/SE | Grid search | [0.3, 0.7] |
|  | DML | [0.381, 0.619] |
|  | Skill-it | [0.316, 0.684] |
|  | DoReMi | [0.286, 0.714] |
|  | DoGE | [0.325, 0.675] |
|  | Aioli | [0.456, 0.544] |
| arXiv/Books/SE | Grid search | [0.291, 0.306, 0.403] |
|  | DML | [0.245, 0.277, 0.477] |
|  | Skill-it | [0.292, 0.238, 0.469] |
|  | DoReMi | [0.318, 0.180, 0.502]<br>] |
|  | DoGE | [0.592, 0.132, 0.276] |
|  | Aioli | [0.331, 0.336, 0.333] |
| CC/GitHub/Wiki | Grid search | [0.291, 0.306, 0.403] |
|  | DML | [0.157, 0.472, 0.371] |
|  | Skill-it | [0.275, 0.3, 0.425] |
|  | DoReMi | [0.101, 0.714, 0.185]<br>] |
|  | DoGE | [0.536, 0.220, 0.244] |
|  | Aioli | [0.332 0.334 0.333] |
| SlimPajama, full | Grid search | [0.202, 0.022, 0.28, 0.038, 0.018, 0.376, 0.064] |
| (A/B/C4/CC/G/SE/W) | DML | [0.042, 0, 0, 0.579, 0, 0.249, 0.013] |
|  | Skill-it | [0.098, 0.111, 0.204, 0.103, 0.138, 0.266, 0.076] |
|  | DoReMi | [0.08, 0.047, 0.057, 0.11, 0.467, 0.078, 0.157] |
|  | DoGE | [0.056, 0.162, 0.343, 0.28, 0.038, 0.067, 0.051] |
|  | Aioli | [0.138, 0.138, 0.149, 0.162, 0.138, 0.137, 0.138] |

Figure: Figure 6: Aioli’s proportions throughout training for both unrestricted and restricted settings on Arxiv/Stackexchange, Github/C4, and Book/Stackexchange. These trajectories show that Aioli meaningfully alters the mixture proportions over time.
Refer to caption: x8.png

## Appendix E Additional Experiments

### E.1 Downstream Tasks

We find that lower perplexity is positively correlated with worse performance on downstream tasks. We evaluated all models trained on SlimPajama on ARC-Challenge, ARC-Easy [], BoolQ [], HellaSwag [], LAMBADA [], OpenBookQA [], PiQA [], and WinoGrande [] using the Language Model Evaluation Harness [] (Table 20). The correlation between perplexity and the macroaverage of our downstream tasks is $0.529$, indicating that lower perplexity is predictive of worse downstream performance. In fact, DML obtains the best overall performance, even though it omits three out of seven datasets in SlimPajama (see the average proportions in Table 19).

**Table 20: Downstream evaluation metrics for various data mixing methods after training on SlimPajama across three random seeds in the unrestricted setting.**
| Method | Average | ARC-C | ARC-E | BoolQ | HellaSwag | LAMBADA | OpenBookQA | PiQA | WinoGrande |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Stratified | 0.305 | 0.176 | 0.314 | 0.394 | 0.261 | 0.116 | 0.117 | 0.563 | 0.499 |
| Aioli | 0.311 | 0.172 | 0.315 | 0.447 | 0.264 | 0.114 | 0.111 | 0.559 | 0.504 |
| GS | 0.322 | 0.176 | 0.329 | 0.502 | 0.262 | 0.117 | 0.124 | 0.568 | 0.500 |
| DML | 0.333 | 0.181 | 0.330 | 0.608 | 0.261 | 0.109 | 0.128 | 0.554 | 0.490 |
| Skill-it | 0.316 | 0.182 | 0.322 | 0.462 | 0.261 | 0.124 | 0.122 | 0.559 | 0.492 |
| DoReMi | 0.324 | 0.177 | 0.323 | 0.507 | 0.264 | 0.127 | 0.122 | 0.574 | 0.499 |
| DoGE | 0.314 | 0.173 | 0.313 | 0.471 | 0.262 | 0.116 | 0.115 | 0.557 | 0.504 |

One potential reason for this disparity is the distribution shift between pre-training data and downstream evaluation data; for example, the DML results suggest that training on Books, C4, and Github is not needed to do well on the above selection of downstream tasks. Many recent works have also noted that perplexity and downstream performance are uncorrelated [, , ]. Furthermore, Levy et al. [] proposes a question answering dataset where the perplexity of the pretrained model is positively correlated with performance, similar to our results. This mismatch between training objective and downstream evaluations also extends to post-training, where better learning of human preferences does not translate to better win-rate against other post-trained models [].

Resolving the disconnect between training objective and downstream evaluations is an area of active research. In the case of data mixing, Aioli remains the only algorithm in our tests that robustly minimizes average test perplexity–essentially, Aioli achieves what it sets out to achieve in the LMO framework in (1). Conversely, other data mixing algorithms might be implicitly doing something else with respect to minimizing downstream evaluations. Considering how to incorporate downstream evaluations into data mixing is a fruitful area for future work.

### E.2 Ablations

We ablate Aioli by studying performance when two key properties of $A^{t}$ (Appendix C.2.1) are changed: when $T=1$ (i.e., $A^{t}$ is only learned once at the beginning of training and used throughout), and when $A^{t}$ is assumed to be diagonal. We evaluate these two ablations in the unrestricted setting presented in Section 6.1 and Table 2:

- •
Aioli-static: We set $T=1$ in Algorithm 1. That is, we learn $A^{1}$ at the beginning of training. We use this $A^{1}$ to set $p^{1}$, and use this $p^{1}$ for the remainder of the training run. This approach tests if $A^{t}$ needs to be adjusted throughout training.
- •
Aioli-diagonal: We assume that each $A^{t}$ is diagonal in this ablation. In particular, in LearnParams we do $A_{ii}^{t}=\beta_{ii}/p^{t,i}$ rather than $A_{i}^{t}=P^{-1}\beta_{i}$ for each $i\in[m]$ in line 11. This approach tests if it is sufficient to not model cross-group interactions and instead only capture how much group $i$’s performance improves when trained on group $i$ itself.

For both Aioli-static and Aioli-diagonal, we use the same set of hyperparameters as Aioli as described in Appendix D. For Aioli-static, we additionally sweep over EGD learning rates $\{\eta,2\eta,3\eta,4\eta\}$ where $\eta$ is the EGD learning rate used by Aioli.

Our results are in Table 21. We find that Aioli outperforms both ablations in $3$ out of $6$ settings, and obtains the lowest test perplexity on average over these settings. This suggests that both $T>1$ and modeling off-diagonal entries are important to Aioli’s consistent performance across datasets.

**Table 21: Ablations on Aioli. The table reports the difference in average test perplexity compared to stratified sampling. Negative values (green) = improvement, and bolded = best performing method for given data setting. A=Arxiv, B=Books, GH=GitHub, SE=StackExchange, W=Wikipedia. Aioli outperforms ablations in 3 out of 6 settings and attains the lowest test perplexity on average.**
| Method | A/SE | GH/C4 | B/SE | A/B/SE | CC/GH/W | SlimPajama | Average |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Stratified | $16.532$ | $35.991$ | $47.192$ | $35.114$ | $41.583$ | $26.426$ | $33.806$ |
| Aioli | $\mathbf{-0.205}$ | $\mathbf{-0.340}$ | $\mathbf{-0.439}$ | $-0.096$ | $-0.196$ | $-0.240$ | $\mathbf{-0.253}$ |
| Aioli-static | $-0.065$ | $-0.333$ | $-0.226$ | $\mathbf{-0.213}$ | $0.092$ | $\mathbf{-0.330}$ | $-0.179$ |
| Aioli-diagonal | $-0.182$ | $-0.178$ | $-0.354$ | $-0.163$ | $\mathbf{-0.215}$ | $-0.202$ | $-0.216$ |

## Appendix F Why the method is called Aioli

An aioli is an emulsion, where individual components remain chemically separate from each other, despite being combined into one mixture. Similarly, our $A^{t}$ matrix is formed from separate test runs (the $p^{t,1},\dots,p^{t,m}$ in Section 5), despite being combined into one update for $p^{t}$.

## Peer Reviews

confidence: 4
contribution: 4
initial_rating: 8
presentation: 3
questions: 1 How do you guarantee the "LearnParams" will yield accurate estimate given its parameters and potential for error?
2 The paper employs "gains in every data group" as a metric to demonstrate Aioli's effectiveness. However, in practical scenarios, a model need not outperform its counterparts in every data group. How would you address situations where different weights are assigned to various data groups?
soundness: 3
strengths: 1 The unified framework integrates several recent methods about data mixture on large language model. This part is well-written and easy to follow.
2 The problem it tries to tackle is of great importance. Related work propose different methods, and this paper try to unify them as a framework, which could advance future research in this topic.
3 The experiments provided are all necessary to support the claims.
summary: This paper targets the challenge of optimizing data mixture groups in training large language models. The authors claims that no existing method consistently outperforms a simple baseline regarding average test perplexity. They propose a unified optimization framework that encompasses several recent methods, demonstrating that while these methods can represent the true loss-proportion relationship, they often fail to set accurate parameters, leading to sub-optimal performance. Leveraging this framework, the authors introduce a new method, AIOLI, which consistently surpasses baselines in both general and practical settings.
weaknesses: 1 Formulas and letters and extensive details make some contents not easy to follow. For instance, in section 5 (Estimating $A^{t\star}$), additional clarification on the core concepts prior to presenting numerous notations would enhance understanding. 
2 Experimental settings are insufficient. All experiments utilize a 160M model with a maximum of 50K steps. In Section 4.1, when m=7, 10 different proportions are not enough to find the optimal proportion.

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 3
questions: 1.In Figure 2, the author used all the points for fitting. Did the author use the fitted mixing data law to predict a certain proportion setting?
2. May I ask if the author has conducted experiments on larger models or have studied the argument that the conclusions drawn in small models also hold true in larger models?
3. Would the author mind explaining in layman's terms the basic principles of the effectiveness of Algorithm 2 or the basic principles of the improvement brought by this method (line379-line387) (or whether this method is a universal approach);
4. Besides PPL, may I ask if the author has tested the basic performance of the model downstream under different data mixing strategies?
soundness: 2
strengths: This article is well written and establishes a mathematical expression framework that unifies the data mixing methods mentioned in this paper. It reveals that the different data mixing methods mentioned in this paper are formally unified, with differences mainly concentrated in parameter estimation methods. At the same time, a targeted method for parameter estimation in the framework was proposed, which demonstrated effectiveness in practical experiments.
summary: The research content of this paper is about how to optimize the data mixing of pre-training corpus. This paper proposes a framework for mixture proportions--LMO, which can incorporate existing methods (this paper lists one offline and three online methods) into this framework. The basic assumption (loss-proportion relationship) of this framework is verified through experiments, and the shortcomings of parameter estimation in existing methods (mainly three offline methods) are pointed out (disparity between estimated parameters and Optimal). This paper improved the parameter estimation. Experimental results have shown that the improved method proposed in this paper can enhance the performance on its test set across two situations.
weaknesses: I am willing to acknowledge the contribution of the framework proposed in this paper, but the proposal of the framework focuses more on "induction" based on existing methods, which leads to a lack of persuasiveness in the innovation and practicality of the framework. Specifically, 1) the basic assumption of the framework is that the loss-proportion relationship is "linear" (or log linear). Although there has been experimental verification, the experiments are very empirical and the experimental setup is relatively simple, involving up to 7 data domains (real pre-training scenarios often contain domains of over 10000 levels). 2) The validation was only conducted at 160M (section 4.1), which is not convincing at all (many abilities cannot emerge on models of this magnitude), especially considering the extensive research on Scaling laws, small models can be used to predict larger models; 3) This paper only needs to consider the impact between up to 2 data domains, and characterizing the impact between more data is limited. However, this is more of a concern in real pre-training scenarios; 4) The parameter improvement method proposed in this paper is also biased towards empirical methods (line 378-line 389), and lacks persuasiveness in terms of generality and effectiveness on a wider scale。

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 4
questions: AIOLI only performs one update step on each round (Line 5 in Algorithm 1). Why not iterate for a few steps to approach the optimal mixture proportion given by the estimated mixing laws?
soundness: 4
strengths: 1. The paper is well-organized and easy to follow, with extensive experimental details.
2. This paper provides a unified framework for data mixing problems that explain the different of different methods, which is a significant conceptual contribution.
3. The experiment results confirm the method generally works well, shows improvement on 6 out of 6 datasets,
summary: This paper unifies existing methods for data mixing, offline and online, as different parameter estimations of mixing laws. From this perspective, the authors find existing methods to fall short because of inaccurate parameter estimations. With this insight, the author derives a new online data mixing method AIOLI, which updates data proportion according to dynamically fitted data mixing laws along the training process. Experiment results show AIOLI generally works well on 6 out of 6 datasets while other methods underperform some of them.
weaknesses: 1. Although AIOLI improves stratified sampling on all evaluated data, it can underperform baseline methods in some datasets (e.g., A/B/SE in Tab. 2).
2. The authors propose the LearnParams Algorithm to estimate A* without sweeping, but its accuracy is unclear. It is also unclear whether the simulating process affects model performance.
3. AIOLI involves a number of hyperparameters while a description of how to decide these hyperparameters is insufficient. This may hinder the application AIOLI.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. When the validation distribution is unknown or different from the training domains (e.g. train on the other 6 domains but eval on Books/Wiki/Github etc.)?

2. Does the proposed method robust about the hyperparameter k, $\delta$ (in Algorithm2)? To understand their impact, could you provide ablation studies or sensitivity analyses for these specific hyperparameters?

3. The finalized domain weights from AIOLI are very close to uniform (Table16), how much the AIOLI framework could help with LLM pretraining above uniform-sampling baseline in practice? 

4. Could you show the data mixture weights trajectory from AIOLI? Does it learn from the curriculum like in DOREMI [1] and DOGE [2]  or it is always close to uniform?

[1] DoReMi: Optimizing Data Mixtures Speeds Up Language Model Pretraining

[2] DoGE: Domain Reweighting with Generalization Estimation
soundness: 3
strengths: 1. The paper introduce a novel online data mixing algorithm AIOLI leveraging the EGD optimization framework, without introducing extra runs as previous methods.
2. The paper also conclude all existing data mixing methodologies within an unified optimization framework, and conducted a comprehensive evaluation with the target of minimizing the average domain losses.  
3. The proposed method AIOLI demonstrates remarkable robustness comparing to all the other baseline methods, which not requires extra runs with proxy models.
summary: This paper unifies all existing data mixture optimization methods within one Linear Mixing Optimization (LMO) framework, and proposes AIOLI as a new online data mixing method. AIOLI iteratively train models by upweighting each training data domains and leverages the loss difference to learn the optimal data mixing coefficients. 
Empirically, AIOLI is able to consistently outperform or be comparable to the stratified sampling baseline in the unrestricted setting, without extra proxy runs. Additionally, AIOLI can improve on the existing online data mixing methods by a significant margin.
weaknesses: 1. **The proposed algorithm is very similar to the Skill-it method [1]**, which weakens the algorithmetic novelty. 
- The `LearnParams` algorithm (alg. 2) in the AIOLI paper is very similar to the `LearnGraph` algorithm (Alg. 3 [1]) from the Skill-it paper, where the adjacency matrix A has been updated according to the validation loss difference.  Each "training domain" in AIOLI can be considered as each "skill" node in the graph, which corresponds to the *Continual pre-training* setting in [1], Table1.
- The `AIOLI` algorithm (alg.1) is also similar to the `SKILL-IT Online Data Selection Algorithm` (alg. 1, [1]), which applies EGD on the data mixture weights. The author considers this as an unified online optimization framework for data mixture optimization problem.

2. The paper only targets at minimizing the average losses but not consider the other evaluation cases (e.g. out-of-domain genearlization etc). How would AIOLI perform comparing to the other baselines when the validation distribution is unknown (e.g. the OoD setting in DOGE paper [2] and the Skill-it paper [1])? 

3. The finalized domain weights from AIOLI are very close to uniform (Table16), which may explain the consistently comparable-to-baseline results in Fig. 3.  Since the uniform sampling across difference domains would be the first-choice for practitioners for minimizing the average domain loss, how much the AIOLI framework could help with LLM pretraining above uniform-sampling baseline in practice?

[1] Skill-it! A Data-Driven Skills Framework for Understanding and Training Language Models

[2] DoGE: Domain Reweighting with Generalization Estimation

Meta-review: The paper introduces a framework that unifies various existing data mixing methods, providing a theoretical lens to analyze their strengths and weaknesses. The algorithm demonstrates consistent improvement over stratified sampling and robustness across different datasets. Data mixing is a crucial aspect of training large language models, making the findings directly applicable to real-world scenarios. One reviewer pointed out similarities between Aioli and the Skill-It method, particularly in the algorithms for updating the adjacency matrix and applying EGD. The authors clarified the differences in motivation and parameter estimation, but some concerns remained regarding the degree of novelty. The authors provided comprehensive experiments and addressed reviewer concerns effectively in the rebuttal. The paper's strengths, particularly the LMO framework and the consistent performance of Aioli, likely outweigh the weaknesses. The concerns regarding practicality and hyperparameter tuning are important but could potentially be addressed in future work or through further clarification. The paper is marginally above the acceptance threshold based on the provided information.

Decision: Accept (Poster)