LLM-Pruner: On the Structural Pruning of Large Language Models

Large language models (LLMs) have shown remarkable capabilities in language understanding and generation. However, such impressive capability typically comes with a substantial model size, which presents significant challenges in both the deployment, inference, and training stages. With LLM being a general-purpose task solver, we explore its compression in a task-agnostic manner, which aims to preserve the multi-task solving and language generation ability of the original LLM. One challenge to achieving this is the enormous size of the training corpus of LLM, which makes both data transfer and model post-training over-burdensome. Thus, we tackle the compression of LLMs within the bound of two constraints: being task-agnostic and minimizing the reliance on the original training dataset. Our method, named LLM-Pruner, adopts structural pruning that selectively removes non-critical coupled structures based on gradient information, maximally preserving the majority of the LLM's functionality. To this end, the performance of pruned models can be efficiently recovered through tuning techniques, LoRA, in merely 3 hours, requiring only 50K data. We validate the LLM-Pruner on three LLMs, including LLaMA, Vicuna, and ChatGLM, and demonstrate that the compressed models still exhibit satisfactory capabilities in zero-shot classification and generation. The code is available at: https://github.com/horseee/LLM-Pruner

Paper

Similar papers

Peer review

Reviewer AFsw7/10 · confidence 3/52023-07-04

Summary

This paper tackles the problem of reducing the parameter number of large language models with pruning. It identifies structures within an LLM and uses them to compose a dependency graph-based. The authors provide experiments where they prune the parameters of LLMS and evaluate them on zero-shoot tasks. Namely, they consider LLaMA (7B), VICUNA (7B), and ChatGLM (6B). The results show that pruning can reduce 20% of the parameters and retain 90-94% of the original performance.

Strengths

- This paper addresses a crucial aspect of a more efficient language model - especially when models get enormous. - It employs efficient methods and evaluates the pruned models on a broad set of tasks. - The results show that more performance can be preserved than parameters removed during pruning.

Weaknesses

- As the authors show, pruning effectively reduces the parameter of LLMs. But how does the pruned model compare to the next smaller model variation? Showing that with the proposed method, we can get a better-pruned model (7B to 3B) compared to the next smaller model (3N) could make a strong point for this paper. - This paper considers only the same-sized LLMs, but from recent work, we know that emergent capabilities (when we can call them that) emerges with even bigger models. However, with this proposed approach, we are still determining how it scales to bigger models. Do you have more results on bigger models (13B, 20B, 40B) or insights on how efficient your approach is with a growing number of parameters? - While referring to efficiency gains in terms of GPU hours, the paper does not provide any further information about which GPU is used. Are the 14 GPU days of TinyBERT and the 3 GPU hours of the proposed approach comparable in terms of GPT hardware?

Questions

- How do you compare your approach with a distilling method (like Distilbert), where general competencies (MLM) are actually distilled from bigger models?

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Reviewer mPK34/10 · confidence 4/52023-07-05

Summary

The paper is trying to present an resource efficient task agnostic technique for pruning large language models. The authors tackle two main problems, 1) in a setup where there is no access to the original dataset that was used to train the LLM, and 2) the pruning should be fast. The paper presents a three step approach to pruning: 1) Discovery -- finding the groups (structures) that will be evaluated for pruning. 2) Estimation -- estimating the impact of removing a particular group on the performance of the model. 3) Recovery -- post pruning training of the model to recover on the lost performance.

Strengths

The paper presents a novel approach to pruning, which is fast, efficient, and agnostic of the downstream task and operates without the availability of the pretraining dataset. The paper is well written and clearly explains their approach, and performs a good number of ablation studies to provide a good understanding of the impact of inclusion/exclusion of each component of their approach. The paper evaluates the work on a wide variety of tasks in zero shot setting.

Weaknesses

