Two-Stage Regularization-Based Structured Pruning for LLMs

Mingkuan Feng, Jinyang Wu, Siyuan Liu, Shuai Zhang, Ruihan Jin, Feihu Che, Pengpeng Shao, Zhengqi Wen, Jianhua Tao · DOI

Abstract

The deployment of large language models (LLMs) is largely hindered by their large number of parameters. Structural pruning has emerged as a promising solution. Prior structured pruning methods directly remove unimportant parameters based on certain metrics, which often causes knowledge loss and necessitates extensive retraining. To overcome this, we introduce a novel pruning method TRSP: Two-Stage Regularization-Based Structured Pruning for LLMs. Specifically, we multiply the output of each transformer layer by an initial learnable weight and iteratively learn these weights by adding their $\ell_1$-norm as a regularization term to the loss function, serving as the first-stage regularization. Subsequently, we apply additional regularization to the difference between the output and input of layers with smaller weights, encouraging the shift of knowledge to the preserved layers. This serves as the second-stage regularization. TRSP retains more knowledge and better preserves model performance than direct parameter elimination. Through extensive experimentation we show that TRSP outperforms strong layer-wise structured pruning methods without requiring retraining. As a layer-wise pruning method, it delivers notable end-to-end acceleration, making it a promising solution for efficient LLM deployment.

Introduction

Large Language Models (LLMs) are notoriously difficult to deploy due to their massive memory and computational requirements. Structured pruning—specifically layer-wise pruning—is a popular solution because it removes entire transformer blocks, leading to direct hardware acceleration without needing specialized kernels.

However, existing layer-wise pruning methods typically follow a "cut first, fix later" approach: they use a metric to identify "unimportant" layers, delete them immediately, and then attempt to recover the resulting performance loss through fine-tuning. This abruptly creates a "knowledge gap" that is difficult and computationally expensive to bridge. We propose TRSP, which introduces a "soft" transition before the actual pruning occurs, allowing the model to adapt to the absence of specific layers before they are removed.

Methodology

TRSP introduces a two-stage regularization process to "prepare" an LLM for parameter removal by shifting knowledge away from unimportant layers before they are deleted. The process consists of four key stages:

  1. Data Preparation: A very small subset of data (e.g., 128 samples) is selected from standard benchmarks to guide the regularization.
  2. Stage 1 Regularization (Identify): The output of each transformer layer is multiplied by a learnable scalar weight. The model is trained with an $\ell_1$ penalty on these weights, forcing the weights of redundant layers toward zero and identifying them for pruning in a greedy, iterative fashion.
  3. Stage 2 Regularization (Transfer): For the layers identified in Stage 1, we apply a second regularization term that minimizes the difference between the layer's input and output ($X_{out} - X_{in}$). This encourages these layers to act as identity mappings. Effectively, the model learns to "pass through" these layers, forcing the remaining layers to take over the processing burden.
  4. Pruning: The regularized layers are directly removed. Because the model has already adapted to these layers doing "nothing," the performance drop is minimal.
The TRSP pipeline compared to traditional layer-wise pruning methods.

Experimental Results

We evaluated TRSP across several model families, including Phi-2, OPT (2.7B to 13B), and LLaMA (v2-7B/13B and v3-8B). TRSP consistently outperformed strong baselines like SLEB, ShortGPT, and LaCo across various pruning ratios.

Performance Preservation

As shown in the figure below, TRSP maintains significantly lower perplexity than competing methods as the pruning ratio increases. On LLaMA2-7B at a 25% pruning ratio, TRSP achieved a perplexity 20% lower than the second-best method (ShortGPT). Even at high pruning ratios (up to 60%), where other methods like SLEB saw performance collapse, TRSP remained robust.

Perplexity vs. Pruning Ratio across different structured pruning methods.

Efficiency and Acceleration

Unlike baselines that require LoRA fine-tuning on 1,000+ samples to recover accuracy, TRSP achieves superior results using only a tiny fraction of data (128 samples). This makes it significantly cheaper to implement. Furthermore, the structural nature of the pruning leads to direct hardware benefits: pruning OPT-13B by 50% resulted in a 75% increase in throughput and a 46% reduction in latency on an NVIDIA A100 GPU.

Conclusion

TRSP offers a novel approach to structured pruning by transforming redundant layers into identity mappings before removal. This "knowledge transfer" strategy allows for significant model compression and inference speedups without the need for expensive post-pruning retraining. Future work will explore the applicability of TRSP to non-transformer architectures and a wider variety of downstream tasks.

Summary updated

BibTeX
@misc{feng2025two,
  author = {Mingkuan Feng and Jinyang Wu and Siyuan Liu and Shuai Zhang and Ruihan Jin and Feihu Che and Pengpeng Shao and Zhengqi Wen and Jianhua Tao},
  title = {{Two-Stage Regularization-Based Structured Pruning for LLMs}},
  year = {2025},
  eprint = {2505.18232},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.18232},
}
Figure