Abstract
Large Language Models (LLMs) are increasingly difficult to deploy due to their immense computational and memory requirements. While weight pruning offers a solution by removing redundant parameters, existing post-training pruning methods rely on human-designed heuristics that may be sub-optimal. This paper introduces Pruner-Zero, a framework that utilizes genetic programming to automatically evolve symbolic pruning metrics from scratch. By searching through millions of combinations of model statistics, Pruner-Zero discovered a novel metric—$|W|^2 \times \sigma(|G|)$—that consistently outperforms state-of-the-art hand-crafted methods like Wanda and SparseGPT across various model families and scales, without requiring expensive retraining.
Introduction
The deployment of Large Language Models (LLMs) on consumer-grade hardware is hindered by their massive parameter counts. Pruning—the systematic removal of weights—is a primary strategy for model compression. However, pruning techniques generally fall into two categories: retraining-based methods, which are computationally prohibitive for billion-parameter models, and post-training methods, which rely on "pruning metrics" to identify weight importance.
Historically, these metrics (such as Magnitude pruning or Wanda) have been hand-crafted by researchers through iterative trial and error. While effective, these human-designed rules likely represent a local optimum in the vast space of possible mathematical formulations. Pruner-Zero addresses this by treating the discovery of pruning metrics as a symbolic regression problem, allowing an evolutionary algorithm to "design" the optimal rule.
The Pruner-Zero Framework
Genetic Programming for Metric Discovery
Pruner-Zero employs Genetic Programming (GP) to explore the space of symbolic mathematical expressions. The framework treats LLM statistics as "genes" and mathematical functions as "operators":
- Search Space (Genes): Weight magnitudes ($W$), gradients ($G$), and activation norms ($X$).
- Operators: Standard mathematical functions including addition, multiplication, square root, logarithm, and absolute value.
- Evolutionary Loop: The process begins with a population of random symbolic trees. Each tree represents a potential pruning metric. The "fitness" of each metric is evaluated by pruning a proxy model (LLaMA-7B) and measuring the resulting change in perplexity—a measure of how well the model retains its language modeling capabilities. The most successful formulas are selected for crossover and mutation to produce the next generation.
Opposing Operation Simplification (OOS)
To accelerate the search and prevent the evolution of overly complex or redundant formulas (e.g., $e^{\ln(x)}$), the authors introduced Opposing Operation Simplification (OOS). This technique automatically simplifies inverse operations within the symbolic trees, ensuring the evolutionary process remains focused on meaningful mathematical relationships rather than computational noise.
The Discovered Metric
The evolutionary search converged on a surprisingly elegant and effective metric: $$\text{Pruner-Zero} = |W|^2 \times \sigma(|G|)$$ (where $\sigma$ denotes min-max scaling).
This formula reveals several key insights. First, it emphasizes that multiplication is the most effective way to combine different model statistics. Second, it highlights the importance of gradients ($G$) over activations ($X$). While recent state-of-the-art methods like Wanda rely heavily on activation norms, Pruner-Zero found that scaled gradients provide a more robust signal for weight importance across different model architectures.
Experimental Results
Performance and Efficiency
Pruner-Zero was evaluated against leading benchmarks, including Magnitude pruning, Wanda, and SparseGPT, across the LLaMA, LLaMA-2, and OPT model families.
- Perplexity: On LLaMA-7B at 50% sparsity, Pruner-Zero achieved a perplexity of 6.95, significantly better than Wanda (7.26) and SparseGPT (7.22).
- Zero-Shot Accuracy: On common-sense reasoning tasks (e.g., BoolQ, HellaSwag), models pruned with Pruner-Zero maintained high accuracy. For LLaMA-2-70B at 50% sparsity, the pruned model achieved a mean accuracy of 71.10%, remarkably close to the unpruned baseline.
- Computational Speed: Because Pruner-Zero avoids the complex Hessian matrix calculations required by SparseGPT, it is approximately 2x faster to execute while delivering superior pruning quality.
Generalizability
A significant finding of the study is the generalizability of the evolved metric. Although the formula was discovered using a LLaMA-7B proxy, it performed exceptionally well when applied to much larger models (LLaMA-2-70B) and entirely different architectures (OPT). This suggests that the discovered metric captures a fundamental principle of weight importance in transformer-based models.
Conclusion and Future Work
Pruner-Zero demonstrates that automated symbolic evolution can surpass human intuition in designing critical components for model compression. The discovered metric, $|W|^2 \times \sigma(|G|)$, provides a new state-of-the-art for post-training LLM pruning.
Future research may extend this framework to search for metrics specifically optimized for quantized models or hardware-specific constraints (such as N:M structured sparsity). By automating the design of pruning rules, Pruner-Zero paves the way for more efficient and accessible deployment of large-scale AI.
Summary updated