动态剪枝提升大模型压缩效率,性能反超传统方法。
Change Is the Only Constant: Dynamic LLM Slicing based on Layer Redundancy
- 基于层冗余度评分,动态裁剪每层非必要参数。
- 相比SliceGPT基线,部分场景性能提升5%,困惑度降低7%。
- 适合追求高效部署且注重推理精度的模型优化研究者。
本文提出一种基于层冗余度(LR)评分的动态分层剪枝方法,用于大型语言模型(LLM)压缩。与传统固定剪枝不同,该方法通过测量各层输入与输出间的余弦相似度,量化其对输入的改变程度,进而按冗余度动态裁剪各层。在保持整体平均剪枝率一致的前提下,实现了更优的性能平衡。在Llama3-8B和Mistral-7B等模型上,多数据集实验表明,该方法不仅维持了模型表现,还在多个设置中实现最高达5%的性能提升,并在多个基准测试中观察到最高7%的困惑度下降,验证了其有效性。代码、模型权重与数据集已开源。
原文摘要 · Abstract (English)
This paper introduces a novel model compression approach through dynamic layer-specific pruning in Large Language Models (LLMs), enhancing the traditional methodology established by SliceGPT. By transitioning from constant to dynamic slicing, our method leverages the newly proposed Layer Redundancy (LR) score, which assesses how much change each layer changes its input by measuring the cosine similarity of the input to the output of the layer. We use this score to prune parts of individual layers based on redundancy in such a way that the average pruned percentage for all layers is a fixed value. We conducted extensive experiments using models like Llama3-8B and Mistral-7B on multiple datasets, evaluating different slicing bases and percentages to determine optimal configurations that balance efficiency and performance. Our findings show that our dynamic slicing approach not only maintains but, in many cases, enhances model performance compared to the baseline established by constant slicing methods. For instance, in several settings, we see performance improvements of up to 5% over the SliceGPT baseline. Additionally, a perplexity decrease by as much as 7% was observed across multiple benchmarks, validating the effectiveness of our method. The code, model weights, and datasets are open-sourced at https://github.com/RazvanDu/DynamicSlicing.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。