The paper starts with the problem that deployment & inference are the key challenges faced by large language models, and presents a solution to it. However, no assessment of latency is provided in the paper. If we prune some parameters, the resulting model is sparse. Sparse models often to less theoretical computations, but at times do not benefit much on latency because the inefficiency introduced by sparse computations. There is no baseline that is taken into consideration. It it possible to get two models of similar architecture, and prune the larger model to the smaller one, and then train both the pruned model, and the small model, on the Alpaca dataset used in the paper to understand the gain that this approach gives when compared to a model that has been directly trained? A latency analysis between these two models will be pretty useful to make a conclusive statement as well in order for it to be useful in production setups.

Questions

Please see the weakness section. I would be curious to look into latency analysis and comparison with a model directly trained on the same corpus.

Rating

4: Borderline reject: Technically solid paper where reasons to reject, e.g., limited evaluation, outweigh reasons to accept, e.g., good evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

There isn't any discussion around deploying such a sparse model compared to a dense model, especially whether the theoretical guarantees in terms of speedups translate to the same when deploying.

Reviewer VdKx7/10 · confidence 3/52023-07-07

Summary

The authors propose LLM-Pruner to compress large language models in a task-agnostic manner. Their method can achieve a fast recovery by tuning LoRA after pruning the model. Their experiment results show LLM-Pruner can achieve comparable performance with much smaller memory.

Strengths

1. Their motivation is interesting and the proposed method can be generalized to variable tasks. Their method design also makes sense. 2. Their experiments are extensive, and their analyses also demonstrate the effectiveness of LLM-Pruner.

Weaknesses

1. What's the performance if no post-tuning is applied? 2. What is the performance of other compressing methods like quantization and task-specific pruning?

Questions

None

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

4 excellent

Contribution

3 good

Limitations

None

Reviewer 3DoF4/10 · confidence 4/52023-07-07

Summary

This paper present a method for LLM pruning, where some parameters are discarded by sacrificing the downstream accuracy. The proposed method, LLM-Pruner, adopts structural pruning that selectively removes non-critical coupled structures based on gradient information. By investigating different pruning settings with different LLMs, this paper finds the proposed method can help reduce the computations while retaining the zero-shot capabilities.

Strengths

- The proposed method is task-agnostic, not relying on domain/downstream data. - Experimented with three different LLMs, with consistent observations.

Weaknesses

- Missing the comparison between a pruned larger model and a smaller unpruned model. For example, when pruning 50% parameters for 7B model, how the results compared with a 3B model? - Examining the proposed method with different models is good. However, instead of experimenting with 3 LLMs in similar sizes (7B, 7B, and 6B parameters), pruning a larger one would be more important. For example, a 13B llama/Vicuna model. - Experiments only cover the proposed method, weakly connected to other model compression works.

Questions

Is the proposed method a general model compression method or designed for LLM? After reading this submission, my feeling is this is general method while the method's name is LLM-pruner.

Rating

4: Borderline reject: Technically solid paper where reasons to reject, e.g., limited evaluation, outweigh reasons to accept, e.g., good evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

2 fair

Presentation

3 good

Contribution

3 good

Limitations

n/a

Reviewer ahc66/10 · confidence 4/52023-07-10

Summary

This work proposes an LLM compression framework, LLM-Pruner, that employs structural pruning to compress LLMs in a task agnostic manner so that their multi-task solving is preserved. They achieve this without using the original training data. In addition, they employ adaptors (LoRA) during the tuning phase for parameter and training efficiency. They evaluate the models on zero-shot classification and text generation and demonstrate reasonable performance compared to the original model.

Strengths

1. Although task agnostic knowledge distillation exists (TinyBert, DistilBERT etc.) and can be done without the original training data, it requires a significant training effort. This work can achieve upto 5 times compression with minimal training. 2. The estimation of group importance estimation is important for gaining an inference speed advantage for pruning. However, the authors did not present an analysis on the impact of their method on inference speed.

Weaknesses

