LoRAPrune: Structured Pruning Meets Low-Rank Parameter-Efficient Fine-Tuning

Mingyang Zhang, Hao Chen, Chunhua Shen, Zhen Yang, Linlin Ou, Xinyi Yu, Bohan Zhuang

TL;DR

This paper introduces LoRAPrune, a novel method that efficiently prunes Large Language Models (LLMs) by leveraging the low-rank adaptation (LoRA) technique. It achieves significant memory savings and performance improvements by using LoRA's own gradients for pruning, avoiding the costly computation of pre-trained model gradients.

What Problem Does This Paper Address?

Large Language Models (LLMs) are incredibly powerful but also massive, making them difficult and expensive to deploy. While Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA have made fine-tuning LLMs more accessible, the sheer size of these models still poses a deployment challenge. Model pruning is a common technique to reduce model size, but existing pruning methods often struggle with LoRA. Some methods use unstructured pruning, which prevents LoRA weights from being merged efficiently, while others rely on gradients from the original pre-trained weights, leading to high memory overhead. This gap leaves a need for pruning techniques that are both compatible with LoRA and memory-efficient.

Methods

LoRAPrune tackles this problem by introducing a LoRA-guided pruning criterion. Instead of using the gradients of the original pre-trained weights (which are often frozen during LoRA fine-tuning and computationally expensive to access), LoRAPrune utilizes the gradients of the LoRA weights themselves. This allows it to estimate the importance of weights without needing to compute or store the gradients of the full pre-trained model.

The framework integrates this criterion into an iterative pruning process. This means it prunes the model in stages, allowing for fine-tuning between pruning steps to recover performance. Specifically, LoRAPrune prunes structured components like attention heads and channels, which are more amenable to direct hardware acceleration compared to unstructured sparsity. A key aspect is that LoRAPrune can seamlessly merge the pruned LoRA weights back into the pre-trained weights, ensuring no additional computational cost during inference.

Datasets

The paper uses the following datasets:

  • LaMini dataset: Used for fine-tuning and evaluating compressed LLaMA models.
  • WikiText2 and PTB: Standard datasets used for perplexity evaluation.
  • Common sense reasoning datasets: PIQA, HellaSwag, WinoGrande, ARC-easy, ARC-challenge, OpenbookQA, used for zero-shot task classification.
  • MMLU: Used for evaluating in-context learning ability under a 5-shot setting.
  • LaMini instruction dataset: Used for training LoRAPrune on LLaMA-7b.
  • C4 dataset: Used for training LoRAPrune on LLaMA-13b, LLaMA-30b, and LLaMA-65b.

No new benchmarks were introduced.

Key Insights and Ideas

  • LoRA gradients are a powerful proxy for weight importance: The core insight is that the gradients of the LoRA matrices (A and B) can effectively approximate the importance of the original pre-trained weights, bypassing the need for expensive gradient computations on the full model.
  • Structured pruning is key for efficient deployment: By focusing on structured pruning (heads, channels), LoRAPrune enables direct inference speedups on standard hardware, unlike unstructured sparsity which often requires specialized hardware.
  • Joint pruning and fine-tuning is superior: The paper demonstrates that integrating pruning and fine-tuning iteratively yields better results than performing them separately.
  • Memory efficiency is paramount: LoRAPrune significantly reduces memory usage during pruning, enabling it to run on a single GPU even for very large models like LLaMA-65B.

Key Results

  • Performance: At a 50% compression rate on LLaMA models, LoRAPrune achieved a perplexity reduction of 4.81 on WikiText2 and 3.46 on PTB compared to LLM-Pruner. It also matched semi-structural pruning performance across multiple LLMs.
  • Memory Savings: LoRAPrune reduced memory usage by 52.6% compared to LLM-Pruner at a 50% compression rate.
  • Efficiency: LoRAPrune is significantly faster than LLM-Pruner, being 8.19x faster with CPU offloading and 2.75x faster without it. It also achieved a 64.6% increase in throughput compared to vanilla gradient-based pruning.
  • Scalability: The method successfully prunes large models like LLaMA-65B on a single GPU, even when quantized to 8-bit.
  • Zero-shot and Few-shot performance: Pruned models retained strong zero-shot and few-shot learning capabilities, with LoRAPrune often outperforming other methods and even matching unpruned models at certain sparsity levels.

Limitations and Future Work

  • Fine-tuning dependency: LoRAPrune requires fine-tuning to restore model performance. This limits its applicability in scenarios where fine-tuning is not feasible.
  • Future Work: The authors aim to further enhance pruning results at higher compression rates. They also suggest that their method is easily extensible to other PEFT methods based on LoRA.

Summary updated

BibTeX
@inproceedings{zhang2024loraprune,
  author = {Mingyang Zhang and Hao Chen and Chunhua Shen and Zhen Yang and Linlin Ou and Xinyi Yu and Bohan Zhuang},
  title = {{LoRAPrune: Structured Pruning Meets Low-Rank Parameter-Efficient Fine-Tuning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.178},
}
Figure