Table of Contents
Fetching ...

SwiftPrune: Hessian-Free Weight Pruning for Large Language Models

Yuhan Kang, Yang Shi, Mei We, Jun He, Jianchao Yang, Zeyu Xue, Jing Feng, Xinwang Liu

TL;DR

This work tackles the bottleneck of Hessian-based pruning in large language models by introducing SwiftPrune, a Hessian-free method that uses a contribution-oriented weight metric and EWMA-driven selection to prune weights with linear-time per-row complexity. By substituting the Hessian inverse with a simple $L$-score and applying EWMA, SwiftPrune obviates expensive second-order computations and sorting, while extending to hardware-friendly 2:4 structured sparsity that leverages Tensor Cores. Across Pythia, LLaMA2, and LLaMA3 models (7B–70B), it achieves significant speedups (average $12.29\\times$, up to $56.02\\times$) with minimal accuracy loss at 50% sparsity and even improves performance under structured pruning. The method enables rapid, hardware-aware model compression suitable for iterative pruning and deployment on accelerators, without requiring retraining. These results suggest substantial practical impact for deploying sparse LLMs at scale with reduced computational and energy costs.

Abstract

Post-training pruning, as one of the key techniques for compressing large language models, plays a vital role in lightweight model deployment and model sparsity. However, current mainstream pruning methods dependent on the Hessian matrix face significant limitations in both pruning speed and practical effectiveness due to the computationally intensive nature of second-order derivative calculations. This paper presents SwiftPrune, a novel Hessian-free weight pruning method that achieves hardware-efficient model compression through two key innovations: 1) SwiftPrune eliminates the need for computationally intensive Hessian matrix calculations by introducing a contribution-based weight metric, which evaluates the importance of weights without relying on second-order derivatives. 2) we employ the Exponentially Weighted Moving Average (EWMA) technique to bypass weight sorting, enabling the selection of weights that contribute most to LLM accuracy and further reducing time complexity. Our approach is extended to support structured sparsity pruning, facilitating efficient execution on modern hardware accelerators. We validate the SwiftPrune on three LLMs (namely LLaMA2, LLaMA3, and Pythia), demonstrating that it significantly enhances compression performance. The experimental findings reveal that SwiftPrune completes the pruning process within seconds, achieving an average speedup of 12.29x (up to 56.02x) over existing SOTA approaches.

SwiftPrune: Hessian-Free Weight Pruning for Large Language Models

TL;DR

This work tackles the bottleneck of Hessian-based pruning in large language models by introducing SwiftPrune, a Hessian-free method that uses a contribution-oriented weight metric and EWMA-driven selection to prune weights with linear-time per-row complexity. By substituting the Hessian inverse with a simple -score and applying EWMA, SwiftPrune obviates expensive second-order computations and sorting, while extending to hardware-friendly 2:4 structured sparsity that leverages Tensor Cores. Across Pythia, LLaMA2, and LLaMA3 models (7B–70B), it achieves significant speedups (average , up to ) with minimal accuracy loss at 50% sparsity and even improves performance under structured pruning. The method enables rapid, hardware-aware model compression suitable for iterative pruning and deployment on accelerators, without requiring retraining. These results suggest substantial practical impact for deploying sparse LLMs at scale with reduced computational and energy costs.

Abstract

Post-training pruning, as one of the key techniques for compressing large language models, plays a vital role in lightweight model deployment and model sparsity. However, current mainstream pruning methods dependent on the Hessian matrix face significant limitations in both pruning speed and practical effectiveness due to the computationally intensive nature of second-order derivative calculations. This paper presents SwiftPrune, a novel Hessian-free weight pruning method that achieves hardware-efficient model compression through two key innovations: 1) SwiftPrune eliminates the need for computationally intensive Hessian matrix calculations by introducing a contribution-based weight metric, which evaluates the importance of weights without relying on second-order derivatives. 2) we employ the Exponentially Weighted Moving Average (EWMA) technique to bypass weight sorting, enabling the selection of weights that contribute most to LLM accuracy and further reducing time complexity. Our approach is extended to support structured sparsity pruning, facilitating efficient execution on modern hardware accelerators. We validate the SwiftPrune on three LLMs (namely LLaMA2, LLaMA3, and Pythia), demonstrating that it significantly enhances compression performance. The experimental findings reveal that SwiftPrune completes the pruning process within seconds, achieving an average speedup of 12.29x (up to 56.02x) over existing SOTA approaches.

Paper Structure

This paper contains 13 sections, 8 equations, 2 figures, 8 tables, 1 algorithm.

Figures (2)

  • Figure 1: Our design of novel pruning method, using EWMA criteria.
  • Figure 2: Statistical magnitude detection of $L$ with EWMA method in LLaMA2-7B MLP blocks. $x$ axis presents the sequence number of each weight, and $y$ axis presents the numerical values. Ideal algorithms should show est approaches real mean and dev approaches real dev.