LinMix: Data Mixing as Linear Domain Attribution

Hubert Baniecki, Przemyslaw Biecek, Martin PawelczykarXiv 2026 · arXiv

Pretraining a large language model (LLM) is like cooking a massive feast: the quality of the final dish depends entirely on the ratio of your ingredients. In the world of AI, these "ingredients" are data domains—code, math, web crawls, and academic papers.

While researchers have developed "regression-based" methods to find the perfect recipe, these methods often struggle as the number of ingredients grows. A new paper from researchers at the University of Warsaw and the University of Vienna, titled "LinMix: Data Mixing as Linear Domain Attribution," proposes a surprisingly simple fix: stop overcomplicating the math and start picking better samples.

TL;DR

LinMix simplifies LLM data mixing by treating it as a linear attribution problem. By sampling data mixtures at the "corners" (vertices) of the possible space rather than randomly in the middle, it enables a simple, interpretable linear model that significantly outperforms complex non-linear baselines, especially when scaling to hundreds of data domains.

What Problem Does This Paper Address?

To find the best data mix, state-of-the-art methods typically train a "swarm" of tiny proxy models on different random mixtures of data. They then fit a regression model to these results to predict how a full-scale model would perform on a specific benchmark (like math or coding).

However, current approaches face two major hurdles:

  1. Poor Experimental Design: Most use "Dirichlet sampling" to create their proxy mixes. This tends to cluster samples around the original data distribution, providing very little signal for the regression model to learn from—especially when dealing with hundreds of domains.
  2. Complexity vs. Interpretability: Because the sampling is poor, researchers often resort to complex, non-linear "black-box" models (like gradient-boosted trees) to find patterns. This makes it impossible to see why a specific domain is considered valuable.
Figure 1: Data mixing for language model pretraining with linear domain attribution. We show that an interpretable linear regression model suffices for data mixing under vertex sampling.

Methods

The authors introduce LinMix, which shifts the focus from the regression model to the experimental design (how we choose the proxy mixes).

  • Vertex Sampling: Instead of sampling randomly near the "average" mix, LinMix samples at the vertices of the feasible region. In practice, this means for any given proxy run, a domain is either at its maximum allowed "cap" or it is completely absent. This decorrelates the effects of different domains.
  • Linear Attribution: Because the sampling is so spread out, the authors find that a simple linear model ($y \approx \beta^\top \pi$) is sufficient. The coefficients ($\beta$) act as "domain attributions," directly measuring the marginal contribution of each domain to the target benchmark.
  • Hyperparameter-Free: Unlike Dirichlet sampling, which requires tedious tuning of "concentration" and "temperature" parameters to avoid failing in high-dimensional spaces, LinMix's vertex sampling works out of the box.

Datasets

The researchers tested LinMix across several scales:

  • Corpus: The 200B-token WebOrganizer corpus (based on CommonCrawl), later extended with Nemotron-CC-Math and Stack-Edu for a total of 416B tokens.
  • Domains: They tested both "coarse" (24 topics) and "fine-grained" (288 topic-format pairs) granularities.
  • Models: Proxy models ranged from 30M to 100M parameters, with target models at 1B (OLMo2) and 4B (Qwen3.5) parameters.
  • Evaluation: Benchmarks included ARC (science), HellaSwag (reasoning), MBPP (code), GSM8K (math), and the Common Pile (general loss).

Key Insights and Ideas

  • The "Aha!" Moment for Linearity: The authors prove that if you sample the right points (the vertices), the relationship between domain weights and performance is remarkably linear. Complex non-linear models are often just compensating for poor data sampling.
  • Dirichlet's High-Dimensional Failure: As the number of domains increases, Dirichlet sampling becomes increasingly likely to produce mixes that violate "caps" (limits on how much you can up-sample a domain). This leads to a "rejection" loop that forces samples to stay very close to the prior, starving the regression model of useful data.
  • Interpretability is a Feature: Because LinMix uses a linear model, you get a clear heatmap of which domains help which tasks. For example, it clearly shows that "Math" and "Software Development" domains are up-weighted for coding tasks, while "Entertainment" is down-weighted.
