PALS: Percentile-Aware Layerwise Sparsity for LLM Pruning
Summary
PALS (Percentile-Aware Layerwise Sparsity) is a novel one-shot pruning method for Large Language Models that overcomes the limitations of uniform sparsity approaches like Wanda and SparseGPT. It dynamically adjusts per-layer sparsity based on the 99th percentile of activation magnitudes, constrained to within ±5% of the overall target ratio. On LLaMA-2-7B at 50% sparsity, PALS achieved a WikiText-2 perplexity of 10.96, significantly outperforming uniform Wanda's 12.92 (mean over 9 runs, p < 0.001). The method's effectiveness is architecture-dependent, yielding marginal gains for LLaMA-3-8B and no improvement for Mistral-7B. The research also indicates that gradient-based allocation performs worse than random for discrete weight removal. PALS integrates into the pruning pipeline with negligible cost and requires no fine-tuning.
Key takeaway
For machine learning engineers optimizing LLM deployment, if you are pruning LLaMA-2-7B models, implement PALS to achieve better perplexity scores than uniform sparsity methods. Be aware that its benefits are architecture-dependent, so validate performance on LLaMA-3-8B or Mistral-7B. Avoid relying on gradient-based allocation for discrete weight pruning, as it performs worse than random.
Key insights
PALS adaptively prunes LLM layers based on activation percentiles, outperforming uniform sparsity for specific architectures.
Principles
- Transformer layer importance varies significantly.
- Gradient magnitude is a poor predictor for discrete weight removal impact.
Method
PALS adjusts per-layer sparsity using the 99th percentile of activation magnitudes, constrained to ±5% of the target ratio.
In practice
- Consider PALS for LLaMA-2-7B model pruning.
- Avoid gradient-based methods for discrete weight removal in pruning.
Topics
- LLM Pruning
- Sparsity
- Transformer Architectures
- LLaMA-2
- Activation Magnitudes
- Model Compression
Best for: Research Scientist, AI Engineer, AI Scientist, Machine Learning Engineer, NLP Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Machine Learning.