Introduction
Large Language Models (LLMs) have demonstrated remarkable general-purpose capabilities. However, they often struggle with specialized domains requiring deep reasoning, such as advanced mathematics or social studies. Traditional fine-tuning often relies on static, randomly ordered datasets, which fails to account for the logical dependencies inherent in complex subjects. To address these limitations, we introduce Dynamic Skill Adaptation (DSA), a framework that mimics human pedagogical structures to systematically teach LLMs specialized skills.
The DSA Framework
The DSA framework moves beyond simple instruction tuning by incorporating a structured, three-stage approach to model training.
1. Skill Graph Construction
Learning complex subjects requires a foundation. DSA begins by decomposing a domain (e.g., Calculus) into a hierarchy of sub-skills. By combining human-curated syllabi with recursive GPT-4 prompting, the framework creates a directed skill graph where edges represent dependencies. For instance, "Addition" is a prerequisite for "Multiplication."
2. Two-Phase Data Generation
Once the skill graph is established, high-quality synthetic data is generated in two phases:
- Textbook Phase: LLMs generate descriptive conceptual content for each node in the graph, providing the model with foundational terminology and theory.
- Exercise Phase: The model generates practice problems specifically targeting the skills defined in the textbook phase, facilitating instruction tuning.
3. Dynamic Training
Unlike static training, DSA employs an "active monitoring" phase. By analyzing the average loss and variance of predictions during training, the framework categorizes data into four buckets:
- Errors: Filtered out to maintain data quality.
- Hard-to-learn: Augmented with additional similar examples to reinforce difficult concepts.
- Easy-to-learn: Composed into more complex, multi-step problems to prevent plateauing.
- Ambiguous: Maintained without change.
Experimental Results
The researchers evaluated DSA across two primary domains: Calculus and Social Studies. The training corpus included 4.9 million tokens for Math (spanning Pre-K to Pre-calculus) and 860k tokens for Social Studies.
As shown in the results, DSA-enhanced models significantly outperform their base versions and even surpass much larger models. Notably, DSA-Mistral-7b achieved an accuracy of 18.6% on Pre-Calculus, beating ChatGPT (16.1%) and specialized models like WizardMATH-v1.1-7b. Scaling the base model further improves performance, with DSA-LLAMA2-70b reaching 22.6% in Pre-Calculus and an impressive 87.9% in Social Studies.
Key Insights
- Curriculum Order Matters: Training in a "Lower to Higher" skill sequence is vastly superior to random or reverse ordering. This confirms that LLMs benefit from building on prerequisites, much like human students.
- Synergy of Components: Ablation studies indicate that while textbooks provide the foundation, exercises and dynamic training are crucial for the model to apply knowledge to complex problem-solving.
- Generalization: Adaptation to Calculus led to "spillover" improvements in general math. DSA-LLAMA2-7b improved from 12.3% to 70.8% on the GSM8K benchmark, demonstrating that structured learning enhances overall reasoning capabilities.
Conclusion and Future Work
Dynamic Skill Adaptation provides a robust pathway for specializing LLMs. By structuring knowledge and dynamically adjusting difficulty, DSA enables smaller models to rival or exceed the performance of proprietary giants on specialized tasks. Future work will explore expanding this framework to college-level materials and developing methods to merge multiple specialized experts into a single unified model.
Summary updated