---
title: 'Olmix: Principled Data Mixing for LLMs'
url: https://www.emergentmind.com/topics/olmix
type: topic
---

# Olmix: Principled Data Mixing for LLMs

Olmix is a principled framework for data mixing in the training and continual development of large language models (LMs) under evolving domain sets and practical data constraints. It encompasses both a systematic study of the offline data mixing configuration space and a suite of algorithms for efficient mixture recomputation as datasets are added, removed, or revised throughout real-world LM development cycles [2602.12237].

## 1. Formal Definition and Problem Setup

Let the domain set be $D = \{D_1, \dots, D_m\}$, where each domain $D_i$ contains $N_i$ available tokens. A *mixture* is a probability vector

\[
p \in \Delta^{m-1}, \qquad \Delta^{m-1} = \left\{ p \in \mathbb{R}^m_{\ge 0} : \sum_{i=1}^m p_i = 1 \right\},
\]

specifying that $p_i R$ tokens from $D_i$ are used when training for $R$ tokens total. An LM of size $S$ parameters trained for $R$ tokens on mixture $p$ is denoted $\mathrm{LM}(S, R, p)$. For $n$ downstream tasks, the $j$-th task is evaluated via the bits-per-byte (BPB) metric

\[
f_j(\mathrm{LM}(S, R, p)) \in \mathbb{R},
\]

with lower values indicating better performance. The data mixing objective is to find

\[
p^* = \arg\min_{p \in \Delta^{m-1}} J(p), \quad \text{where} \quad J(p) = \frac{1}{n} \sum_{j=1}^n f_j(\mathrm{LM}(S, R, p)).
\]

In data-constrained settings, a repetition bound $k$ is imposed such that

\[
p_i \leq \frac{k N_i}{R} \quad \forall i \in \{1, \dots, m\}.
\]

This constraint prevents excessive resampling from low-resource domains, addressing overfitting and maintaining data diversity.

## 2. Offline Mixing Schema and Configuration Space

Olmix builds on a three-step offline mixing schema: Swarm $\rightarrow$ Regression $\rightarrow$ Optimization. The configuration space is parameterized along seven key design axes, each empirically studied:

1. **Proxy model size ($S_\text{proxy}$):** Proxy LMs with $\geq 15\,\mathrm{M}$ parameters are required to achieve Spearman $\rho > 0.89$ correlation with full-scale (1B) models. $1\,\mathrm{M}$-parameter proxies yield only $\rho \approx 0.73$.
2. **Swarm size $K$ vs. domain count $m$:** Error in the mixing objective collapses when $K = c \cdot (m + 1)$; empirically, $K \approx 3\cdot(m+1)$ suffices.
3. **Swarm distribution $\mathcal{P}$:** *Sparse* swarms (allowing $p^j_i = 0$) benefit topic-level domains by uncovering exclusion, while *dense* swarms suit source-level domains. Dirichlet priors centered on the natural distribution $p_0 \propto N_i$ proved robust; uninformative priors degraded performance.
4. **Regression family $\mathcal{F}$:** Tested surrogates include LightGBM, Gaussian Process, BiMix, AutoScale, and log-linear. The per-task log-linear model

   \[
   \hat{f}_i(p) = c_i + \exp(A_i^\top p)
   \]

   yields the highest Pearson correlation ($\rho \approx 0.80$ at $K=118$) and best downstream BPB.
5. **Regression granularity:** Fitting per-task surrogates (one model per downstream task) achieves the best fit ($\rho \approx 0.98$) and BPB (0.765 vs. 0.777 per-family, 0.774 aggregated).
6. **Data repetition constraints:** Constraints $p_i \leq k N_i / R$ are enforced solely in the optimization step ($k=4$ is typical), rather than during swarm construction. Constraining the swarm degrades performance, while unconstrained swarms plus constrained optimization maintain efficacy.
7. **Optimization solver:** Mixture optimization minimizes

   \[
   \min_{p \in \Delta^{m-1}} \frac{1}{n}\sum_{i=1}^n \hat{f}_i(p) + \lambda\,\mathrm{KL}(p \| p_0)
   \]

   subject to the repetition bounds, using CVXPY with a Kullback-Leibler (KL) penalty ($\lambda = 0.05$). This regularization mitigates overfitting to the regression surrogate.

These choices form the OlmixBase method, which achieves state-of-the-art results on rigorous BPB benchmarks.

## 3. Key Empirical Insights

Empirical studies underpin Olmix's recommendations for data mixing in LM training:

- Proxy LMs with $\geq 15\,\mathrm{M}$ parameters at $5\times$ Chinchilla scaling reliably transfer mixing strategies to 1B-parameter models.
- Swarm sample complexity is linear in the number of domains, with $K \approx 3(m+1)$ sufficient for error minimization.
- Domain granularity (topic or source) informs whether to use sparse or dense swarm priors.
- Per-task log-linear regression achieves average BPB = 0.765; LightGBM and BiMix trail at 0.775 and 0.778, respectively.
- Enforcing repetition bounds in the optimization only allows for higher utility mixes and steadier performance.
- Mixes optimized with a small KL penalty ($\lambda=0.05$) outperform pure convex solvers by reducing over-optimization risk.

