Abstract
As large language models grow in scale, the traditional "pretrain-then-finetune" paradigm becomes increasingly impractical for multi-task deployment due to high storage costs. This paper introduces Diff Pruning, a method that enables parameter-efficient transfer learning by learning a sparse "diff" vector added to a fixed pretrained model. Diff pruning allows models to adapt to new tasks by modifying as little as 0.5% of their parameters while matching the performance of full finetuning. On the SQuAD benchmark, it even outperforms full finetuning, suggesting a beneficial regularization effect from sparsity.
Introduction
The current standard in NLP involves finetuning a massive pretrained model (like BERT-Large) for each specific task. While effective, this requires storing a complete set of model weights—hundreds of millions of parameters—for every task deployed. In storage-constrained environments like mobile devices, this scaling is unsustainable. Existing alternatives like Adapters or feature-based transfer often trade off significant performance for efficiency. Diff pruning aims to bridge this gap, providing the accuracy of full finetuning with a fraction of the storage overhead.
Methodology
The core of the approach is reparameterizing the task-specific model weights ($\theta_{task}$) as the sum of fixed pretrained weights ($\theta_{pretrained}$) and a task-specific diff vector ($\delta_{task}$): $$\theta_{task} = \theta_{pretrained} + \delta_{task}$$ The goal is to keep $\delta_{task}$ extremely sparse. This is achieved through three key steps:
- Differentiable $L_0$ Regularization: To optimize for sparsity, the authors use a relaxed mask approach, learning a continuous probability distribution over parameter inclusion to allow gradient-based optimization of the $L_0$ norm.
- Structured Diff Pruning: Parameters are grouped (e.g., by weight matrix) to encourage the pruning of entire blocks, which often yields better performance than unstructured, independent weight pruning.
- Magnitude Pruning & Finetuning: A final round of magnitude pruning ensures the target sparsity (e.g., 0.5%) is met, followed by a brief finetuning phase to recover performance.
Experimental Results
The researchers evaluated Diff Pruning using BERT-Large on the GLUE benchmark and SQuAD v1.1.
GLUE Benchmark
On the GLUE suite, structured diff pruning achieved an average score of 80.6 while modifying only 0.5% of the parameters. This performance matches the full finetuning baseline and outperforms standard Adapter-based methods which typically require a 3.6% parameter overhead.
The relationship between performance and sparsity is shown in the figure below. Even at extremely high sparsity levels (0.10%), the model maintains competitive performance compared to non-adaptive baselines.
SQuAD Performance
On SQuAD v1.1, diff pruning achieved an F1 score of 93.2 with 1% parameters, notably surpassing the full finetuning baseline of 90.8. This suggests that the sparsity constraint acts as a powerful regularizer, preventing overfitting on task-specific data.
Discussion and Insights
- Task-Specific Hotspots: Analysis of the diff vectors reveals that different tasks utilize different regions of the pretrained model. The embedding layers are rarely modified, whereas middle and upper layers show higher activity.
- Architectural Consistency: Unlike Adapters, diff pruning does not alter the model's internal architecture. This allows for easier integration with existing inference engines.
- Storage Efficiency: Practically, a diff-pruned task for BERT-Large requires only ~13.6 MB of storage, a massive reduction from the ~1.3 GB required for a full model.
Limitations
While inference and storage are efficient, the training process for diff pruning is more intensive, requiring 1.5x to 2x more time and higher GPU memory to track both weights and mask parameters. Additionally, deploying sparse vectors requires specialized handling of indices and values.
Conclusion
Diff pruning offers a compelling solution for multi-task deployment of large language models. By focusing on learning sparse updates rather than full model weights, it achieves state-of-the-art performance with minimal storage overhead, paving the way for more efficient transfer learning in resource-constrained settings.
Summary updated