Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

BlockPruner: Fine-grained Pruning for Large Language Models

About

With the rapid growth in the size and complexity of large language models (LLMs), the costs associated with their training and inference have escalated significantly. Research indicates that certain layers in LLMs harbor substantial redundancy, and pruning these layers has minimal impact on the overall performance. While various layer pruning methods have been developed based on this insight, they generally overlook the finer-grained redundancies within the layers themselves. In this paper, we delve deeper into the architecture of LLMs and demonstrate that finer-grained pruning can be achieved by targeting redundancies in multi-head attention (MHA) and multi-layer perceptron (MLP) blocks. We propose a novel, training-free structured pruning approach called BlockPruner. Unlike existing layer pruning methods, BlockPruner segments each Transformer layer into MHA and MLP blocks. It then assesses the importance of these blocks using perplexity measures and applies a heuristic search for iterative pruning. We applied BlockPruner to LLMs of various sizes and architectures and validated its performance across a wide range of downstream tasks. Experimental results show that BlockPruner achieves more granular and effective pruning compared to state-of-the-art baselines.

Longguang Zhong, Fanqi Wan, Ruijun Chen, Xiaojun Quan, Liangzhi Li• 2024

Related benchmarks

TaskDatasetResultRank
Language ModelingWikiText2
Perplexity8.16
3785
Language ModelingWikiText-2 (test)
PPL8.16
2333
Commonsense ReasoningHellaSwag
Accuracy72.2
1896
Commonsense ReasoningWinoGrande
Accuracy66.3
1442
Commonsense ReasoningPIQA
Accuracy76.93
757
Question AnsweringARC Challenge
Accuracy (ARC)29.8
598
Commonsense ReasoningWinoGrande
Accuracy24.2
453
Language ModelingWikiText2 v1 (test)
Perplexity8.16
383
Zero-shot ReasoningReasoning Suite Zero-shot (PIQA, HellaSwag, WinoGrande, ARC-e, ARC-c) (val test)
Average Accuracy64.53
297
Language ModelingWikiText2
Perplexity39.25
277
Showing 10 of 17 rows

Other info

Code

Follow for update