Compressing transformer weights makes large language models cheaper to deploy. But each layer's compression introduces an error. These errors accumulate as the signal passes through later layers, and how they accumulate is not well understood. We measure this directly: at each layer, we take the ratio of output to input error, calling it rho. A value below one means the layer absorbs the error; above one means it grows. Computing rho on six transformers (117M to 8B parameters) yields three findings. (i) Errors at layer t scale downstream by the product of later rho values, predicting representation drift (Spearman r = -0.44, p < 10^-4). This explains why compressing early layers hurts more than late ones, and why depth-decreasing sparsity schedules outperform uniform ones. Across architecture families, however, model width and redundancy matter more than rho alone. (ii) Within a layer, naive pruning shows a ~600x spread in component sensitivity. Activation-aware pruning (Wanda) shrinks this to 3-7x; the ranking reverses across architectures, so fixed importance scores do not transfer. (iii) For depth pruning, ranking layers by how far rho is from one takes two forward passes. It beats ShortGPT's Block Influence with 1.6x lower perplexity at eight layers removed, and physical deletion delivers 1.22x wall-clock speed-up. A blend of the two criteria does best (perplexity 14.2, 60.0% downstream accuracy on LLaMA-2-7B). Twelve Lean 4 norm inequalities provide machine-checked per-matrix error bounds. The contraction profile thus gives a training-free instrument for two decisions: where to compress within layers, and which to remove.


翻译:压缩Transformer的权重使大语言模型的部署成本降低,但每一层的压缩都会引入误差。这些误差随着信号通过后续层而累积,其累积机制尚未被充分理解。我们直接对此进行度量:在每一层,取输出误差与输入误差之比,将其称为ρ。当ρ小于1时,表示该层吸收了误差;大于1则表示误差增长。在六个Transformer模型(参数量从1.17亿到80亿)上计算ρ,得到三项发现:(i)第t层的误差通过后续各层的ρ值乘积向下游缩放,预测了表示漂移(斯皮尔曼秩相关系数r=-0.44,p<10^-4)。这解释了为何压缩早期层比压缩后期层危害更大,以及深度递减的稀疏度调度为何优于均匀调度。然而,不同架构族中,模型宽度和冗余度比单独的ρ更重要。(ii)在单层内,朴素剪枝显示出组件敏感性约600倍的差异。激活感知剪枝(Wanda)将此范围缩小至3-7倍;各架构间的排序发生反转,因此固定的重要性分数不可迁移。(iii)针对深度剪枝,依据ρ与1的偏离程度对层进行排序仅需两次前向传播。在移除八层的情况下,其性能优于ShortGPT的块影响方法,困惑度降低1.6倍,实际删除操作带来1.22倍的时钟速度提升。两种准则的混合效果最佳(LLaMA-2-7B模型的困惑度为14.2,下游任务准确率为60.0%)。十二条Lean 4范数不等式提供了机器验证的逐矩阵误差界。因此,收缩性曲线为两种决策提供了免训练工具:层内压缩的位置选择以及哪些层需要被移除。

0
下载
关闭预览

相关内容

大模型的模型压缩与有效推理综述
专知会员服务
43+阅读 · 2024年7月8日
结构保持图transformer综述
专知会员服务
42+阅读 · 2024年2月19日
《Transformer压缩》综述
专知会员服务
49+阅读 · 2024年2月14日
【AAAI2024】公平感知的Transformer模型结构剪枝
专知会员服务
43+阅读 · 2023年12月27日
【ICML2022】结构感知Transformer的图表示学习
专知会员服务
49+阅读 · 2022年6月17日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
【Tutorial】计算机视觉中的Transformer,98页ppt
专知
21+阅读 · 2021年10月25日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
【学界】DeepMind论文:深度压缩感知,新框架提升GAN性能
GAN生成式对抗网络
14+阅读 · 2019年5月23日
如何设计基于深度学习的图像压缩算法
论智
41+阅读 · 2018年4月26日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关VIP内容
大模型的模型压缩与有效推理综述
专知会员服务
43+阅读 · 2024年7月8日
结构保持图transformer综述
专知会员服务
42+阅读 · 2024年2月19日
《Transformer压缩》综述
专知会员服务
49+阅读 · 2024年2月14日
【AAAI2024】公平感知的Transformer模型结构剪枝
专知会员服务
43+阅读 · 2023年12月27日
【ICML2022】结构感知Transformer的图表示学习
专知会员服务
49+阅读 · 2022年6月17日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员