FinerCut:面向大语言模型的更细粒度可解释层级剪枝
FinerCut: Finer-grained Interpretable Layer Pruning for Large Language Models
AI总结:
FinerCut 提出一种细粒度可解释层级剪枝方法,将 Transformer 块内的自注意力和 FFN 层作为独立剪枝单元,在无需微调的情况下大幅压缩 Llama3 模型并保持高性能,同时揭示剪枝偏好规律。
摘要:
过参数化的 Transformer 网络是大语言模型(LLMs)的最先进架构。然而,这类模型包含数十亿参数,使得大规模计算成为必需,同时也引发了环境方面的担忧。为了解决这些问题,我们提出了 FinerCut,一种新的细粒度层级剪枝方法。与先前在 Transformer 块级别的工作不同,FinerCut 将块内的所有自注意力层和前馈网络(FFN)层都视为独立的剪枝候选。FinerCut 剪除那些移除后对模型输出造成最小变化的层——由此形成一种新的、精简的、可解释的且与任务无关的剪枝方法。在 9 个基准上测试,我们的方法在移除 25% 层的情况下保留了 Llama3-8B 的 90% 性能,在移除 30% 层的情况下保留了 Llama3-70B 的 95% 性能,全程无需微调或剪枝后重建。引人注目的是,我们观察到 FinerCut 产生了有趣的结果:Llama3-70B 中 42%(80 个中的 34 个)的自注意力层可以被移除,同时保留其 99% 的性能——移除后无需额外微调。此外,FinerCut 提供了一种工具来检查被剪除层的类型和位置,从而能够观察到有趣的剪枝行为。例如,我们观察到剪枝偏好自注意力层,且通常位于更深的连续解码器层。我们希望我们的见解能启发未来高效的大语言模型架构设计。
英文摘要:
Overparametrized transformer networks are the state-of-the-art architecture for Large Language Models (LLMs). However, such models contain billions of parameters making large compute a necessity, while raising environmental concerns. To address these issues, we propose FinerCut, a new form of fine-grained layer pruning, which in contrast to prior work at the transformer block level, considers all self-attention and feed-forward network (FFN) layers within blocks as individual pruning candidates. FinerCut prunes layers whose removal causes minimal alternation to the model's output -- contributing to a new, lean, interpretable, and task-agnostic pruning method. Tested across 9 benchmarks, our approach retains 90% performance of Llama3-8B with 25% layers removed, and 95% performance of Llama3-70B with 30% layers removed, all without fine-tuning or post-pruning reconstruction. Strikingly, we observe intriguing results with FinerCut: 42% (34 out of 80) of the self-attention layers in Llama3-70B can be removed while preserving 99% of its performance -- without additional fine-tuning after removal. Moreover, FinerCut provides a tool to inspect the types and locations of pruned layers, allowing to observe interesting pruning behaviors. For instance, we observe a preference for pruning self-attention layers, often at deeper consecutive decoder layers. We hope our insights inspire future efficient LLM architecture designs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。