Dynamic Skill Adaptation for Large Language Models

Jiaao Chen, Diyi Yang · Submission to ICLR 2025 · Rejected

TL;DR

Fine-tuning large language models (LLMs) on randomly shuffled mixtures of synthetic instructions often leads to poor conceptual grounding and early overfitting. Dynamic Skill Adaptation (DSA) introduces a human-inspired teaching framework that decomposes target domains into prerequisite-ordered "skill graphs," synthesizes textbook-style pre-training text and multi-skill exercises, and dynamically modifies the training set based on real-time training loss dynamics. Tested on Pre-Calculus and Social Studies, DSA enables open models like Mistral-7B and LLaMA2-70B to dramatically outperform existing instruction-tuned baselines and surpass ChatGPT.

What Problem Does This Paper Address?

Adapting general-purpose LLMs to specialized, highly technical domains (such as calculus or legal reasoning) is difficult. Standard instruction fine-tuning approaches typically gather human data or generate synthetic examples (via methods like Self-Instruct or Evol-Instruct) and shuffle them together uniformly.

This approach runs counter to how humans master complex domains: students do not jump randomly between multi-variable integration and basic arithmetic. Disregarding conceptual dependencies forces models to learn advanced concepts without mastering prerequisites. Furthermore, fine-tuning on static datasets causes models to quickly overfit easy examples, ignore hard edge cases, and perpetuate synthetic data errors.

Methods

Inspired by educational cognitive strategies (organization, elaboration, rehearsal, and monitoring), DSA structures training into three stages:

[Curriculum & GPT-4] ➔ Skill Graph Construction
                              │
       ┌──────────────────────┴──────────────────────┐
       ▼                                             ▼
Textbook Generation (Elaboration)           Exercise Generation (Rehearsal)
  • Step-by-step concepts                     • Multi-skill reasoning prompts
  • Continual pre-training (Topological)       • Explicit skill annotations
       │                                             │
       └──────────────────────┬──────────────────────┘
                              ▼
                      Dynamic Training
               (Track Loss & Variance across Epochs)
                              │
     ┌──────────────────┬─────┴────────────┬──────────────────┐
     ▼                  ▼                  ▼                  ▼
Data with Errors   Hard-to-Learn      Easy-to-Learn       Ambiguous
  [Filter Out]     [Generate More]   [Compose Harder]    [Keep As-Is]
  1. Skill Graph Construction (Organization): The authors decompose a target subject into a directed acyclic graph where nodes represent atomic skills and directed edges enforce prerequisite dependencies. Sub-skills and hierarchies are extracted from human curricula (e.g., standard educational syllabi) and expanded via recursive GPT-4 prompts.
  2. Synthetic Data Generation (Elaboration & Rehearsal):
  3. Textbooks: GPT-4 writes modular textbook chapters for each node, linking current concepts to prerequisite nodes and providing concrete examples. Models continually pre-train on this text following the topological order of the graph.
  4. Exercises: Multi-skill problems are generated by sampling combinations of nodes from the graph. GPT-4 outputs chain-of-thought solutions explicitly tagged with the required sub-skills, filtered using self-consistency ($k=3$).
  5. Dynamic Training (Comprehension Monitoring): During instruction tuning on exercises, DSA measures each sample's training dynamics (mean loss $\hat{L}_i$ and variance $\hat{\sigma}_i$ across epochs, inspired by Dataset Cartography). Using an error-injected baseline threshold ($L_b, \sigma_b$), samples are partitioned:
  6. Errors (high loss, low variance): Filtered out.
  7. Hard examples (above-average loss, moderate variance): Augmented with similar variations.
  8. Easy examples (low loss, low variance): Synthetically merged via compositional augmentation to create harder, multi-step problems.
  9. Ambiguous examples: Retained without modification.

Datasets

  • Training Corpora:
  • Math/Calculus: 4,907 skills structured across 14 grade levels (Pre-K through Pre-Calculus), totaling ~4.5M synthetic tokens across textbooks and exercises.
  • Social Studies: 990 skills spanning 9 grade levels (Kindergarten through 8th Grade), totaling ~860k synthetic tokens.
  • Evaluation Benchmarks:
  • MATH Pre-Calculus subset (Hendrycks et al., 2021).
  • Social Studies Exam Benchmark: 1,430 multiple-choice questions collected from educational test platforms (HelpTeaching, ProProfs).
  • Generalization Sets: GSM8K, the broader MATH benchmark, and a newly constructed Arithmetic Benchmark featuring 200 synthetic, newly defined mathematical operators to test rule-following while minimizing training data leakage.

Key Insights and Ideas

  • Topological order is essential: Training on textbook concepts from lower to higher levels yields a 16.5% accuracy on Pre-Calculus (LLaMA2-7B), whereas training in reverse order drops performance to 3.2%, and random orderings hover between 3.0% and 4.8%. Foundation concepts directly scaffold downstream learning.
  • Error-filtering via training dynamics works: Samples that models consistently struggle on with near-zero loss variance often reflect invalid ground-truth labels or ill-posed questions. Filtering them dynamically stabilizes training.
  • Automatic difficulty scaling: Merging easy-to-learn examples into composite tasks prevents models from plateauing on repetitive patterns without requiring human curriculum engineering.

Key Results

DSA demonstrates substantial improvements across model families and scales:

  • Pre-Calculus (Accuracy):
  • DSA-Mistral-7b reaches 18.6%, outperforming standard Mistral-7b (4.6%), DeepSeekMATH-Inst-7b (16.8%), and ChatGPT (16.1%).
  • DSA-LLaMA2-70b achieves 22.6%, compared to base LLaMA2-70b (2.6%) and WizardMATH-70b (6.9%).
  • Social Studies (Accuracy):
  • DSA-LLaMA2-70b hits 87.9%, outscoring ChatGPT (83.5%).
  • Out-of-Domain Generalization:
  • Despite training primarily on Calculus skills, DSA-Mistral-7b generalizes to general math, improving GSM8K from 37.8% to 83.8%, full MATH from 9.1% to 43.5%, and novel synthetic arithmetic from 33.5% to 58.0%.
  • Component Ablation (LLaMA2-7B on Pre-Calculus):
  • Base: 0.8% $\rightarrow$ + Textbook: 5.2% $\rightarrow$ + Skill Graph Ordering: 8.2% $\rightarrow$ + Exercises: 12.4% $\rightarrow$ + Dynamic Updates: 16.5%.

Limitations and Future Work

  • Domain Breadth: Experiments are confined to Pre-Calculus and K-8 Social Studies. Higher-level collegiate domains (e.g., advanced university mathematics, legal analysis, medicine) remain untested.
  • Teacher Model Reliance: Data generation and dynamic problem compositions rely on prompting GPT-4, potentially inheriting frontier-model biases and requiring substantial API budgets.
  • Contamination Risks: While the authors used an artificial arithmetic dataset with novel operators and verified no exact-string matches occurred against test sets, comprehensive ngram and embedding-level decontamination audits were left for future work.

Summary updated

BibTeX
@misc{chen2024dynamic,
  author = {Jiaao Chen and Diyi Yang},
  title = {{Dynamic Skill Adaptation for Large Language Models}},
  year = {2024},
  eprint = {2412.19361},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.19361},
}
Figure