Abstract
We propose a novel Two-Stage framework for Structured Pruning (2SSP) for pruning Large Language Models (LLMs), which combines two different strategies of pruning, namely Width and Depth Pruning. The first stage (Width Pruning) removes entire neurons, hence their corresponding rows and columns, aiming to preserve the connectivity among the pruned structures in the intermediate state of the Feed-Forward Networks in each Transformer block. This is done based on an importance score measuring the impact of each neuron over the output magnitude. The second stage (Depth Pruning), instead, removes entire Attention submodules. This is done by applying an iterative process that removes the Attention submodules with the minimum impact on a given metric of interest (in our case, perplexity). We also propose a novel mechanism to balance the sparsity rate of the two stages w.r.t. to the desired global sparsity. Our method consistently outperforms five state-of-the-art competitors over three language modeling and six downstream tasks, with an up to two-order-of-magnitude gain in terms of pruning time.
Introduction
Large Language Models (LLMs) are powerful but computationally expensive and environmentally taxing to run. While "pruning" (removing unnecessary parts of the model) is a popular solution, most methods force a choice between precision and speed. Structured pruning—removing entire rows, columns, or layers—provides real-world hardware speedups but often causes significant drops in model performance.
Existing structured pruning methods usually operate at a single level of granularity, such as removing entire Transformer blocks (Depth Pruning) or trimming weight matrices (Width Pruning). The 2SSP framework proposes a "best of both worlds" approach that combines these two different pruning granularities to create smaller, faster models without the usual performance nosedive.
Methodology
The 2SSP framework operates in two distinct stages, guided by a novel balancing mechanism:
- Stage 1: Neuron (Width) Pruning: This stage targets the Feed-Forward Networks (FFNs). Instead of just looking at weight magnitudes, it calculates an "importance score" based on the $L_2$ norm of activations across a calibration dataset. It removes entire neurons (corresponding rows and columns) to preserve the functional "information path" through the network.
- Stage 2: Attention (Depth) Pruning: This stage targets the Attention submodules. It uses an iterative process to identify and remove the specific Attention modules whose absence has the least impact on the model's perplexity.
- Balancing Mechanism: A mathematical formula determines how much pruning to allocate to each stage based on the target global sparsity. This ensures that the model doesn't lose too much connectivity in the FFNs while taking advantage of the inherent redundancy in Attention blocks.
By removing rows and columns in a specific order, the framework ensures the remaining neurons stay connected in a way that maintains functional integrity. Because the first stage is "one-shot" and the second stage only iterates over submodules, the pruning process is up to two orders of magnitude faster than some competitors.
Experimental Results
The authors evaluated 2SSP across a variety of benchmarks, including language modeling (WikiText2, C4, FineWeb) and downstream tasks (MMLU, WinoGrande, PiQA, HellaSwag, ARC). The framework was tested on Mistral-v0.3 (7B), Llama-2 (7B), Qwen-2.5 (7B), and Phi-3 (14B).
As shown in the performance plots, 2SSP consistently outperformed five state-of-the-art competitors (including SliceGPT and ShortGPT) in perplexity across all tested models and sparsity rates (25%, 37.5%, and 50%). At 37.5% sparsity, 2SSP maintained significantly higher accuracy on downstream tasks. For example, on the Phi-3 14B model, 2SSP achieved an average zero-shot score of 58.92%, while the next best competitor trailed at 50.23%.
Furthermore, on an NVIDIA RTX 3090, a 50% pruned Llama-2 model achieved an inference time of 270.82ms compared to the dense model's 457.59ms—a substantial practical gain.
Conclusion
2SSP demonstrates that combining width and depth pruning is more effective than relying on a single granularity. While it struggles beyond 70% sparsity, it provides a highly efficient and accurate solution for moderate compression levels. Future work may explore applying this two-stage approach to other architectures beyond Transformers or integrating it with quantization techniques for even greater compression.
Paper Citation: Sandri, F., Cunegatti, E., & Iacca, G. (2025). 2SSP: A Two-Stage Framework for Structured Pruning of LLMs. Transactions on Machine Learning Research. https://github.com/FabrizioSandri/2SSP
Summary updated