Introduction
Can small language models learn to "multitask" within a single sentence? While Large Language Models (LLMs) like GPT-4 show impressive breadth, they often stumble when asked to combine multiple specific skills simultaneously—a challenge known as compositional generalization. For example, a model might know how to use "alliteration" and how to explain "quantum physics," but struggle to explain quantum physics using alliteration.
Previous benchmarks like SKILL-MIX revealed a "compositional gap": while top-tier models handle combining 5 or 6 skills reasonably well, smaller open-source models (like Llama-2-70B) often fail when asked to combine just 3. This paper investigates whether this is a fundamental limitation of model size or if smaller models can be "taught" the art of composition through targeted fine-tuning. By fine-tuning 7B and 13B models on high-quality synthetic examples of combined skills, researchers demonstrate that these models can develop a "meta-skill" for composition. Remarkably, training on simple combinations allows models to generalize to complex ones and even apply this ability to entirely new types of skills.
Methods
The researchers developed a three-stage pipeline to induce and evaluate compositional abilities:
- Data Generation: Using GPT-4, the team generated a high-quality synthetic dataset. GPT-4 was prompted to write short texts (at most $k-1$ sentences) illustrating a random subset of $k$ skills (where $k=1, 2, \text{ or } 3$) within a specific topic.
- Fine-tuning: Smaller models—LLaMA-2-13B-Chat and Mistral-7B-Instruct-v0.2—were fine-tuned on this dataset of roughly 14,000 examples.
- Evaluation: The models were tested on their ability to combine $k=2$ to $5$ skills. Crucially, they evaluated the models on held-out skills (skills not present in the fine-tuning set) and held-out topics to ensure the models weren't just memorizing patterns.
To ensure rigorous grading, GPT-4 and Claude-3 were used as "judges," following the SKILL-MIX rubric which awards points for skill illustration, topic adherence, coherence, and length constraints.
Datasets
The study utilizes the SKILL-MIX framework, which consists of 101 language skills and 100 topics.
- Training Set ($D_{SKILL-MIX}$): 13,957 text pieces generated by GPT-4, covering combinations of $k=1, 2, \text{ and } 3$ skills.
- Skill Split: To test generalization, the 101 skills were partitioned. Training skills focused on literary and rhetorical devices (e.g., oxymorons, ad hominem). Held-out skills included reasoning, logic, theory of mind, and common sense (e.g., modus ponens, empathy).
- Topic Split: 50 topics for training, 50 for testing.
Key Insights
- Acquisition of a "Meta-Skill": The most striking finding is that models don't just learn to combine the specific skills they were trained on. They learn a higher-order ability to structure text to accommodate multiple constraints. This is evidenced by their improved performance on held-out skills like "theory of mind" after only being trained on "rhetorical devices."
- The "Leapfrog" Effect: Training on $k=2$ and $k=3$ combinations significantly boosted performance on $k=4$ and $k=5$. The models learned to handle complexity levels they had never encountered in their training data.
- Quality Over Quantity: The researchers found that "skill-rich" data (examples with $k=3$) is far more efficient for learning composition than larger amounts of "skill-poor" data ($k=1$ or $2$).
- Safety Implications: This compositional boost has a double-edged sword. A fine-tuned model can be prompted to generate sophisticated harmful content (like a highly specific phishing email) by asking it to combine benign-sounding skills, potentially bypassing simple safety filters.
Key Results
The fine-tuning process yielded massive performance jumps across the board.
- Massive Performance Jumps: Before fine-tuning, LLaMA-2-13B had a success rate of only 4% for $k=3$ combinations. After fine-tuning on the small synthetic dataset, this jumped to 37%. Mistral-7B saw a similar rise from 8% to 49%.
- Generalization to Unseen Complexity: For $k=4$ (a complexity level never seen in training), the fine-tuned LLaMA-2-13B improved from 0% to 8% success. While 8% sounds low, it's significant given that GPT-3.5-Turbo scores near 0% on this task.
- Cross-Grader Consistency: The results held up even when using Claude-3 Opus as the grader, dismissing the concern that the improvements were merely the result of the models learning to mimic GPT-4's specific "style" to please a GPT-4 judge.
Limitations and Future Work
While the models improved, they still struggled to surpass the "novelty threshold" for $k=5$. GPT-4 remains the only model capable of consistently generating text combinations so rare they are unlikely to exist in the pre-training corpus. Furthermore, the study focused on language-centric skills; it remains to be seen if this compositional generalization transfers to other domains like code generation or mathematical reasoning.
Finally, using frontier models like GPT-4 for both data generation and grading is expensive, limiting the ability to run massive hyperparameter sweeps. However, the authors suggest that incorporating "skill-rich" synthetic data into the initial pre-training phase of LLMs could fundamentally change their baseline reasoning and composition capabilities.
Summary updated