Treating independent layers as the minimal pruning unit allows layer pruning to efficiently eliminate many redundant parameters and achieve high compression rates. Layer pruning has become a promising and prevalent structured pruning technique for large language models (LLMs). However, multi-layer removal can lead to significant performance degradation for LLMs. Although some works have explored various compensation methods for pruned layers, they are inefficient and costly. Observing that the expression of a large proportion of information is concentrated on a small number of pivotal channels, we propose a novel post-pruning compensation method for layer pruning, called pivotal channel compensation (PCC). PCC can achieve significant performance improvement by compensating for a small number of channels through learnable linear transformations at the pruning interface. Besides, we propose a new evaluation metric, called channel-wise average performance improvement (CAPI), which can measure the efficiency of channel-wise compensation. Our experimental results across various LLMs demonstrate that PCC can achieve significant and consistent improvements and high CAPI on language modeling and zero-shot question answering for the state-of-the-art cross-layer and consecutive-layer pruning methods. Compared with existing compensation methods, PCC can achieve competitive results with fewer additional parameters and less training cost.
Figures & tables
Figure 1: The overview of our proposed PCC.
Model
Method
Pruned Layers
LLaMA2-7B
SLEB (PPL)
10,11,14,15,23,24,27
LLM-Streamline (Cos)
23,24,25,26,27,28,29
LLaMA2-13B
SLEB (PPL)
2,12,13,14,27,29,31,33
LLM-Streamline (Cos)
26,27,28,29,30,31,32,33,34,35
LLaMA3-8B
SLEB (PPL)
9,10,11,12,23,25,26
LLM-Streamline (Cos)
23,24,25,26,27,28,29
Table 1: The pruned layer indices based on PPL and cosine distance (Cos).
Model
Pruned Layers
Vmean
Vtop 0.5%
Ratio
LLaMA2-7B
10,11
14.22
82.26
5.78 ×
14,15
30.48
227.73
7.47 ×
23,24
117.85
2229.21
18.91 ×
27
76.86
315.17
4.10 ×
23-29
839.08
31053.06
37.01 ×
LLaMA2-13B
2
0.79
19.45
24.62 ×
Table 2: The inter-layer variance values of all channel values ( Vmean ) and top 0.5% of channel values by variance ( Vtop 0.5 ) in different LLMs.
Figure 2: The variance values of inter-layer channels on LLaMA2-7B. We report the top 100 values and all variance values are log-transformed. Groups A to D represent intermediate layers pruned via SLEB method, while Group E denotes those identified by the LLM-Streamline method. For any given data group, its top 20 variance values (accounting for 0.5% of the total channels) are consistently significantly higher than the others.
Figure 3: The occurrence frequency of different channels as pivotal channels at different pruning interfaces. We randomly select 100 sentences as inputs.
Dimension
1512
2883
149
3444
2639
2617
470
2924
3061
2281
Pearson
0.993
0.994
0.965
0.970
0.964
0.958
0.971
0.965
0.965
0.985
Table 3: The Pearson correlation coefficients of pivotal channels.
Model
Lp / Lt
Ratio
Method
PPL
Imp.(%)
CAPI
LLaMA3-8B
0/32
-
Dense
6.13
-
-
7/32
19.01
SLEB
13.11
-
-
7/32
19.01
PCC
12.42
5.26
0.1384
7/32
19.01
ShortGPT
57.77
-
-
7/32
18.80
LINEARPATCH
25.35
56.12
0.0137
7/32
19.01
PCC
27.74
51.98
4.3317
Table 4: The performance of different pruning methods with or without compensation across different LLMs on the WikiText2 dataset of langauge modeling. Lp and Lt denotes the number of pruned layers and all layers in the model. Ratio denotes the pruning ratio (%). Imp. represents their percentage improvement of PPL compared to pruning methods without compensation.
Model
Lp / Lt
Ratio
Method
PPL
Imp.(%)
LLaMA3-8B
7/32
19.01
ShortGPT
57.77
-
7/32
18.80
+LINEARPATCH
25.35
56.12
7/32
18.80
+LINEARPATCH+PCC
24.48
57.52
7/32
19.01
LLM_S[None]
2305.17
-
7/32
18.80
+LINEARPATCH
72.12
96.87
7/32
18.80
+LINEARPATCH+PCC
52.74
97.71
Table 5: The performance of different pruning methods compensated by LINEARPATCH and PCC across different LLMs on the WikiText2 dataset of langauge modeling. Lp and Lt denotes the number of pruned layers and all layers in the model. Ratio denotes the pruning ratio (%). Imp. represents their percentage improvement of PPL compared to pruning methods without compensation.
Model
Method
ARCc
ARCe
BoolQ
HeSw
PIQA
WG
WSC
MNLI
ANLI
Avg.
RP
LLaMA3-8B
Dense
53.49
77.73
81.28
79.15
80.95
73.16
69.23
47.96
35.40
66.48
100
SliceGPT
30.97
49.24
38.53
49.89
61.26
61.88
63.46
34.76
33.50
47.05
70.77
SLEB
34.47
60.01
44.49
62.04
73.94
55.25
59.61
34.78
32.71
50.81
76.43
PCC
34.90
60.35
44.74
62.04
74.10
54.85
61.54
34.25
33.41
51.13
76.91
ShortGPT
42.49
56.56
65.13
64.59
71.21
70.95
44.23
48.07
38.03
55.70
83.78
LINEARPATCH
43.34
60.61
76.70
67.01
73.28
70.95
66.35
50.34
39.16
60.86
91.55
Table 6: The performance of different pruning methods with or without compensation across different LLMs on the 9 mainstream datasets of zero-shot QA. Avg. denotes the average accuracy (%). RP represents the retained performance relative to the original model.
Model
Method
ARCc
ARCe
BoolQ
HeSw
PIQA
WG
WSC
MNLI
ANLI
Avg.
LLaMA3-8B
ShortGPT
42.49
56.56
65.13
64.59
71.21
70.95
44.23
48.07
38.03
55.70
+LINEARPATCH
43.34
60.61
76.70
67.01
73.28
70.95
66.35
50.34
39.16
60.86
+LINEARPATCH+PCC
43.17
61.57
76.27
67.25
73.01
70.80
66.35
50.42
39.00
60.87
LLM_S[None]
29.10
39.77
38.04
33.20
58.92
55.95
63.46
33.28
33.84
42.84
+LINEARPATCH
34.47
49.62
55.44
48.95
63.38
63.53
63.46
46.20
37.21
51.36
+LINEARPATCH+PCC
35.75
53.87
55.17
52.69
65.07
65.04
63.46
45.63
37.25
52.66
Table 7: The performance of different pruning methods compensated by LINEARPATCH and PCC across different LLMs on the 9 mainstream datasets of zero-shot QA. Avg. denotes the average accuracy (%).
Figure 4: The score distribution of various evaluation metrics for pivotal channels.
Method
Origin
After Compensation
Imp.(%)
Magnitude
18.45
15.23
17.45
Variance
18.45
14.50
21.41
Table 8: The ablation study on various evaluation metrics for pivotal channels.
State
Channel
C0
C×10
Dense
-
9.14
9.14
Pivotal
1512
9.19
18.17
2158
9.38
31.93
2350
9.33
17.05
2298
9.19
25.92
2235
9.27
93.55
Table 9: The PPL of the perturbed LLaMA2-7B model on WikiText2 dataset for language modeling.
Model
Layer
Type
PPL After Compensation
LLaMA2-7B
-
SLEB Pruning
9.14
9
Pivotal
9.0743
Other
9.1401
13
Pivotal
9.0332
Other
9.1398
22
Pivotal
8.9315
Table 10: The discrepancy of compensation for different channels.
Figure 5: The performance across different compensation rates (the proportions of pivotal channels) for different LLMs.
Model
Theoretical Optimum
PCC
LLaMA2-7B
8.86
8.91
LLaMA2-13B
7.71
7.9
LLaMA3-8B
12.1
12.42
Table 11: The theoretical performance bound of linear transformation of PCC.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: The occurrence frequency of the top 0.5% of channels by variance across layers for LLaMA3-8B. We selected 100 sentences as inputs and computed the occurrence frequencies of distinct channels based on their output hidden states.
Figure 7: The occurrence frequency of the top 0.5% of channels by variance across layers for LLaMA2-13B. We selected 100 sentences as inputs and computed the occurrence frequencies of distinct channels based on their output hidden states.
Layer
Channel
Pearson
Layer
Channel
Pearson
Layer
Channel
Pearson
Layer
Channel
Pearson
9,11
1512
0.969
13,15
1512
0.948
22,24
1512
0.961
26,27
1512
0.993
2158
0.981
2789
0.981
2883
0.983
2883
0.994
2350
0.976
3209
0.982
2789
0.995
149
0.965
2298
0.992
1076
0.970
2393
0.995
3444
0.970
2235
0.976
1404
0.982
2622
0.986
2639
0.964
3431
0.984
3431
0.989
2617
0.958
Appendix
Table 12: The Pearson correlation coefficient of pivotal channels in LLaMA2-7B.
Layer
Channel
Pearson
Layer
Channel
Pearson
1,2
2772
0.885
11,14
2772
0.829
1554
0.881
3837
0.977
359
0.935
4923
0.978
4923
0.968
1419
0.965
4554
0.972
2200
0.962
5046
0.969
1160
0.977
Appendix
Table 13: The Pearson correlation coefficient of pivotal channels in LLaMA2-13B.
Layer
Channel
Pearson
Layer
Channel
Pearson
Layer
Channel
Pearson
Layer
Channel
Pearson
26,27
1843
0.993
28,29
2285
0.997
30,31
1843
0.996
32,33
1237
0.951
2772
0.995
1843
0.996
1237
0.968
1843
0.993
110
0.998
1237
0.967
1134
0.962
1134
0.964
31
0.998
1134
0.965
4415
0.995
2198
0.970
2200
0.997
438
0.987
438
0.988
438
0.990
1718
0.978
1718
0.983
1554
0.998
2606
0.977
Appendix
Table 14: The Pearson correlation coefficient of pivotal channels in LLaMA2-13B.
Layer
Channel
Pearson
Layer
Channel
Pearson
Layer
Channel
Pearson
8,12
2932
0.891
22,23
2352
0.979
24,26
2352
0.979
1189
0.922
4055
0.965
2252
0.936
1298
0.838
2209
0.983
1384
0.999
291
0.891
709
0.996
1658
0.996
3266
0.910
1951
0.990
349
0.947
1162
0.868
1736
0.966
229
0.951
Appendix
Table 15: Pearson correlation coefficient of pivotal channels in LLaMA3-8B.
Large Language Models (LLMs) exhibit strong reasoning abilities, but their high computational costs limit their practical deployment. Recent studies reveal significant redundancy in LLMs layers, making layer pruning an active research topic. Layer pruning research primarily focuses on two aspects: measuring layer importance and recovering performance after pruning. Unfortunately, the present works fail to simultaneously maintain pruning performance and efficiency. In this study, we propose GradMAP, a faster layer pruning method with Gradient Metric And Projection compensation, which consists of two stages. In the first stage, we introduce a novel metric based on gradient magnitudes, enabling a global assessment of layer importance. Note that, it requires only a single backward propagation step per pruning decision, substantially enhancing pruning efficiency. In the second stage, we first analyze the layers with the largest mean shift resulting from pruning, and then incorporate a simple yet effective projection compensation matrix to correct this drift in one step. In this way, the degradation of model performance caused by layer pruning is effectively alleviated. Extensive experiments show that GradMAP outperforms previous layer pruning methods in both pruning speed (achieving an average 4× speedup) and performance.
Hao Liu, Guangyan Li, Wensheng Zhang +1
Institute of Automation, Chinese Academy of Sciences, Beijing, China · School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing, China · Guangzhou University, Guangzhou, China
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
Structured pruning reduces the size and inference cost of large language models (LLMs) by removing weight columns, but the resulting output error can degrade accuracy. Existing training-free compensation methods use an additive bias or a single orthogonal rotation on the output side of the retained weight. These corrections leave its input singular frame unchanged and therefore limit how the retained weight can adapt after column removal. We propose COEC (Calibrated Orthogonal-Equivalence Compensation), a training-free compensation framework that applies alternating left and right orthogonal rotations to the retained weight. The right rotation is optimized on a reduced Stiefel manifold, while singular values are rescaled using generalized cross-validation to select the regularization strength for each layer. COEC further tempers the calibration Gram matrix to reduce the dominance of high-energy activation directions and introduces an alignment penalty that preserves the geometric relation between adjacent attention projections.All components use second-order statistics from a small calibration set and require neither backpropagation through the LLM nor retraining of the model parameters. COEC is independent of the column pruning criterion and can be applied to multiple structured pruning methods. Experiments on the Llama-3, Llama-3.1, and Qwen2.5 model families across multiple structured sparsity levels show that COEC improves perplexity on every model and zero-shot accuracy in most settings over existing compensation methods, with larger gains at higher sparsity. These results show that post-pruning compensation can recover part of the performance lost to column removal.
Peiqi Yu, Nam Ling, Wei Wang +1
School of Engineering, Santa Clara University, Santa Clara, CA, USA · Futurewei Technologies, Inc., USA