1. Although the authors presents the reduction in parameters, they do not mention the inference speedup with and without LLM-pruner. What would be specially interesting would be the inference speed under different types of group pruning (e.g. channel vs block)

Questions

1. LoRA and other adaptors are not necessarily faster to train. They reduce the number of trainable parameters but the backprop generally runs through the entire network. Can you compare the training time with and without LoRA (i.e. full network training). 2. The Ablation Section at the beginning of line 227 explains a table but does not refer to one. I assumed it was Table 3 but if so some of the explanations were not clear. 3. Weights and parameters are some times used interchangeably in deep learning. What is meant by weights in Section 3.2.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

Yes.

Reviewer AFsw2023-08-16

Thanks a lot for the feedback and the additional results. I adjusted my scores accordingly.

Authorsrebuttal2023-08-16

Dear Reviewer AFsw, We sincerely appreciate your time to review our submission and response. We will follow the reviewer's advice and incorporate the above results into the updated version. Best regards, Authors of Submission 2474

Authorsrebuttal2023-08-18

**Additional Explanation: LLM-Pruner produces dense (not sparse) and lightweight models** We sincerely thank the reviewer mPK3 again for the comments. We would like to present in a more intuitive manner that LLM-Pruner produces dense and lightweight models with reduced dimensions, rather than being sparse. Below, we provide an example of the architecture change of LLaMA before and after pruning: After Pruning: (only show one layer for simplicity) ``` LlamaDecoderLayer( (self_attn): LlamaAttention( (q_proj): Linear(in_features=4096, out_features=3072, bias=False) (k_proj): Linear(in_features=4096, out_features=3072, bias=False) (v_proj): Linear(in_features=4096, out_features=3072, bias=False) (o_proj): Linear(in_features=3072, out_features=4096, bias=False) ) (mlp): LlamaMLP( (gate_proj): Linear(in_features=4096, out_features=8256, bias=False) (down_proj): Linear(in_features=8256, out_features=4096, bias=False) (up_proj): Linear(in_features=4096, out_features=8256, bias=False) ) ... ) ``` Before Pruning: ``` LlamaDecoderLayer( (self_attn): LlamaAttention( (q_proj): Linear(in_features=4096, out_features=4096, bias=False) (k_proj): Linear(in_features=4096, out_features=4096, bias=False) (v_proj): Linear(in_features=4096, out_features=4096, bias=False) (o_proj): Linear(in_features=4096, out_features=4096, bias=False) ) (mlp): LlamaMLP( (gate_proj): Linear(in_features=4096, out_features=11008, bias=False) (down_proj): Linear(in_features=11008, out_features=4096, bias=False) (up_proj): Linear(in_features=4096, out_features=11008, bias=False) ) ... ) ``` We would like to hear your further opinion about this, which is essential to us to improve the work. Thank you! Best, Authors of Submission 2474

Authorsrebuttal2023-08-21

Dear Reviewer mPK3: As the end of the discussion period approaches, we sincerely look forward to your feedback on our rebuttal. Your insightful comments on our work are really essential and we genuinely aspire to your feedback. In response to your concerns about our work, we present the quantitative experiments as follows: 1. No assessment of latency & No theoretical guarantee of sparse models in terms of speedups -> We provide the latency analysis of the pruned model, and we also show that the pruned model retains its dense structure rather than transforming into a sparse model with sparse computation. 2. Comparing a smaller model and a larger model with pruning to reduce its size: We conduct a comparison between a LLaMA-3B pruned using LLM-Pruner and an open-source 3B model, StableLM-3B. We truly appreciate your time and feedback on our rebuttal. Best Regards, Authors of submission 2474

Authorsrebuttal2023-08-20

Looking forward to further discussion

