Pruning is widely recognized as an effective method for reducing the parameters of large language models (LLMs), potentially leading to more efficient deployment and inference. One classic and prominent path of LLM one-shot pruning is to leverage second-order gradients (i.e., Hessian), represented by the pioneering work SparseGPT. However, the predefined left-to-right pruning order in SparseGPT leads to suboptimal performance when the weights exhibit columnar patterns. This paper studies the effect of pruning order under the SparseGPT framework. The analyses lead us to propose ROSE, a reordered SparseGPT method that prioritizes weights with larger potential pruning errors to be pruned earlier. ROSE first performs pre-pruning to identify candidate weights for removal, and estimates both column and block pruning loss. Subsequently, two-level reordering is performed: columns within each block are reordered in descending order of column loss, while blocks are reordered based on block loss. We introduce the relative range of block loss as a metric to identify columnar layers, enabling adaptive reordering across the entire model. Substantial empirical results on prevalent LLMs (LLaMA2-7B/13B/70B, LLaMA3-8B, Mistral-7B) demonstrate that ROSE surpasses the original SparseGPT and other counterpart pruning methods. Our code is available at https://github.com/mingluo-su/ROSE.
Figures & tables
Figure 1: (a) Change reconstruction error of the "self_attn.o_proj" layer in the first Transformer Block of LLaMA2-7B during SparseGPT pruning as the number of pruned blocks increases. The sharpest increase in reconstruction error appears at a later stage. (b) Weight visualization of the corresponding layer. It exhibits a columnar pattern along the input channel, and there is a block with the most concentrated high-magnitude weights as illustrated. (c) Different reconstruction error after reordering the original block with the highest pruning error. The earlier the original block is pruned, the smaller the reconstruction error.
Figure 2: The distribution of relative change of weights before and after pruning. The majority of weights remain relatively stable.
Figure 3: (a) Overview of difference between SparseGPT and ROSE . Orange color represents weight importance, and the darker the color, the greater the importance. In SparseGPT, the number of weights available for error compensation (shown in dark blue ) decreases during pruning, limiting recovery if high-error weights are pruned late. ROSE reorders those with potentially large pruning errors to the front to be pruned earlier. In this way, more parameters remain available for larger error compensation. (b) Illustration of our ROSE for the columnar layer. Given the dense weight W and target sparsity rate p% , we calculate the importance score S and split it into blocks based on BS . The smallest p% of values from each block are selected as the loss matrix L . Column loss and block loss are calculated based on the loss matrix. Columns within one block are reordered in descending order of column loss, and blocks are reordered in descending order of block loss.
Figure 4: Relative reconstruction error of the "self_attn.o_proj" layer in the second Transformer Block of LLaMA2-7B by ROSE and its variants at varying sparsity rates.
Sparsity
Magnitude
SparseGPT
Wanda
DSnoT
OATS
ROSE (ours)
60%
1.50e-1
6.12e-2
9.39e-2
9.39e-1
1.50e-1
5.09e-2
70%
2.20e-1
8.84e-2
1.40e-1
1.40e-1
2.00e-1
7.22e-2
80%
3.20e-1
1.33e-1
2.20e-1
2.20e-1
3.00e-1
1.07e-1
90%
5.00e-1
2.37e-1
3.60e-1
3.60e-1
4.80e-1
1.81e-1
Table 1: Relative reconstruction error of the "self_attn.o_proj" layer in the second Transformer Block of LLaMA2-7B by different methods.
Method
LLaMA-3 8B (Dense: 6.14)
Mistral-7B (Dense: 5.32)
60%
70%
80%
90%
60%
70%
80%
90%
Magnitude
3.38e5
1.62e6
8.54e6
2.35e6
31.42
8.88e3
1.34e4
1.22e5
SparseGPT
15.23
40.48
203.45
1.10e3
9.37
21.48
78.69
286.54
Wanda
23.34
123.78
986.97
1.02e4
11.11
57.31
236.17
5.16e3
DSnoT
19.66
126.99
995.57
8.38e4
9.67
30.51
1.91e3
7.76e3
OATS
16.34
88.93
770.54
7.95e3
10.54
35.20
261.60
6.44e3
Table 2: WikiText perplexity ( ↓ ) performance on LLaMA3-8B and Mistral-7B model at varying sparsity rates.
Model
Method
Perplexity
Zero-shot Accuracy
BoolQ
WinoG.
PIQA
OBQA
HellaS.
ARC-e
ARC-c
Avg.
LLaMA2-7B
Dense
5.47
77.68
69.14
79.05
44.20
76.01
74.54
46.33
66.71
Magnitude
4.98e4
37.95
49.25
51.52
28.00
26.32
27.90
26.96
35.41
SparseGPT
27.68
63.61
58.41
62.35
29.60
40.38
40.19
23.46
45.43
Wanda
72.58
48.50
49.33
53.86
25.80
30.21
30.64
21.33
37.10
DSnoT
60.44
62.14
55.25
63.00
30.40
39.24
44.15
25.94
45.73
Table 3: WikiText perplexity ( ↓ ) and zero-shot task accuracy ( ↑ ) performance on LLaMA2 models at 70% sparsity rate for different unstructured pruning methods.
Table 8
Figure 5: Ablation study of blocksize, calibration samples, and calibration sequence length in LLaMA2-7B at 70% sparsity rate.
Model
Magnitude
SparseGPT
Wanda
DSnoT
OATS
ROSE (ours)
LLaMA2-7B
-
4.76
1.75
1.95
572
5.15
LLaMA2-13B
-
8.45
1.85
2.35
925
9.34
Table 6: Pruning time (minutes) for pruning a whole model with a calibration set of size 128 at 70% sparsity rate.
Method
Latency (ms)
Speedup
Dense
1791
-
SparseGPT
1458
1.23×
ROSE (ours)
1450
1.24×
Table 7: End-to-end latency obtained by different methods on LLaMA2-70B.
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
Group
Sparsity
Method
BoolQ
WinoG.
PIQA
OBQA
HellaS.
ARC-e
ARC-c
Avg.
LLaMA2-7B
0%
SparseGPT
76.42
68.19
78.51
42.20
74.60
71.97
44.28
65.14
ROSE (ours)
75.84
67.88
78.45
42.40
74.60
72.22
44.62
65.14
25%
SparseGPT
74.92
68.90
77.42
40.60
75.15
69.36
42.66
64.14
ROSE (ours)
73.73
68.51
78.18
40.60
75.38
70.83
46.50
64.81
50%
SparseGPT
73.61
69.06
75.90
40.60
69.31
63.51
39.93
61.70
ROSE (ours)
75.99
68.35
77.48
40.60
69.78
65.45
41.04
62.67
Appendix
Table 8: Performance of zero-shot task accuracy ( ↑ ) on different models under 4-bit quantization at different sparsity rates.
Group
Sparsity
Method
BoolQ
WinoG.
PIQA
OBQA
HellaS.
ARC-e
ARC-c
Avg.
LLaMA2-7B
0%
SparseGPT
77.34
68.82
79.00
44.20
76.00
74.33
46.25
66.56
ROSE (ours)
77.40
68.75
79.05
44.20
76.01
74.54
46.16
66.59
25%
SparseGPT
76.97
69.61
78.84
44.60
76.26
73.06
46.50
66.55
ROSE (ours)
77.03
70.24
79.16
45.00
76.25
72.43
46.33
66.63
50%
SparseGPT
75.78
70.17
77.15
41.80
71.11
67.85
41.47
63.62
ROSE (ours)
75.54
69.30
76.88
42.80
70.85
66.54
41.55
63.35
Appendix
Table 9: Performance of zero-shot task accuracy ( ↑ ) on different models under 8-bit quantization at different sparsity rates.
Sparsity
Method
BoolQ
WinoG.
PIQA
OBQA
HellaS.
ARC-e
ARC-c
Avg.
0%
Dense
81.38
72.61
80.79
45.00
79.16
77.74
53.24
69.99
30%
SparseGPT
82.14
74.03
80.09
44.20
78.54
76.60
50.43
69.43
ROSE (ours)
82.23
74.51
80.58
44.20
78.56
76.43
50.51
69.57
40%
SparseGPT
82.42
73.24
79.43
42.80
76.71
74.87
50.09
68.51
ROSE (ours)
82.14
72.61
79.00
44.60
76.62
74.37
50.34
68.53
50%
SparseGPT
78.41
72.85
77.64
41.60
72.92
68.73
44.11
65.18
Appendix
Table 10: Performance of zero-shot task accuracy ( ↑ ) for different unstructured pruning methods on LLaMA3-8B at different sparsity rates.
Sparsity
Method
BoolQ
WinoG.
PIQA
OBQA
HellaS.
ARC-e
ARC-c
Avg.
0%
Dense
82.14
73.80
82.26
44.20
80.42
78.20
52.30
70.47
30%
SparseGPT
82.45
72.69
81.66
43.00
79.95
77.86
51.79
69.91
ROSE (ours)
82.54
72.45
81.66
43.20
79.95
77.53
51.54
69.84
40%
SparseGPT
82.75
72.45
81.34
42.60
78.49
76.01
48.55
68.88
ROSE (ours)
82.81
72.77
81.61
42.60
78.63
75.88
49.49
69.11
50%
SparseGPT
83.76
72.30
79.54
40.80
75.61
74.37
44.97
67.34
Appendix
Table 11: Performance of zero-shot task accuracy ( ↑ ) for different unstructured pruning methods on Mistral-7B at different sparsity rates.
Figure 6: Visualization of layers with columnar columnar distribution in LLaMA2-7B
Figure 7: Visualization of layers with tile columnar distribution in LLaMA2-13B
Figure 8: Visualization of layers with the columnar distribution in LLaMA3-8B
Figure 9: Visualization of layers with a columnar distribution in Mistral-7B
Figure 10: Visualization of non-columar layers in LLaMA2-7B
Figure 11: Visualization of non-columar layers in LLaMA3-8B
Figure 12: Difference in block loss and column loss between the columnar and non-columnar layer. For the column loss, we selected 32 consecutive columns in one block for visualization.
Figure 13: Relative range of block loss and the relative reconstruction error after reordering to that before reordering across layers in LLaMA3-8B at 70% sparsity.
Large Language Models (LLMs) with billions of parameters are prime targets for network pruning, which removes some model weights without hurting performance. Prior approaches such as magnitude pruning, SparseGPT, and Wanda either concentrated solely on weights or integrated weights with activations for sparsity. However, they overlooked the informative gradients derived from pretrained LLMs. In this paper, we present a novel sparsity-centric pruning method for pretrained LLMs, termed Gradient-based Language Model Pruner (GBLM-Pruner). GBLM-Pruner leverages the first-order term of the Taylor expansion, operating in a training-free manner by harnessing properly normalized gradients from a few calibration samples to determine the pruning metric, and substantially outperforms competitive counterparts like SparseGPT and Wanda in multiple benchmarks. Intriguingly, by incorporating gradients, unstructured pruning with our method tends to reveal some structural patterns, which mirrors the geometric interdependence inherent in the LLMs' parameter structure. Additionally, GBLM-Pruner functions without any subsequent retraining or weight updates to maintain its simplicity as other counterparts. Extensive evaluations on LLaMA-series, Qwen-Series and Deepseek models across zero-shot, STEM-Reasoning and Coding benchmarks show that GBLM-Pruner surpasses magnitude pruning and Wanda by significant margins and performs competitively against SparseGPT which involves intensive weight updates. We further extend our approach on Vision Transformer and Vision Language Models. Our code and models are available at https://github.com/VILA-Lab/GBLM-Pruner.
Rocktim Jyoti Das, Mukul Ranjan, Mingjie Sun +2
Mohamed bin Zayed University of AI · Carnegie Mellon University
Large Language Models (LLMs) have experienced significant growth and development in recent years. However, performing inference on LLMs remains costly, especially for long-context inference or in resource-constrained devices. This motivates the development of new post-training pruning (PTP) methods. These methods reduce LLMs' requirements by removing a substantial part of the model's parameters. The discarded weights are selected depending on their impact on the models performance. Current PTP methods prune the models by removing the less informative hidden nodes from the FFN layers, and the least important attention layers. We propose Putri, a PTP method that introduces three changes to the State-of-the-art. First, we update the un-pruned weights of the FFN to compensate for the introduced pruning error. Second, the FFN layers are pruned sequentially, taking into account the updates done to the previous layers. Third, instead of removing full attention layers, we remove individual attention-heads. We extend this method such that it can also address Grouped-Query Attention. In summary, Putri is a structure pruning method which remains simple while showing SOTA performance. Pruning experiments on multiple models with a wide variety of sparsity ranges and on different datasets, validate the generality of Putri. Notably, we demonstrate that, unlike previous methods, Putri can prune LLMs on extreme sparsity ratios. The code is available at: https://github.com/Coello-dev/Putri.
Diego Coello de Portugal Mecke, Tom Hanika, Lars Schmidt-Thieme
ISMLL & DARC VWFS · University of Hildesheim · Hildesheim, Germany +1
We introduce IrekoGPT, a post-hoc method for converting pretrained LLMs into slimmable models whose width can be adjusted at inference time. Building on SliceGPT, we retain its projection matrices without pruning them, allowing a single model to expose nested subnetworks at different widths. We improve robustness by calibrating each layer across multiple compression ratios, and correct downstream linear layers through gradient-free ridge regression. Across Llama and Qwen models, preliminary results show improvements over naive PCA-based slimming, with the largest gains at high compression. Code is available at https://github.com/aimagelab/IrekoGPT
Pietro Moriello, Pietro Buzzega, Angelo Porrello +1
AImageLab, University of Modena and Reggio Emilia, Italy