Abstract
Pruning Large Language Models (LLMs) effectively reduces deployment costs but often compromises performance. Traditional fine-tuning methods like LoRA fail to preserve sparsity, while existing sparsity-preserving methods are limited by static pruning masks. We introduce Sparsity Evolution Fine-Tuning (SEFT), which allows the sparse structure to evolve during fine-tuning. By dynamically dropping and growing weights based on gradient sensitivity, SEFT adapts the model's connectivity to specific downstream tasks. Our evaluations demonstrate that SEFT consistently outperforms state-of-the-art baselines in accuracy across various LLM architectures while achieving up to 3x faster training and significantly lower memory overhead.
Introduction
Large Language Models (LLMs) are powerful but expensive to deploy. Post-training pruning (e.g., SparseGPT or Wanda) creates efficient "sparse" models by deleting redundant parameters. However, at high sparsity levels (60-70%+), performance drops sharply. Standard fine-tuning methods like LoRA rely on dense matrices; merging them back into a sparse model destroys efficiency gains. Existing sparsity-preserving methods assume the initial pruning mask is perfect, but a mask generated on general data often deletes weights crucial for specialized tasks like math or coding. SEFT addresses this by allowing the sparse topology to adapt during the fine-tuning process.
Sparsity Evolution Fine-Tuning (SEFT)
SEFT draws inspiration from Dynamic Sparse Training (DST) to allow the network's connectivity to evolve through two main phases:
- Sparse Topology Evolution (Drop-and-Grow): Periodically, SEFT drops active weights with the smallest update magnitudes and "grows" new connections by reactivating previously pruned weights with the largest gradient magnitudes. This allows the model to revive parameters that become useful for the new task.
- Sparsity Adaptation: To maintain the target sparsity level (e.g., 60%), SEFT uses a sensitivity-based criterion (weight magnitude multiplied by gradient) to prune parameters that contribute least to minimizing the loss.
Unlike LoRA, which uses low-rank approximations, SEFT directly updates a sparse subset of the original model parameters using learnable indices, avoiding the memory overhead of dense adapters.
Experimental Setup
The authors evaluated SEFT across several architectures (LLaMA, DeepSeek, Mistral) and tasks:
- Performance Recovery: Evaluated on Wikitext-2 (perplexity) using a subset of the C4 corpus.
- Supervised Fine-Tuning: Tested on Commonsense Reasoning (7 tasks including BoolQ and HellaSwag), MMLU (multitask understanding), and GSM8K (math word problems).
Key Insights
- Dynamic Masks are Essential: Pruning masks calibrated on general text are suboptimal for specialized downstream tasks. Allowing the topology to evolve is superior to freezing the initial mask.
- Direct Updates vs. Low-Rank Adapters: Directly updating sparse weights avoids the complexity and memory cost of merging low-rank adapters into sparse structures.
- Sensitivity-Based Pruning: Using gradients (sensitivity) to decide which weights to re-prune yields better results than relying solely on weight magnitude.
Performance and Efficiency
SEFT consistently outperformed baselines like SPP and SQFT. For a 70% sparse LLaMA3-8B model, SEFT surpassed the LoRA baseline on MMLU by 8.69 points. Beyond accuracy, SEFT offers significant hardware advantages. On an H100 GPU, it used roughly half the memory of SQFT and demonstrated superior training speed across various sequence lengths.
Furthermore, SEFT-tuned models achieved a 2.5x inference speedup on CPUs at 70% sparsity, scaling to 3.9x at 90% sparsity. It is also compatible with structured N:M sparsity natively accelerated by modern NVIDIA GPUs.
Limitations and Future Work
A current bottleneck is the need to compute the full dense gradient matrix during the "growth" phase to identify which weights to reactivate. While the updates are sparse, this temporary dense operation limits peak GPU efficiency. Future work involves developing custom CUDA kernels to compute these sparse updates directly, fully unlocking the potential of dynamic sparse training.
Summary updated