Abstract
The remarkable success of Large Language Models (LLMs) relies heavily on their substantial scale, which poses significant challenges during model deployment in terms of latency and memory consumption. Recently, numerous studies have attempted to compress LLMs using one-shot pruning methods. However, these methods often suffer from considerable performance degradation on complex language understanding tasks, raising concerns about the feasibility of pruning in LLMs. To address this issue, we propose Adaptive Sparse Trainer (AST), a novel and efficient retraining framework tailored for semi-structured sparse models. AST enables models to learn optimal masks during the weight update process without incurring additional computational overhead. Furthermore, we demonstrate that incorporating knowledge distillation significantly improves retraining efficiency and enhances model performance under fixed computational constraints. Additionally, a supplementary set of well-initialized parameters is integrated to further augment the model's efficacy. AST achieves state-of-the-art performance with minimal training cost. When applied to the LLaMA2-7B model, AST reduces the perplexity and zero-shot accuracy gap between dense and 2:4 semi-structured sparse models to 0.6 and 1.16%, respectively, utilizing less than 0.4% of the pretraining tokens and GPU hours. Our work demonstrates the feasibility of deploying semi-structured sparse LLMs and offers a promising alternative for achieving highly compressed models when combined with existing quantization techniques.
Introduction
As Large Language Models (LLMs) continue to scale, the associated memory and computational costs present significant barriers to deployment. Pruning, specifically N:M semi-structured sparsity (e.g., 2:4 sparsity), offers a compelling solution by balancing model precision with hardware-accelerated inference. While one-shot pruning methods like SparseGPT and Wanda are efficient, they often lead to substantial performance loss in complex reasoning tasks.
Retraining is a natural remedy but is typically computationally prohibitive for billion-parameter models. Moreover, the authors identify a "Retraining Dilemma": pruned models, inheriting partial knowledge from pretraining, tend to overfit rapidly to small retraining datasets, becoming trapped in local optima rather than properly recovering their lost capabilities.
Methods: The Adaptive Sparse Trainer (AST)
The Adaptive Sparse Trainer (AST) framework is designed to make retraining efficient and effective through three core innovations:
- Adaptive Mask Learning with Annealing SR-STE: Unlike fixed-mask pruning, AST maintains all weights in memory and applies a dynamic mask. Using a scheduled L2 decay (Annealing SR-STE) on masked weights, the model explores connectivity patterns early in training and converges to a final mask. This allows "dead" weights with strong gradients to be revived.
- Knowledge Distillation (KD): To mitigate the Retraining Dilemma, AST employs KL-divergence loss against the original dense "teacher" model. This provides a richer supervisory signal than standard language modeling loss, preventing overfitting to limited data.
- Sparse Low-Rank Boosting (SLoRB): To compensate for the capacity loss in 2:4 sparse models, AST integrates low-rank adapters. These are initialized using discarded weights from the pruning process, preserving first-order information and accelerating convergence.
Key Insights and Results
Empirical evaluation demonstrates that the Retraining Dilemma is a significant hurdle; without regularization, pruned models fail to recover lost capabilities. Knowledge distillation acts as a crucial regularizer, guiding the model toward the performance of the dense baseline.
Performance and Efficiency
AST achieves remarkable data efficiency, recovering LLaMA2-7B performance using only 7 billion tokens—less than 0.4% of its original pretraining budget. The resulting 2:4 sparse model shows only a 0.6 perplexity increase and a 1.16% drop in zero-shot accuracy compared to the dense baseline. On the MMLU benchmark, AST-Boosted LLaMA2-7B reached 38.2%, significantly outperforming one-shot methods like Wanda (27.6%).
Hardware Acceleration
Beyond theoretical compression, AST-trained models deliver practical speedups. Using TensorRT-LLM on RTX4090 and L20 GPUs, 2:4 sparse models achieved end-to-end decoding speedups ranging from 1.33x to 1.83x compared to their dense counterparts.
Conclusion
AST provides a highly efficient pathway for deploying semi-structured sparse LLMs. By combining dynamic mask learning, knowledge distillation, and weight-recycling adapters, it bridges the performance gap between sparse and dense models with minimal computational overhead. Future work includes scaling this framework to larger model families and exploring longer training durations to further close the performance gap.
Summary updated