Dear Reviewers, We sincerely appreciate your valuable and insightful comments. Noticing that there are only around 35 hours left until the end of the discussion period, we kindly ask for a few minutes of your time to check our response. We look forward to the opportunity to discuss this with you. Hearing your further opinion about this would be essential to us to improve our work. Here we briefly summarise our response with respect to the concerns you mentioned in the weaknesses or questions: * **To Reviewer ahc6**: We include a latency analysis of different pruning strategies and a comparison between LoRA and full-parameter tuning. * **To Reviewer 3DoF**: Our response provides (1) an evaluation of models pruned by LLM-Pruner versus the StableLM-3B, (2) the results of LLM-Pruner on LLaMA-13B, and (3) the addition of another baseline in KD (DistilBERT), as per the weaknesses you listed. * **To Reviewer VdKx**: We conduct experiments about task-specific pruning and quantization, and provide an analysis of these results. * **To Reviewer mPK3**: We show that the pruned model is not a sparse model and include a latency comparison between the pruned model and the original model. Besides, we compare our pruned model with StableLM-3B. We deeply appreciate your thoughtful comments and the time you have dedicated to reviewing our paper. Best regards, Authors of submission 2474

Authorsrebuttal2023-08-20

Dear Reviewer VdKx, Thanks for your valuable feedback. We will include these two experiments (about Quantization and Task-specific pruning) in the updated version. Best Regards, Authors of Submission 2474

Authorsrebuttal2023-08-20

Dear Reviewer ahc6, Thanks again for your valuable comments. We will follow the advice and add the above results, especially the latency analysis, into the updated version. Best Regards, Authors of Submission 2474

Authorsrebuttal2023-08-21

Dear Reviewer 3DoF: We truly want to hear from you as the end of the discussion is approaching. Your constructive comments on our work are crucial, and we genuinely hope to get feedback from you before the discussion period ends. Regarding the weaknesses you mentioned, we include the corresponding experiments as follows: 1. Missing the comparison between a pruned larger model and a smaller unpruned model -> We add an experiment comparing StableLM-3B with the pruned model produced by our method. 2. Pruning a larger one would be more important -> We provide the pruning results on LLaMA-13B. 3. Weakly connected to other model compression works -> We add an experiment to compare our method with DistilBERT. We truly appreciate your time and feedback on our rebuttal. Best Regards, Authors of submission 2474

Reviewer 3DoF2023-08-21

Thanks for the update! My remaining questions are: - Is StableLM-7B and LLaMA-7B comparing apple-to-apple? If not, comparing StableLM-3B with LLaMA-3B by LLM-Pruner makes no sense to me... - LLama 13B's results are worse than the official results, for example, LLama 13B reports boolQ with 78.1 while here is 68.4. I understand the prompt may be different but 10 percent is a huge difference.

Authorsrebuttal2023-08-21

Dear Reviewer 3DoF: > Q1: Is StableLM-7B and LLaMA-7B comparing apple-to-apple? If not, comparing StableLM-3B with LLaMA-3B by LLM-Pruner makes no sense to me... Thanks for the valuable comment. As pointed out by the reviewer, StableLM-7B is not a perfect apple-to-apple comparison with LLaMA-7B. We select StableLM since they share a similar structure and have training corpora of similar size with LLaMA. Despite the inevitable gap between the two LLMs, we want to use this experiment to support the claim that our approach crafts lightweight LLMs with low resources, and even can sometimes achieve better performance than LLMs from scratch training. For example, the pruned LLaMA-3B only requires 7.3 Million tokens compared to the 800 Billion of StableLM-3B, with ~100,000$\times$ difference in corpus size. However, if an official LLaMA-3B is available, we also acknowledge that the LLaMA-3B obtained by LLM-Pruner may not outperform the LLaMA-3B from scratch training, due to the huge gap in the size of training data. We agree that “Scratch Training vs. Pruning” is an important topic [1] in the field of pruning and will follow your advice to incorporate the discussion and experiments about this in the main body of the revised version. [1] Rethinking the Value of Network Pruning. Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, Trevor Darrell --- > Q2: LLama 13B's results are worse than the official results, for example, LLama 13B reports boolQ with 78.1 while here is 68.4. I understand the prompt may be different but 10 percent is a huge difference. Yes. This problem is caused by the difference in prompts, and this issue has also been discussed in previous works. For example, [2] mentioned that *"Note: We are using lm-eval-harness to evaluate our performance. Therefore, LLaMA numbers are not supposed to be compared from the original paper since we are using different methods of measurement"*. This issue is also discussed in the GitHub repo(EleutherAI/lm-evaluation-harness). We follow the official instruction and also its prompt to evaluate the LLaMA-13B. All of our experiments use the same set of prompts to ensure fairness. [2] LaMini-LM: A Diverse Herd of Distilled Models from Large-Scale Instructions. Minghao Wu, Abdul Waheed, Chiyu Zhang, Muhammad Abdul-Mageed, Alham Fikri Aji Best Regards, Authors of Submission 2474

