Abstract
Large language models (LLMs) deliver impressive results but face challenges from increasing model sizes and computational costs. Structured pruning reduces model size and speeds up inference but often causes uneven degradation across domains, leading to biased performance. To address this, we propose DRPruning, a method that dynamically adjusts the data distribution during training to restore balanced performance across heterogeneous and multi-tasking data. Experiments in monolingual and multilingual settings show that DRPruning surpasses similarly sized models in both pruning and continued pretraining over perplexity, downstream tasks, and instruction tuning. Further analysis demonstrates the robustness of DRPruning towards various domains and distribution shifts. Furthermore, DRPruning can determine optimal reference losses and data ratios automatically, suggesting potential for broader applications.
Introduction
As Large Language Models (LLMs) scale, the computational overhead for inference becomes a significant bottleneck. Structured pruning—the removal of entire components like attention heads or layers—offers a path toward smaller, faster models. However, this process often results in "biased degradation," where performance drops unevenly across different domains or languages. For instance, a pruned model might retain its coding proficiency while losing critical capabilities in specialized fields like biology or low-resource languages.
Existing solutions, such as Sheared Llama, attempt to mitigate this through data scheduling but rely on static "reference losses" that are difficult to tune. If these targets are misaligned, the model fails to recover its original intelligence. DRPruning addresses this by integrating Distributionally Robust Optimization (DRO) to dynamically rebalance training data, ensuring equitable capability recovery across all domains without manual hyperparameter tuning.
Methods
DRPruning replaces static data recipes with an adaptive algorithm that monitors model performance in real-time and adjusts the data mixture accordingly. The pipeline consists of three key technical components:
- Dynamic Loss Function via Scaling Laws: Instead of manual target setting, the system uses scaling laws to predict the ideal final loss for a model of a specific size and training duration. This predicted value serves as a dynamic "north star."
- Dynamic Potential Distribution: The algorithm identifies domains where the current loss deviates most from the predicted reference, assigning higher weights to these underperforming areas.
- Reference Data Ratio Adjustment: To prevent overfitting on a single difficult domain, the system gradually shifts the reference data distribution, maintaining robustness across the entire dataset.
Datasets and Evaluation
The effectiveness of DRPruning was evaluated across both monolingual and multilingual contexts:
- Training: Models were pruned and recovered using SlimPajama for English and CulturaX for multilingual experiments (covering 8 languages).
- Downstream Tasks: A suite of 15 tasks was used, including MMLU (general knowledge), BoolQ (reasoning), and PIQA (physical intuition).
- Automatic Sentence Continuation Benchmark: The authors introduced a new benchmark using GPT-4o to generate "hard negatives" from unlabeled data, specifically testing domain-level understanding in areas like medical and legal text.
Key Insights
- Scaling Laws as a Compass: Using scaling laws as a real-time training signal provides a mathematically grounded target for model recovery.
- Automated Domain Discovery: DRPruning automatically identified that Wikipedia data often underperforms during standard pruning. By boosting the Wikipedia ratio dynamically, the system achieved significantly lower loss compared to static methods.
- Multilingual Robustness: In skewed distributions (e.g., Qwen2), DRPruning's ability to shift focus allowed for superior recovery in low-resource languages compared to baseline methods.
Key Results
DRPruning consistently outperformed the state-of-the-art baseline, Sheared Llama, across multiple dimensions:
- Perplexity: Achieved a 5.59% reduction in perplexity.
- Downstream Accuracy: Improved average accuracy by +1.52% across 15 tasks, with gains rising to +2.95% in multilingual settings.
- Instruction Tuning: Post-fine-tuning, DRPruning models achieved a 55.4% win rate against Sheared Llama in head-to-head GPT-4o evaluations.
- Domain Specifics: On the new sentence continuation benchmark, DRPruning showed a +17.9% improvement in domain-level capabilities.
Limitations and Future Work
While highly effective, the study primarily focused on pruning 7B models to 1.3B and 2.7B sizes. Future research is needed to determine if these gains scale to much larger models (e.g., 70B) or more aggressive pruning ratios. Additionally, while this work focused on pruning, the authors suggest that dynamic DRO-based data scheduling could enhance standard pretraining or cross-domain post-training workflows.
Summary updated