TL;DR
When fine-tuning language models on hundreds of instruction tasks, choosing which tasks to include—and in what proportions—is usually done by treating each task as an island. TASKMIXPGM flips this around: it builds a "behavioral task graph" by measuring how single-task-adapted models behave on other tasks, then solves a simple energy-minimization problem on that graph to find the optimal data mixture. Across two 7B model families and six benchmarks, this graph-structured approach outperforms standard heuristic and target-aware baselines in 23 out of 24 settings.
What Problem Does This Paper Address?
Supervised fine-tuning (SFT) shapes a pretrained language model's capabilities—from reasoning and math to instruction following. When you have hundreds of candidate instruction datasets and a fixed training budget (say, 25,000 or 50,000 examples), you have to decide how to slice that budget across tasks.
Treating tasks independently misses two crucial dynamics:
- Redundancy: Two datasets might look different on the surface, but if they induce overlapping behavioral updates, spending budget on both wastes compute without adding new capabilities.
- Hidden complementarity: A small task might look unimportant in isolation, yet provide a complementary signal that boosts performance across several downstream evaluations.
Existing methods either rely on simple heuristics (like uniform sampling), fit expensive scaling laws from small mixture runs, or require knowing the target benchmark ahead of time. The authors ask: Can we infer an effective, benchmark-agnostic data mixture directly from the relational structure of the tasks themselves?
Methods
The authors introduce TASKMIXPGM, which turns mixture design into a two-step graph problem:
-
Building the Behavioral Task Graph:
Instead of using prompt embeddings or surface-level text similarity, the authors measure functional similarity. They fine-tune a shared base model (Qwen2-7B) separately on each individual task $\mathcal{T}_i$ to create single-task experts. They then evaluate each expert's next-token predictive behavior on held-out examples from every other task $\mathcal{T}_j$. They test two information-theoretic ways to score these pairwise affinities ($S_{ij}$): -
PMI (Pointwise Mutual Information): A symmetrized cross-task log-likelihood ratio, which captures directional specialization and produces sharp task clusters.
- JSD (Jensen–Shannon Divergence): Converted into a similarity score, capturing smoother, distribution-level agreement.
- Graph-Structured Mixture Inference:
Treating the tasks as nodes in a dense Markov random field, TASKMIXPGM finds the sampling proportions $\mathbf{p}$ (over the probability simplex) by minimizing a quadratic energy function: $$\min_{\mathbf{p} \in \Delta_n} -\beta (S\mathbf{1})^\top \mathbf{p} + \frac{\lambda}{2} \mathbf{p}^\top S \mathbf{p}$$ - The unary term rewards high weighted-degree centrality—tasks that are broadly representative of the whole graph.
- The pairwise term penalizes putting too much weight on mutually similar tasks, preventing redundancy and promoting diversity.
- The ratio $\beta / \lambda$ controls the representativeness–diversity trade-off (tuned on the source side and fixed at $\beta/\lambda = 2$ for all experiments, without peeking at downstream benchmarks).
Because this objective is convex (after spectrum shifting if $S$ is not positive semidefinite), it can be solved efficiently to a global optimum using projected gradient descent—no need to enumerate or train on candidate mixtures.
Datasets
- Training Corpora: Mixtures were drawn from 5 instruction corpora totaling 309 tasks: Flan 2021, T0, CoT, Tulu V3, and GLUE/SuperGLUE.
- Models & Budgets: Fine-tuned Qwen2-7B and Llama2-7B for one epoch at 25K and 50K SFT example budgets.
- Evaluation Benchmarks: Six Open LLM Leaderboard benchmarks spanning reasoning, knowledge, math, and instruction following: BBH, GPQA, IFEval, Math, MMLU-Pro, and MUSR.
- Baselines: Compared against target-agnostic heuristics (Random, Uniform, EPM) and a target-aware selection method (LESS).
Key Insights and Ideas
- Behavioral affinity beats semantic proximity: Two tasks might have similar-looking prompts, yet behave very differently under fine-tuning. Measuring cross-task predictive behavior of single-task experts directly captures functional transfer and redundancy.
- Representativeness vs. Diversity in one equation: The energy objective naturally balances picking "hub" tasks that cover the graph well while actively suppressing redundant pairs.
- PMI vs. JSD have distinct personalities: Qualitatively, PMI creates crisper block structures (sharper clusters), while JSD yields smoother groupings. In practice, this translates to PMI excelling broadly across reasoning and knowledge, while JSD gives notable boosts on instruction following (IFEval) and GPQA.
Key Results
- Dominant overall performance: Across the 24 model–budget–benchmark settings (2 models $\times$ 2 budgets $\times$ 6 benchmarks), TASKMIXPGM–PMI beats the strongest evaluated baseline by point estimate in 23 out of 24 settings.
- Beating target-aware selection: TASKMIXPGM–PMI outperforms the target-aware baseline (LESS) in 24 out of 24 settings, even though TASKMIXPGM is completely benchmark-agnostic.
- Complementary JSD gains: TASKMIXPGM–JSD shines on instruction following—for example, on Qwen2-7B at the 50K budget, JSD reaches 0.4700 on IFEval, compared to 0.3973 for PMI and 0.3741 for Random.
Limitations and Future Work
- Upfront graph construction cost: While the mixture optimization itself is fast and amortized across budgets, building the initial task-affinity graph is non-trivial: it took roughly 16 GPU-hours for PMI and 35 GPU-hours for JSD on 8×H100 GPUs.
- Spectrum shifting: When the affinity matrix $S$ is not positive semidefinite, the authors apply spectrum shifting to guarantee convexity. They note this acts like adding a ridge term to the quadratic component, which can affect properties like mixture entropy, so they treat it strictly as an optimization device.
- Future directions: Not explicitly detailed in the paper beyond establishing behavioral task graphs as a foundation for scalable, interpretable data-mixture design.
Summary updated