Figure 4: Domain weights relative to the prior mix across data mixing methods and target benchmarks. LINMIX downweights math and code domains for language modeling (blue in HellaSwag), upweights programming languages and software domains for coding (red in MBPP), as well as math and science domains for math capabilities (red in GSM8K).

Key Results

LinMix demonstrated substantial gains over state-of-the-art baselines like RegMix and OLMix:

  • Specialized Tasks: On the 4B Qwen3.5 model, LinMix achieved a 46.1% relative gain on MBPP (coding) and a 31.6% gain on MATH compared to the best baseline.
  • Scaling to 288 Domains: While Dirichlet-based methods saw their performance collapse as domains increased, LinMix improved benchmark accuracy by 11% on average over the best non-linear baseline.
  • Robustness: As shown in Figure 3, the linear fit for LinMix remains highly accurate (high Spearman $\rho$) even with a small budget of proxy models, whereas Dirichlet-based methods fail to transfer as the domain count grows.
Figure 3: Optimizer performance under the vertex and Dirichlet samplers. Spearman correlation is averaged across 5 random repetitions of 10-fold cross-validation under a fixed proxy model budget. Nonlinear is implemented using LightGBM, as in REGMIX, and exponential fits the exponential law to the target, as in OLMIX. The corresponding R2 values are reported in App. Figure 6.

Limitations and Future Work

  • Proxy Cost: Like all regression-based methods, LinMix requires training a "swarm" of small models. While the authors argue this is only ~4% of the total target model's compute cost, it is still a significant upfront investment.
  • Single-Run Variance: The experiments rely on a single training run per target model. LLM training can be noisy, and future work could explore the variance of these optimized recipes.
  • Non-linear Potential: The authors acknowledge that while a linear model is sufficient, combining vertex sampling with a non-linear model might yield even better results, a direction they leave for future research.

By returning to the fundamentals of experimental design, LinMix provides a more robust, scalable, and—most importantly—understandable way to "cook" the data for the next generation of AI.

Summary updated

Abstract

Language model performance depends strongly on the mixture of domains in the pretraining data corpus. Popular data mixing methods select these domain weights by training many small proxy models on random mixes and then fitting a regression model to predict performance from the mix. We recognize this practice as a domain attribution problem, where the regression measures each domain's contribution to the target metric. Through this lens, the standard Dirichlet sampling of proxy data mixes is a poor regression design that requires tuning and cannot support a linear fit for hundreds of domains. Building on classical optimal experimental design, we introduce LinMix, which samples mixes at the vertices of the capped simplex so that each domain is at its cap or absent. This hyperparameter-free vertex sampling decorrelates domain effects, enabling an interpretable linear model whose coefficients are the domain attributions. The optimal mix given by LinMix provably keeps only domains with positive attribution values and requires no search over candidate mixes. We further establish the optimality of vertex sampling, and prove that Dirichlet sampling inflates the attribution error when its mixes concentrate around the prior data mix. Pretraining experiments with 1B-parameter OLMo2 and 4B Qwen3.5 language models show that LinMix outperforms Dirichlet-based data mixing across reasoning, code, and math benchmarks, with relative gains of 46% on MBPP and 14% on GSM8K. At 288 fine-grained domains, only vertex sampling supports a linear fit, and LinMix improves benchmark accuracy by 11% on average over the best nonlinear baseline.
BibTeX
@misc{baniecki2026linmix,
  author = {Hubert Baniecki and Przemyslaw Biecek and Martin Pawelczyk},
  title = {{LinMix: Data Mixing as Linear Domain Attribution}},
  year = {2026},
  eprint = {2610.37390},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.37390},
}
Figure