Abstract
The rapid increase in the parameter counts of Large Language Models (LLMs), which often reach into the billions or even trillions, presents significant challenges for their practical deployment, particularly in resource-constrained environments. To address this issue, we propose PIP (Perturbation-based Iterative Pruning), a novel double-view structured pruning method to optimize LLMs, which combines information from two different views: the unperturbed view and the perturbed view. With the calculation of gradient differences, PIP iteratively prunes those that struggle to distinguish between these two views. Our experiments show that PIP reduces the parameter count by approximately 20% while retaining over 85% of the original model's accuracy across varied benchmarks. In some cases, the performance of the pruned model is within 5% of the unpruned version, demonstrating PIP's ability to preserve key aspects of model effectiveness. Moreover, PIP consistently outperforms existing state-of-the-art (SOTA) structured pruning methods, establishing it as a leading technique for optimizing LLMs in constrained environments.
Introduction
As modern Large Language Models (LLMs) scale to hundreds of billions of parameters, the hardware requirements for deployment have become prohibitive. For instance, a model like LLaMA3-405B requires massive GPU clusters just to fit into memory at half-precision. While compression techniques such as quantization and pruning have been explored, existing structured pruning methods—which remove entire architectural blocks—often rely on "single-view" metrics like weight magnitude or input-output similarity.
These traditional metrics frequently overlook a critical aspect of model intelligence: semantic robustness. A truly effective model layer should be sensitive to semantic shifts. If a layer processes a logical sentence and a nonsensical, perturbed version identically, that layer is likely redundant. PIP (Perturbation-based Iterative Pruning) addresses this by evaluating layers through their ability to discriminate between original and semantically distorted text.
Methodology
PIP introduces a "double-view" approach to assess layer importance, followed by a greedy iterative pruning strategy. The process consists of four primary stages:
1. Text Perturbation
For a given input, PIP generates a "perturbed" counterpart using character-level edits such as swapping, replacement, or insertion. These edits are specifically designed to maintain the original syntax while radically altering the semantic meaning (e.g., changing "The meeting will start later" to "The meeting will start alter").
2. The PertImport Metric
The core of PIP is the PertImport metric. It calculates the gradient differences between the original and perturbed views. Using a first-order Taylor approximation, PIP estimates the sensitivity of each layer. Layers with the smallest gradient differences are identified as "semantically weak," as they fail to distinguish between the two views and are thus prioritized for removal.
3. Iterative Pruning Strategy
Unlike one-shot pruning methods, PIP employs an iterative approach. It prunes the least sensitive layers, then re-evaluates the gradients on the updated, slimmer architecture. This ensures the pruning process adapts to the functional shifts that occur when layers are removed.
4. Consistency Discriminator
To maintain stability, PIP includes a consistency discriminator that filters out layers exhibiting high variability in gradient differences across different types of perturbations, ensuring that only truly redundant layers are pruned.
Experimental Results
The authors evaluated PIP across several LLM families, including LLaMA2 (13B, 70B), LLaMA3 (8B, 70B), and OPT (1.3B to 13B). Calibration was performed with minimal data—fewer than 10 samples from the WikiText2 dataset.
Performance and Accuracy
PIP successfully reduced parameter counts by approximately 20% while retaining over 85% of the original model's accuracy. On the LLaMA3-8B model, PIP achieved an average benchmark score of 53.5, significantly higher than competing methods like ShortGPT (52.6) and SliceGPT (46.0).
Hardware Efficiency
Beyond accuracy, PIP delivers tangible hardware benefits. For LLaMA2-13B, a 19.5% pruning ratio reduced memory consumption from 24.4 GiB to 19.6 GiB. Furthermore, the "Time-Per-Output-Token" latency improved from 73.4ms to 58.9ms, representing a significant gain in inference speed.
Conclusion
PIP establishes a new state-of-the-art for structured pruning by leveraging semantic sensitivity as a proxy for layer importance. By focusing on the model's ability to distinguish meaning through a double-view gradient analysis, PIP achieves high compression ratios with minimal performance loss. Future work will focus on extending this methodology to multimodal data and developing adaptive perturbation mechanisms to further refine the pruning process.
Summary updated