arXiv:2502.19159cs.CV2025-02AAAI被引 8

通过滑动窗口合并冗余层,实现大模型高效压缩且不降性能

Sliding-Window Merging for Compacting Patch-Redundant Layers in LLMs

  • 基于层间功能相似性,动态合并连续冗余层
  • 35%剪枝下零样本任务性能提升1.654%
  • 适合资源受限场景下的大模型轻量化部署

深度剪枝可加速大模型在资源受限环境中的推理,但直接删除整层会导致性能下降。本文通过核希尔伯特空间中层输出的相关性分析,发现层间存在'块状'冗余,连续层具有高度功能相似性。基于此提出滑动窗口合并(SWM)方法:自顶向下设定相似性阈值,选择连续层并进行参数整合,从而简化模型结构且保持性能。在多种架构和参数量的大模型上实验表明,该方法在零样本推理性能与剪枝后微调恢复质量上均优于现有技术。例如,在Vicuna-7B模型上35%剪枝时,零样本任务平均性能相比现有方法提升1.654%。此外,揭示了深度剪枝与宽度剪枝结合可进一步增强压缩效果。代码已开源。

原文摘要 · Abstract (English)

Depth-wise pruning accelerates LLM inference in resource-constrained scenarios but suffers from performance degradation due to direct removal of entire Transformer layers. This paper reveals ``Patch-like'' redundancy across layers via correlation analysis of the outputs of different layers in reproducing kernel Hilbert space, demonstrating consecutive layers exhibit high functional similarity. Building on this observation, this paper proposes Sliding-Window Merging (SWM) - a dynamic compression method that selects consecutive layers from top to bottom using a pre-defined similarity threshold, and compacts patch-redundant layers through a parameter consolidation, thereby simplifying the model structure while maintaining its performance. Extensive experiments on LLMs with various architectures and different parameter scales show that our method outperforms existing pruning techniques in both zero-shot inference performance and retraining recovery quality after pruning. In particular, in the experiment with 35% pruning on the Vicuna-7B model, our method achieved a 1.654% improvement in average performance on zero-shot tasks compared to the existing method. Moreover, we further reveal the potential of combining depth pruning with width pruning to enhance the pruning effect. Our codes are available at https://github.com/920927/SLM-a-sliding-layer-merging-method.

大模型压缩层剪枝滑动窗口性能保持

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。