CausalMix: Data Mixture as Causal Inference for Language Model Training
- Venue
- NeurIPS 2026
- Authors
- Zinan Tang1,2*, Yukun Zhang2*, Shaomian Zheng2, Zhuoshi Pan1, Qizhi Pei3, Dingnan Jin2, Qing Cui2, Jun Zhou2†, Yujun Wang4†, Biqing Huang1†
- Affiliations
- 1Tsinghua University · 2Ant Group · 3Renmin University of China · 4Xiaomi Corporation
Introduction
In LLM supervised fine-tuning, the data mixture, the relative proportion of domains such as instruction following, math, and code, has a large effect on downstream performance. Methods such as RegMix1 fit a global mapping from mixture weights to validation loss on a set of proxy runs. That mapping assumes the data distribution is static: when the underlying data pool shifts, the proxies have to be retrained from scratch, and a lower loss need not mean better downstream scores.
We introduce CausalMix, which casts data mixture optimization as causal inference. The statistics of the current data pool are covariates $X$, the domain mixture is the treatment $T$, and downstream performance is the outcome $Y$. Instead of asking “which mixture scores best?”, we ask a local, causal question: how does a relative change in domain proportions affect downstream performance under the current data state?
We fit a causal forest with Double Machine Learning2 and causal forests3 on 512 runs of Qwen2.5-0.5B, then reuse it, without new proxy runs, to infer mixtures for an 800K data pool, for Qwen2.5-7B, and for an unseen LongCoT pool on Qwen3-4B. CausalMix achieves the best $\mathrm{Avg}_{\mathrm{Dev}}$ at every data scale and model size we test (Table 1), and the best average on LongCoT transfer (Table 3).
| Setting | Best baseline | CausalMix | Gain |
|---|---|---|---|
| Qwen2.5-0.5B · 800K · AvgDev | 32.04 DMO | 33.94 | +1.90 |
| Qwen2.5-7B · 800K · AvgDev | 60.35 DMO | 62.28 | +1.93 |
| Qwen3-4B · LongCoT · Avg | 64.74 Grid | 66.66 | +1.92 |
Highlights. One causal model, fitted once on 0.5B proxies over tulu-3-sft-mixture, guides training at larger scale, on a larger model, and on an unseen data pool.
Method
We formulate data mixture optimization as a state-conditioned causal marginal return estimation problem. The method has three parts.
- Estimand
A run is a treatment. Log-mixtures are the continuous treatment; the pool’s statistics are covariates, fixed before the mixture is drawn. The quantity of interest is $\theta_0(x)$, the marginal return of each domain under data state $x$, a generalized CATE.
- Orthogonal estimation
Residualize both outcome and treatment on the data state with cross-fitted LightGBM, then fit a causal forest on the residuals. The pool’s inherent quality stops confounding the effect of the mixture.
- Policy extraction
Turn marginal returns at the target state into a mixture on the simplex, analytically (ReLU and normalize, the exact KKT optimum) or by searching 100K Dirichlet candidates and averaging the top 100.
Target estimand and identification
Key idea 1The data pool is not noise to average over. It is the state that decides what each domain is worth.
Normalized_Loss, HES, Writing_Style, i.e. difficulty, complexity, quality, aggregated over pool $P_i$.Given $K$ domains, a mixture is $T=(T_1,\dots,T_K)$ on the simplex. The log treatment captures diminishing returns and is the natural geometry for compositional data. We model the conditional response with a partially linear approximation:
Here $g(x)$ is the state-dependent baseline and $\theta_0(x)\in\mathbb{R}^K$ is the state-conditioned marginal data return. If $\theta_{0,k}(x)>0$, raising domain $k$ helps under state $x$; if negative, it transfers negatively. Because proxy mixtures are drawn independently of the pool and of any feedback, ignorability holds by design, $Y(t)\perp T\mid X$, and $\theta_0(x)$ is identifiable from proxy runs.
Orthogonal estimation of marginal returns
Key idea 2Regress residuals on residuals: what the mixture explains beyond what the data state already predicts.
Direct regression mixes the state’s baseline effect with the mixture’s causal effect. Double Machine Learning residualizes both sides with nuisance models $m_0(X)=\mathbb{E}[Y\mid X]$ and $e_0(X)=\mathbb{E}[Z\mid X]$, fitted with cross-fitting so each residual comes from a model that never saw that run:
This R-loss objective does not predict absolute scores. It estimates how residual treatment variation explains residual outcome variation. We use CausalForestDML4 from EconML5 with LightGBM first-stage models, both selected by R-score (see Model selection).
From marginal returns to mixture policies
Key idea 3Domains with positive return get weight in proportion to it. Domains with non-positive return get none.
CausalMix-A maximizes $\sum_k\hat\theta_k\log T_k$ on the simplex. The KKT conditions give an exact closed form: a ReLU on the marginal returns followed by $L_1$ normalization.
CausalMix-S scores 100,000 Dirichlet candidates with the fitted model at the target state and averages the top 100 in raw mixture space, $T^{\mathrm{S}}=\frac{1}{K_{\mathrm{top}}}\sum_{m\in\mathrm{Top}}T^{(m)}$. This is local bagging: it smooths out any single over-estimated candidate.
Proof of the analytical policy
Minimize $-\mathcal{J}(T)$ with Lagrangian
Stationarity gives $\lambda^*-\mu_k^*=\hat\theta_k/T_k^*$, with $\mu_k^*\ge 0$ and $\mu_k^*T_k^*=0$. If $\hat\theta_k\le 0$ and $T_k^*>0$, then $\lambda^*\le 0$, which contradicts $\lambda^*=\hat\theta_j/T_j^*>0$ for any active positive-return domain $j$; hence $T_k^*=0$. On the active set $\mathcal{P}=\{k:\hat\theta_k>0\}$, $\mu_k^*=0$ and $T_k^*=\hat\theta_k/\lambda^*$; the simplex constraint gives $\lambda^*=\sum_{k\in\mathcal{P}}\hat\theta_k$, which yields $T^{\mathrm{A}}$ above.
Experiments
Setup
- Data.
tulu-3-sft-mixture6, split into five domains: Coding, Instruction Following, Knowledge Recall, Math Reasoning, Safety & Non-Compliance. For each of 512 proxy runs we sample a pool, compute its covariates fromOpenDataArena-scored-data-26037, draw a mixture, and sample a 100K training set. - Proxy. Qwen2.5-0.5B trained with LlamaFactory, evaluated with OpenCompass following the Tulu 3 protocol across Knowledge, Reasoning, Math, Coding, IF, and Safety. Benchmarks are split into a Development set (the outcome $Y$) and an Unseen set.
- Baselines. Equal; Grid (best of the 512 proxies); RegMix1, DoReMi9, ODM10, re-implemented on our historical runs; and DMO11, using the mixture ratios reported in its paper.
Main results
Finding 1Fitted once on 0.5B proxies, the causal model keeps winning as data grows 8× and the model grows 14×.
CausalMix achieves the best $\mathrm{Avg}_{\mathrm{Dev}}$ at every scale and remains competitive on the Unseen set. CausalMix-S often beats -A on $\mathrm{Avg}_{\mathrm{Uns}}$; averaging the top-100 candidates smooths idiosyncratic variance. Following RegMix’s rank-invariance hypothesis, we scale to Qwen2.5-7B with 800K samples and see the same trend.
CausalMix against baselines, AvgDev
Table 1. Downstream performance by data mixture method. Orange: best; underlined: second best. AvgDev is the optimization target; AvgUns averages GPQA, AGIEval, OlympiadBench, HumanEval+, IFBench, and ToxiGen, which are never seen during fitting.
Transfer to unseen LongCoT data
Finding 2The causal model learns how data state changes what a domain is worth, so it extrapolates to new pools and new model families.
We reuse the historical runs on tulu-3-sft-mixture, keep the same covariates, and redefine $Y$ as the average Math and Coding Development score. The fitted predictor is then applied to the unseen AM-Thinking-v1-Distilled math & code pool8, and the inferred mixture is used to train Qwen3-4B, a different model family from the Qwen2.5 proxy.
Table 3. Qwen3-4B, 20K samples, AM-Thinking-v1-Distilled Code & Math. No new proxy runs were trained.
Ablation
Removing the state covariates (w/o X) reduces the model to a global mapping $\hat Y=g(T)$, which is vulnerable to distribution shift. Skipping orthogonalization and regressing $\hat Y=f(X,T)$ directly (w/o Orth.) is worse still: it does worse than fitting $T$ alone, which exposes the regularization bias of plain supervised learning.
Table 4. Ablations with 800K samples of tulu-3-sft-mixture. All variants use LightGBM as the underlying regressor.
Analysis
Causal model selection
We compare EconML estimators that support multidimensional continuous treatments by R-score, a Robinson-style orthogonal criterion that measures how well $\hat\theta(X)$ explains residual outcomes given residual treatments. The non-parametric CausalForestDML wins: it captures interactions between covariates and treatments, saturation, and localized heterogeneity. For the first stage, LightGBM for both $Y$ and $T$ ranks first.
| Causal estimator | R-score ↑ | First stage (Y / T) | R-score ↑ | Time (s) |
|---|---|---|---|---|
| CausalForestDML | +0.1683 | LightGBM / LightGBM | +0.1683 | 12.9 |
| DML_Poly3_Lasso | +0.1533 | RandomForest / LightGBM | −0.0556 | 10.3 |
| LinearDML | +0.1445 | RidgeCV / LightGBM | −0.1408 | 6.8 |
| DML_Poly2_Lasso | +0.1404 | ElasticNetCV / LightGBM | −0.1681 | 5.5 |
| DML_Poly3_Ridge | +0.0653 | GradientBoosting / LightGBM | −0.1686 | 15.4 |
| DML_Poly2_Ridge | +0.0340 | RandomForest / RandomForest | −0.2840 | 18.7 |
| CausalForestDML_Shallow | +0.0207 | GradientBoosting / RandomForest | −0.3241 | 22.5 |
| CausalForestDML_Deep | −0.1238 | LassoCV / LightGBM | −0.4098 | 11.1 |
| SparseLinearDML | −1.7065 | LightGBM / RandomForest | −0.4323 | 18.0 |
Table 5. Left: candidate causal estimators. Right: representative first-stage predictor combinations, ranked by R-score.
Impact of covariates
Finding 3Complementary covariates beat many covariates: difficulty, complexity, and quality together, and no more.
We hold out 64 of the 512 runs, fit causal models with different covariate subsets, and measure the Spearman rank correlation between counterfactual predictions and true scores. Three covariates work best: HES14 (entropy at the highest-entropy reasoning tokens; complexity), Normalized_Loss12 (bits per token under Qwen3-8B; difficulty), and Writing_Style13 (QuRater; quality). Adding more hurts, which is the curse of dimensionality with limited proxy runs.
Rank correlation by covariate set
CATE interpreter
Finding 4A domain’s worth depends on the data state. IF always pays; Knowledge conflicts with hard reasoning data; Math, Code, and Safety need quality to help.
A tree interpreter over the fitted model (Figure 4) splits the 512 runs by covariates and reports the mean marginal return of each domain in each subspace. IF is positive everywhere (12.41 at the root, 18.30 at peak). Knowledge turns sharply negative on difficult, complex data ($-6.17$ when Normalized_Loss > 0.70 and HES in (0.019, 0.025]), consistent with a skill conflict between factual recall and logical reasoning. In low-quality, low-complexity regions, Math, Coding, and Safety become noise ($-1.46, -2.28, -5.20$); with good writing style and moderate HES they turn into synergistic gains ($4.88, 3.88, 4.51$).
The CATE tree
Conclusion
CausalMix moves SFT data mixture optimization from static validation-loss minimization to state-conditioned causal marginal-return estimation. Treating proxy runs as treatments and orthogonalizing against the data state separates the marginal utility of each domain from the pool’s inherent quality. The result holds across data budgets and model scales, transfers to unseen LongCoT pools, and yields interpretable insights, such as the quantified conflict between knowledge injection and complex reasoning.
The 512 proxy runs are an upfront cost, but they are paid once: a fitted causal model can be reused across target pools and models without new proxy training. We leave model-dependent marginal returns and in-training adaptation of mixtures to future work.
Authors
References
- Liu, Zheng, Muennighoff, Zeng, Dou, Pang, Jiang, Lin. RegMix: Data Mixture as Regression for Language Model Pre-training. ICLR, 2025. openreview.net.
- Chernozhukov, Chetverikov, Demirer, Duflo, Hansen, Newey, Robins. Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal, 21(1), 2018. doi:10.1111/ectj.12097.
- Wager, Athey. Estimation and inference of heterogeneous treatment effects using random forests. Journal of the American Statistical Association, 113(523), 2018. doi:10.1080/01621459.2017.1319839.
- Oprescu, Syrgkanis, Wu. Orthogonal Random Forest for Causal Inference. ICML, 2019. proceedings.mlr.press.
- Battocchi et al. EconML: A Python Package for ML-Based Heterogeneous Treatment Effects Estimation. github.com/py-why/EconML.
- Lambert et al. Tulu 3: Pushing Frontiers in Open Language Model Post-Training. COLM, 2025. openreview.net.
- Cai et al. OpenDataArena: A Fair and Open Arena for Benchmarking Post-Training Dataset Value. Technical report, 2025. opendataarena.github.io.
- Tian et al. Not All Correct Answers Are Equal: Why Your Distillation Source Matters. 2025. Dataset: huggingface.co/datasets/a-m-team/AM-Thinking-v1-Distilled.
- Xie et al. DoReMi: Optimizing Data Mixtures Speeds Up Language Model Pretraining. NeurIPS, 2023. proceedings.neurips.cc.
- Albalak, Pan, Raffel, Wang. Efficient Online Data Mixing for Language Model Pre-Training. 2023. arXiv:2312.02406.
- Li, Liu, Xing. Data Mixing Optimization for Supervised Fine-Tuning of Large Language Models. ICML, 2025. proceedings.mlr.press.
- Shum et al. Predictive Data Selection: The Data That Predicts Is the Data That Teaches. ICML, 2025. proceedings.mlr.press.
- Wettig, Gupta, Malik, Chen. QuRating: Selecting High-Quality Data for Training Language Models. ICML, 2024. proceedings.mlr.press.
- Li et al. Unified Data Selection for LLM Reasoning. 2026. openreview.net.
Citation
Please cite this work as:
@inproceedings{tang2026causalmix,
title = {CausalMix: Data Mixture as Causal Inference for Language Model Training},
author = {Tang, Zinan and Zhang, Yukun and Zheng, Shaomian and Pan, Zhuoshi and Pei, Qizhi and Jin, Dingnan and Cui, Qing and Zhou, Jun and Wang, Yujun and Huang, Biqing},
booktitle = {The Fortieth Annual Conference on Neural Information Processing Systems},
year = {2026},
url = {https://openreview.net/forum?id=B9ShLVNHQD}
}