TL;DR
TaskMixPGM is a new framework that uses Probabilistic Graphical Modeling to automatically find the best mixture of datasets for supervised fine-tuning (SFT). By treating tasks as nodes in a Markov Random Field and measuring their "behavioral similarity," it creates a balanced training recipe that maximizes model utility while minimizing redundancy, consistently outperforming standard heuristics and state-of-the-art selection methods.
What Problem Does This Paper Address?
Supervised fine-tuning (SFT) is the stage where a base language model is trained on instruction-following datasets to hone its reasoning and problem-solving skills. However, practitioners often have hundreds of potential datasets but a limited computational budget.
The standard approach is to use simple heuristics: either sample tasks uniformly or proportional to their size. These methods are sub-optimal because they ignore task interactions. Some tasks are redundant (wasting budget), while others are complementary (boosting performance). Existing automated selection methods often require expensive repeated training runs or rely on "semantic similarity" (like cosine similarity of embeddings), which often fails to capture how a model actually behaves when trained on that data.
Methods
The authors introduce TaskMixPGM (Task Mixtures via Probabilistic Graphical Modelling). The core idea is to model the entire task pool as a dense Markov Random Field (MRF).
- Nodes and Edges: Each task is a node. Edges represent the affinity between tasks.
- Behavioral Affinity (PMI): Instead of looking at text embeddings, they measure affinity by comparing the predictive distributions of models fine-tuned on single tasks. They use a symmetric Pointwise Mutual Information (PMI) score to determine how much one task "informs" another.
- Energy-Based Objective: They define an energy function where:
- Unary Potentials reward "representative" tasks (those with high total affinity to the pool).
- Pairwise Potentials penalize redundant tasks (those that are too similar to each other).
- Spectrum Shifting: The raw affinity matrix is often non-convex, which makes optimization unstable. The authors apply a "spectrum shift" ($\tau$)—essentially adding a value to the diagonal of the matrix—to restore convexity. They identify a "critical shift" ($\tau_c$) that ensures a unique, broad mixture rather than collapsing to a single task.
Datasets
The study utilizes a massive pool of 309 instruction-tuning tasks compiled from:
- Flan 2021: ~17.5M examples across various NLP tasks.
- T0: Multitask prompted training data.
- Chain-of-Thought (CoT): Reasoning-focused datasets.
- Tulu V3: A diverse collection of high-quality instructions.
- GLUE/SuperGLUE: Standard language understanding benchmarks.
For evaluation, they use the Open LLM Leaderboard benchmarks, including BBH (reasoning), GPQA (science), IFEval (instruction following), MATH, MMLU-Pro, and MuSR.
Key Insights and Ideas
- Behavioral > Semantic: The authors show that semantic similarity (cosine similarity of task vectors) carries very little information about actual task structure. Behavioral similarity (PMI) reveals much clearer clusters and redundancies.
- The "Attractor" Phenomenon: The optimization uncovers "attractor" tasks—broadly transferable datasets (like certain QA prompts from T0) that act as anchors for the mixture.
- Convexity is Key: Without the spectrum shift, the optimization problem is non-convex and tends to collapse, selecting only a single task. The shift $\tau$ acts as a "knob" to control the breadth and diversity of the mixture.
- Transferability: A mixture computed once using a specific model (e.g., Qwen-2-7B) transfers remarkably well to other model families (Llama-2) and different training budgets.
Key Results
- Dominant Performance: Across 36 different model-budget-benchmark settings, TaskMixPGM achieved the highest score in 32 of them.
- Reasoning Gains: The margins were largest in reasoning tasks. For Llama-2-7B, BBH scores jumped from ~35.9 to ~40.9 at a 25K sample budget compared to the best heuristic.
- Data Efficiency: A TaskMixPGM mixture with a 25K budget often matched or beat the best heuristic using a 50K budget.
- Compute Efficiency: While it requires training single-task LoRA adapters once, this cost is amortized. Computing the affinity matrix took ~16 GPU-hours, whereas competing methods like LESS required ~320 GPU-hours for the same setup.
Limitations and Future Work
- One-Time Cost: The method requires an initial investment to train single-task checkpoints for the entire pool to estimate affinities.
- Pool Dependency: The framework optimizes the given pool; it cannot generate new data or add capabilities (like safety or multilinguality) if they aren't already present in the source tasks.
- Specialized Task Bias: By favoring representative tasks, the method might naturally down-weight highly specialized or small datasets (like safety-specific data) unless they are explicitly protected or weighted.
- Future Directions: The authors suggest extending the framework to larger model sizes, longer contexts, and more diverse task types like safety and multilinguality.
Summary updated