A Simple and Effective Pruning Approach for Large Language Models
Abstract: As their size increases, Large Languages Models (LLMs) are natural candidates for network pruning methods: approaches that drop a subset of network weights while striving to preserve performance. Existing methods, however, require either retraining, which is rarely affordable for billion-scale LLMs, or solving a weight reconstruction problem reliant on second-order information, which may also be computationally expensive. In this paper, we introduce a novel, straightforward yet effective pruning method, termed Wanda (Pruning by Weights and activations), designed to induce sparsity in pretrained LLMs. Motivated by the recent observation of emergent large magnitude features in LLMs, our approach prunes weights with the smallest magnitudes multiplied by the corresponding input activations, on a per-output basis. Notably, Wanda requires no retraining or weight update, and the pruned LLM can be used as is. We conduct a thorough evaluation of our method Wanda on LLaMA and LLaMA-2 across various language benchmarks. Wanda significantly outperforms the established baseline of magnitude pruning and performs competitively against recent method involving intensive weight update. Code is available at https://github.com/locuslab/wanda.
- Intriguing properties of quantization at scale. In NeurIPS, 2023.
- Noiseout: A simple way to prune neural networks. arXiv preprint arXiv:1611.06211, 2016.
- Rethinking the role of scale for in-context learning: An interpretability-based case study at 66 billion scale. In Association for Computational Linguistics (ACL), 2023.
- Quantease: Optimization-based quantization for language models – an efficient and intuitive algorithm. arXiv preprint arXiv:2309.01885, 2023.
- Fast as chita: Neural network pruning with combinatorial optimization. In ICML, 2023.
- Pythia: A suite for analyzing large language models across training and scaling. arXiv preprint arXiv:2304.01373, 2023.
- What is the state of neural network pruning? In Proceedings of Machine Learning and Systems, 2020.
- Gpt takes the bar exam. arXiv preprint arXiv:2212.14402, 2022.
- Understanding and overcoming the challenges of efficient transformer quantization. arXiv:2109.12948, 2021.
- Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
- Sparks of artificial general intelligence: Early experiments with gpt-4. arXiv preprint arXiv:2303.12712, 2023.
- The lottery ticket hypothesis for pre-trained bert networks. NeurIPS, 2020.
- BoolQ: Exploring the surprising difficulty of natural yes/no questions. arXiv preprint arXiv:1905.10044, 2019.
- Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018.
- ImageNet: A large-scale hierarchical image database. In CVPR, 2009.
- LLM.int8(): 8-bit matrix multiplication for transformers at scale. In NeurIPS, 2022.
- Spqr: A sparse-quantized representation for near-lossless llm weight compression. arXiv preprint arXiv:2306.03078, 2023.
- Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
- Stochastic activation pruning for robust adversarial defense. In International Conference on Learning Representations, 2018.
- An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
- Coreset-based neural network compression. In ECCV, 2018.
- Christoforos Nalmpantis Elena Voita, Javier Ferrando. Neurons in large language models: Dead, n-gram, positional. arXiv preprint arXiv:2309.04827, 2023.
- Rigging the lottery: Making all tickets winners. In ICML, 2020.
- Reducing transformer depth on demand with structured dropout. In International Conference on Learning Representations, 2020.
- Depgraph: Towards any structural pruning. In Conference on Computer Vision and Pattern Recognition, 2023.
- The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR, 2019.
- Stabilizing the lottery ticket hypothesis. In ICML, 2020.
- Spdy: Accurate pruning with speedup guarantees. In ICML, 2022.
- SparseGPT: Massive language models can be accurately pruned in one-shot. In ICML, 2023.
- Optimal Brain Compression: A framework for accurate post-training quantization and pruning. In NeurIPS, 2022.
- GPTQ: Accurate post-training compression for generative pretrained transformers. In ICLR, 2023a.
- Scaling laws for sparsely-connected foundation models. arXiv preprint arXiv:2309.08520, 2023b.
- Why random pruning is all we need to start sparse. In ICML, 2023.
- The state of sparsity in deep neural networks. In ICML, 2019.
- A framework for few-shot language model evaluation. Version v0. 0.1. Sept, 2021.
- Learning both weights and connections for efficient neural networks. In NeurIPS, 2015.
- Deep compression: Compressing deep neural networks with pruning, trained quantization and Huffman coding. In ICLR, 2016.
- Optimal brain surgeon and general network pruning. In IEEE International Conference on Neural Networks, 1993.
- Measuring massive multitask language understanding. In ICLR, 2021.
- Revisiting pruning at initialization through the lens of ramanujan graph? In ICLR, 2023.
- Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022.
- LoRA: Low-rank adaptation of large language models. In ICLR, 2021.
- Network trimming: A data-driven neuron pruning approach towards efficient deep architectures. arXiv preprint arXiv:1607.03250, 2016.
- Accelerated sparse neural training: A provable and efficient method to find N:M transposable masks. In NeurIPS, 2021.
- Pruning’s effect on generalization through the lens of training and regularization. In NeurIPS, 2022.
- Bert busters: Outlier dimensions that disrupt transformers. In ACL Findings, 2021.
- Soft threshold weight reparameterization for learnable sparsity. In ICML, 2020.
- Accurate neural network pruning requires rethinking sparse optimization. arXiv preprint arXiv:2308.02060, 2023.
- A fast post-training pruning framework for transformers. In NeurIPS, 2022.
- Optimal brain damage. In NeurIPS, 1989.
- Snip: Single-shot network pruning based on connection sensitivity. In ICLR, 2018.
- Awq: Activation-aware weight quantization for llm compression and acceleration. arXiv preprint arXiv:2306.00978, 2023.
- Sparsity may cry: Let us fail (current) sparse neural networks together! In ICLR, 2023a.
- Learning efficient convolutional networks through network slimming. In ICCV, 2017.
- Rethinking the value of network pruning. In ICLR, 2019.
- A convnet for the 2020s. In CVPR, 2022.
- Deja vu: Contextual sparsity for efficient llms at inference time. In ICML, 2023b.
- Learning sparse neural networks through l0 regularization. In ICLR, 2018.
- Positional artefacts propagate through masked language model embeddings. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, August 2021.
- Llm-pruner: On the structural pruning of large language models. arXiv preprint arXiv:2305.11627, 2023.
- Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
- Can a suit of armor conduct electricity? a new dataset for open book question answering. arXiv preprint arXiv:1809.02789, 2018.
- Accelerating sparse deep neural networks. arXiv preprint arXiv:2104.08378, 2021.
- Pruning convolutional neural networks for resource efficient inference. In ICLR, 2017.
- Importance estimation for neural network pruning. In CVPR, 2019.
- Gradient-free structured pruning with unlabeled data. In International Conference on Machine Learning, 2023.
- OpenAI. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
- Unmasking the lottery ticket hypothesis: What’s encoded in a winning ticket’s mask? In ICLR, 2023.
- AC/DC: Alternating compressed/decompressed training of deep neural networks. In NeurIPS, 2021.
- Outliers dimensions that disrupt transformers are driven by frequency. arXiv preprint arXiv:2205.11380, 2022.
- Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 2020.
- Pruning pre-trained language models with principled importance and self-regularization. In ACL, 2023.
- Comparing rewinding and fine-tuning in neural network pruning. In ICLR, 2020.
- Winogrande: An adversarial winograd schema challenge at scale. arXiv preprint arXiv:1907.10641, 2019.
- Movement pruning: Adaptive sparsity by fine-tuning. In NeurIPS, 2020.
- Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100, 2022.
- Are emergent abilities of large language models a mirage? arXiv preprint arXiv:2304.15004, 2023.
- Structural pruning via latency-saliency knapsack. NeurIPS, 2022.
- High-throughput generative inference of large language models with a single gpu. In ICML, 2023.
- Woodfisher: Efficient second-order approximation for neural network compression. In NeurIPS, 2020.
- All bark and no bite: Rogue dimensions in transformer language models obscure representational quality. arXiv:2109.04404, 2021.
- LLaMA: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023a.
- Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023b.
- Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018.
- Emergent abilities of large language models. In Transactions on Machine Learning Research, 2022a.
- Outlier suppression: Pushing the limit of low-bit transformer language models. In NeurIPS, 2022b.
- Structured pruning learns compact and accurate models. In Association for Computational Linguistics (ACL), 2022.
- Smoothquant: Accurate and efficient post-training quantization for large language models. In ICML, 2023.
- Hellaswag: Can a machine really finish your sentence? arXiv preprint arXiv:1905.07830, 2019.
- Platon: Pruning large transformer models with upper confidence bound of weight importance. In ICML, 2021.
- OPT: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022.
- A three-regime model of network pruning. In ICML, 2023.
- To prune, or not to prune: exploring the efficacy of pruning for model compression. arXiv preprint arXiv:1710.01878, 2017.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.