## 4. Mixture Reuse Under Evolving Domains

Olmix introduces algorithms for efficient mixture recomputation when domains change. Rather than re-running the entire offline schema ($O(m')$ proxy runs for updated $D'$), *mixture reuse* freezes weights for unaffected domains and optimizes for new/affected domains only. Partition $D' = D_1 \uplus D_2'$, prescribing

\[
q = [\rho \tilde{p}_{D_1}, (1-\rho) q_{D_2'}], \quad \rho \in [0,1],\ q_{D_2'} \in \Delta^{|D_2'|-1}
\]

with a *collapsed* mixture $r = [r_v, r_{D_2'}] \in \Delta^{|D_2'|}$, $r_v = \rho$. Sampling $O(|D_2'|+1)$ runs in this reduced space and expanding to $q$ via $\Phi_{\tilde{p}_{D_1}}(r)$, one fits per-task log-linear surrogates and optimizes $r$ with repetition and KL constraints. *PartialMixtureReuse* recomputes a superset of old domains to further control coupling, with corresponding complexity.

| Reuse Method        | Proxy Runs per Update | Performance (% BPB improvement vs. natural) |
|---------------------|----------------------|---------------------------------------------|
| Full Recompute      | 832                  | +12.2                                       |
| FullMixtureReuse    | 216                  | +11.6                                       |
| PartialMixtureReuse | 272                  | +12.0                                       |
| Swarm Reuse         | 268                  | +11.4                                       |

Mixture reuse provides 95% of the full recompute's gains while requiring 74% fewer proxy runs. At 6T tokens, FullMixtureReuse achieves 99% of the full recompute’s improvement [2602.12237].

## 5. Experimental Evaluation on Realistic Development Pipelines

A five-stage simulation, mirroring OLMo 1→3 development, demonstrates Olmix's utility:

1. Initial: 24 topic domains (DCLM).
2. Add: +15 programming-language domains.
3. Add: +6 STEM corpora (ArXiv, FineMath-3+, PDFs, Wikipedia, AlgebraicStack, Pes2o).
4. Revise: Improved PDF processing replaces previous pipeline.
5. Remove/Partition: Drop AlgebraicStack; split PDFs into 21 finer topics (final $m=64$).

1B-parameter OLMo2 LMs are trained for $R=100$B tokens per stage, evaluated on $n=52$ downstream tasks (math, codegen, QA, commonsense), and measured in BPB. The baseline is sampling in proportion to token count ($p_0 \propto N_i$), and methods compared include OlmixBase, FullMixtureReuse, PartialMixtureReuse, and swarm reuse.

Results reveal that Olmix achieves a $3.05\times$ speedup in convergence: the best mix reaches the OLMo natural BPB in $20$K steps, compared to $61$K for naive mixing. All findings are statistically robust across seeds (min–max intervals $< 1\%$ of mean).

## 6. Practical Recommendations

Derived from empirical and theoretical analysis, Olmix’s primary recommendations are:

- Use $\geq 15$M-parameter proxies at $5\times $ Chinchilla scaling for reliable mixture transfer.
- Set swarm size $K \approx 3(m+1)$ and sample from Dirichlet$(\alpha=p_0)$; select sparse/dense by domain type.
- Fit per-task log-linear surrogates of the form $\hat{f}_i(p)=c_i+\exp(A_i^\top p)$.
- Enforce repetition limits $p_i \leq kN_i/R$ in optimization only ($k\approx 4$).
- Solve for the optimal mixture with CVXPY and a KL regularization term ($\lambda \approx 0.05$).
- When domains shift, employ FullMixtureReuse to reduce proxy runs from $O(m')$ to $O(|\mathrm{new}|+1)$; with high coupling, use PartialMixtureReuse.

These procedures supply both guidance for initial mixture design and tools for efficient, robust updating as the domain landscape changes and expands.

## 7. Significance and Context within Language Model Training

Olmix empirically establishes principled, statistically robust protocols for data mixing under evolving training corpora—a persistent, under-addressed challenge in LM pipeline management. It systematizes surrogate model choice, regression granularity, sample complexity scaling, domain constraint enforcement, and mixture optimization for optimal downstream task performance. The introduction of mixture reuse methods allows practical, compute-efficient adaptation to new datasets without sacrificing performance. These advances directly address gaps in real-world data curation and model improvement, providing a concrete toolkit for practitioners and researchers training large LMs on dynamic, multi-domain corpora [2602.12237].

Source: https://www.emergentmind.com/topics/olmix