Zinan Tang

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).

Figure 1. CausalMix in three stages. Blue: 512 proxy runs, each a pool with its data state X, an independently drawn mixture T, and a downstream score Y. Orange: orthogonal learning; both Y and Z = log(T + ε) are residualized on X, and a causal forest fits the marginal return θ̂(X), shown here at the root, over all 512 runs. Green: at a new target state the fitted model is reused (orange arrow), with no new proxy runs, to extract the mixture.
SettingBest baselineCausalMixGain
Qwen2.5-0.5B · 800K · AvgDev32.04 DMO33.94+1.90
Qwen2.5-7B · 800K · AvgDev60.35 DMO62.28+1.93
Qwen3-4B · LongCoT · Avg64.74 Grid66.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.

  1. 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.

  2. 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.

  3. 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.

Table 2. The method at a glance.

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.

Covariates
X
Data state of the poolNormalized_Loss, HES, Writing_Style, i.e. difficulty, complexity, quality, aggregated over pool $P_i$.
Treatment
T
Domain mixtureProportions over Coding, IF, Knowledge, Math, Safety; drawn independently of the pool, as in RegMix; used as $Z=\log(T+\varepsilon)$.
Outcome
Y
Downstream scoreDomain-level micro average on the Development benchmarks after SFT, evaluated with OpenCompass.

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:

$$\mu(x,Z)=\mathbb{E}[Y(t)\mid X=x]\;\approx\; g(x)+\theta_0(x)^{\top}Z,\qquad Z=\log(T+\varepsilon)$$

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:

$$\widetilde{Y}=Y-m_0(X),\qquad \widetilde{Z}=Z-e_0(X),\qquad \hat\theta=\arg\min_{\theta}\sum_i\big(\widetilde{Y}_i-\theta(X_i)^{\top}\widetilde{Z}_i\big)^2$$

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.

$$T^{\mathrm{A}}_k=\frac{[\hat\theta_k(X_{\mathrm{tar}})]_+}{\sum_{j=1}^{K}[\hat\theta_j(X_{\mathrm{tar}})]_+},\qquad [a]_+=\max(a,0)$$

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

$$\mathcal{L}(T,\lambda,\mu)=-\sum_{k}\hat\theta_k\log T_k+\lambda\Big(\sum_k T_k-1\Big)-\sum_k\mu_kT_k .$$

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 from OpenDataArena-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

Figure 2. AvgDev per method in each setting, sorted high to low. Orange: CausalMix. Each panel’s axis starts near its lowest score, so compare within a panel. The full breakdown is in Table 1.

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 estimatorR-score ↑First stage (Y / T)R-score ↑Time (s)
CausalForestDML+0.1683LightGBM / LightGBM+0.168312.9
DML_Poly3_Lasso+0.1533RandomForest / LightGBM−0.055610.3
LinearDML+0.1445RidgeCV / LightGBM−0.14086.8
DML_Poly2_Lasso+0.1404ElasticNetCV / LightGBM−0.16815.5
DML_Poly3_Ridge+0.0653GradientBoosting / LightGBM−0.168615.4
DML_Poly2_Ridge+0.0340RandomForest / RandomForest−0.284018.7
CausalForestDML_Shallow+0.0207GradientBoosting / RandomForest−0.324122.5
CausalForestDML_Deep−0.1238LassoCV / LightGBM−0.409811.1
SparseLinearDML−1.7065LightGBM / RandomForest−0.432318.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

Figure 3. Each point is one covariate combination, scored by the Spearman correlation between counterfactual predictions and true scores on 64 held-out runs. The dashed line joins the best set of each size; it peaks at three covariates and falls after that.

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

    Figure 4. A tree interpreter over the fitted causal model. Each node holds the runs that reach it, with the mean marginal return of each domain as a bar above or below zero. Click a node, in the tree or along the path, to read its numbers. Blue edges: the low-quality leaf and the Knowledge-conflict leaf. Green edge: the IF peak.

    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

    Zinan Tang*, Yukun Zhang*, Shaomian Zheng, Zhuoshi Pan, Qizhi Pei, Dingnan Jin, Qing Cui, Jun Zhou†, Yujun Wang†, Biqing Huang†

    *Equal contribution. †Corresponding authors. Work by Zinan Tang done during a research internship at Ant Group. Supported by the Ant Group Research Intern Program and the National Science and Technology Major Project of China (2025ZD1404600). We thank Dr. Gang Wang for helpful suggestions.

    References

    1. Liu, Zheng, Muennighoff, Zeng, Dou, Pang, Jiang, Lin. RegMix: Data Mixture as Regression for Language Model Pre-training. ICLR, 2025. openreview.net.
    2. 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.
    3. 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.
    4. Oprescu, Syrgkanis, Wu. Orthogonal Random Forest for Causal Inference. ICML, 2019. proceedings.mlr.press.
    5. Battocchi et al. EconML: A Python Package for ML-Based Heterogeneous Treatment Effects Estimation. github.com/py-why/EconML.
    6. Lambert et al. Tulu 3: Pushing Frontiers in Open Language Model Post-Training. COLM, 2025. openreview.net.
    7. Cai et al. OpenDataArena: A Fair and Open Arena for Benchmarking Post-Training Dataset Value. Technical report, 2025. opendataarena.github.io.
    8. 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.
    9. Xie et al. DoReMi: Optimizing Data Mixtures Speeds Up Language Model Pretraining. NeurIPS, 2023. proceedings.neurips.cc.
    10. Albalak, Pan, Raffel, Wang. Efficient Online Data Mixing for Language Model Pre-Training. 2023. arXiv:2312.02406.
    11. Li, Liu, Xing. Data Mixing Optimization for Supervised Fine-Tuning of Large Language Models. ICML, 2025. proceedings.mlr.press.
    12. Shum et al. Predictive Data Selection: The Data That Predicts Is the Data That Teaches. ICML, 2025. proceedings.mlr.press.
    13. Wettig, Gupta, Malik, Chen. QuRating: Selecting High-Quality Data for Training Language Models. ICML, 2024. proceedings.mlr.press.
    14. 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}
    }