Reviewer 3DoF2023-08-21

Thanks for your response! For Q1: I would suggest to use Stability 7B and Stability 3B for this experiment. It is okay to show pruned-Stability-3B is worse than Stability-3B. This results can help understand the advantage/limitation of the proposed method and inspire future work. Also, I think this claim "pruned LLaMA-3B only requires 7.3 Million tokens compared to the 800 Billion of StableLM-3B" is not accurate, as pruned-llama-3b is 7.3M + (pretrained tokens of LLama-3B) instead of 7.3M. For Q2: I understand the Q2 is caused by different prompting and `lm-evaluation-harness` is definitely a choice. However, if the gap between LLama's paper and `lm-evaluation-harness` is huge, I would suggest to also report LLama's prompting results. Although LLama did not publish its prompts, LLama described what prompts they were using. For example, they said: for OpenBookQA, BoolQ they follow GPT-3's template; for other tasks, they follow Gao et al. (2021) and use the likelihood normalized by the number of characters in the completion. The reason I concern Q2 is because different prompting can lead to huge differences and randomness. Although in this submission, the comparisons are evaluated with the same prompting method, evaluating with a same SOTA prompting method v.s. with a same un-SOTA prompt method are still different. I appreciate the current `lm-evaluation-harness` results and would suggest to add another table (in appendix) to show your efforts to reproduce llama's results with llama's prompts, and show your pruned results. Thank you again.

Authorsrebuttal2023-08-21

> I would suggest to use Stability 7B and Stability 3B for this experiment. It is okay to show pruned-Stability-3B is worse than Stability-3B. Thanks for the suggestion. We will provide more results on StableLM. Since it takes time to conduct these experiments, like searching the hyperparameters and evaluating the models, we cannot provide it here. It would be better if we could discuss it earlier so that we can provide the results in the discussion period to fully address your concern. > Also, I think this claim "pruned LLaMA-3B only requires 7.3 Million tokens compared to the 800 Billion of StableLM-3B" is not accurate, as pruned-llama-3b is 7.3M + (pretrained tokens of LLama-3B) instead of 7.3M. We kindly remind the reviewer that this work is about model compression and thus we may focus on the compression cost. For instance, if we need a 5B model, the training cost of LLM-Pruner is only 7.3M corpus, while other feasible ways like pre-training an LLM from scratch require 800 billion tokens. > The reason I concern Q2 is because different prompting can lead to huge differences and randomness. Although in this submission, the comparisons are evaluated with the same prompting method, evaluating with a same SOTA prompting method v.s. with a same un-SOTA prompt method are still different. Thanks for your understanding that we cannot get the prompt of LLaMA since they didn't release the prompt. We will try to guess the prompt of the official LLaMA. If we find some useful results, we would report them in the appendix. And we also want to clarify that our focus is the relative performance of the pruned and the un-pruned model. To ensure fairness and make the evaluation a **standardized process**, a common practice is to use the official prompt of lm-eval-harness.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC