Pruning Large Language Models with Semi-Structural Adaptive Sparse Training

Weiyu Huang, Yuezhou Hu, Guohao Jian, Jun Zhu, Jianfei Chen
7/30/2024
cs.CLcs.AI

No official code found. Best implementation: thu-ml/Adaptive-Sparse-Trainer (20 stars, Apache-2.0, last commit 2025-07-01).

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.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Official implementation for "Pruning Large Language Models with Semi-Structural Adaptive Sparse Training" (AAAI 2025)

203Shell, PythonDec 16, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{huang2024pruning,
  title  = {Pruning Large Language Models with Semi-Structural Adaptive Sparse Training},
  author = {Weiyu Huang and Yuezhou Hu and Guohao Jian and Jun Zhu and Jianfei Chen},
  year   = {2024},
  eprint = {2407.20584},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.20584v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.20584.svg)](https://codeofpaper.com/paper/2407.20584)

Discussion